From 0fc80bbd9e2fe6c039e8d6304dc1c3ae02a86093 Mon Sep 17 00:00:00 2001 From: maciej-nedza <76946708+maciej-nedza@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:22:25 +0100 Subject: [PATCH] [DE-679] 1.0.0-alpha (#12) --- README.md | 546 +- advance_invoice_controller.go | 250 +- api_exports_controller.go | 638 +- base_controller.go | 54 +- billing_portal_controller.go | 340 +- client.go | 400 +- components_controller.go | 1908 +++--- configuration.go | 170 +- coupons_controller.go | 1306 ++--- custom_fields_controller.go | 853 +-- customers_controller.go | 522 +- default_configuration.go | 46 +- doc/client.md | 120 +- doc/controllers/advance-invoice.md | 236 +- doc/controllers/api-exports.md | 590 +- doc/controllers/billing-portal.md | 356 +- doc/controllers/components.md | 3222 +++++------ doc/controllers/coupons.md | 1602 ++--- doc/controllers/custom-fields.md | 772 +-- doc/controllers/customers.md | 750 +-- .../events-based-billing-segments.md | 498 +- doc/controllers/events.md | 452 +- doc/controllers/insights.md | 444 +- doc/controllers/invoices.md | 5146 ++++++++--------- doc/controllers/offers.md | 512 +- doc/controllers/payment-profiles.md | 1294 ++--- doc/controllers/product-families.md | 606 +- doc/controllers/product-price-points.md | 1390 ++--- doc/controllers/products.md | 1040 ++-- doc/controllers/proforma-invoices.md | 648 +-- doc/controllers/reason-codes.md | 446 +- doc/controllers/referral-codes.md | 112 +- doc/controllers/sales-commissions.md | 530 +- doc/controllers/sites.md | 316 +- doc/controllers/subscription-components.md | 2080 +++---- .../subscription-group-invoice-account.md | 438 +- doc/controllers/subscription-group-status.md | 342 +- doc/controllers/subscription-groups.md | 996 ++-- .../subscription-invoice-account.md | 518 +- doc/controllers/subscription-notes.md | 404 +- doc/controllers/subscription-products.md | 442 +- doc/controllers/subscription-status.md | 2262 ++++---- doc/controllers/subscriptions.md | 2186 +++---- doc/controllers/webhooks.md | 578 +- doc/http-configuration.md | 34 +- doc/models/account-balance.md | 42 +- doc/models/account-balances.md | 70 +- doc/models/ach-agreement.md | 58 +- doc/models/activate-subscription-request.md | 42 +- doc/models/add-coupons-request.md | 48 +- doc/models/add-subscription-to-a-group.md | 48 +- doc/models/address-change.md | 35 + doc/models/agreement-acceptance.md | 64 +- doc/models/allocate-components.md | 99 +- doc/models/allocation-expiration-date.md | 42 +- doc/models/allocation-preview-direction.md | 28 +- doc/models/allocation-preview-item.md | 96 +- .../allocation-preview-line-item-kind.md | 36 +- doc/models/allocation-preview-line-item.md | 66 +- doc/models/allocation-preview-response.md | 54 +- doc/models/allocation-preview.md | 74 +- doc/models/allocation-response.md | 60 +- doc/models/allocation-settings.md | 50 +- doc/models/allocation.md | 98 +- doc/models/applied-credit-note-data.md | 46 +- doc/models/attribute-error.md | 48 +- doc/models/auto-invite.md | 28 +- doc/models/auto-resume.md | 42 +- doc/models/bank-account-attributes.md | 73 +- doc/models/bank-account-holder-type.md | 32 +- doc/models/bank-account-payment-profile.md | 100 +- doc/models/bank-account-response.md | 62 +- doc/models/bank-account-type.md | 32 +- doc/models/bank-account-vault.md | 38 +- .../bank-account-verification-request.md | 48 +- doc/models/bank-account-verification.md | 46 +- doc/models/base-refund-error.md | 68 +- doc/models/base-string-error.md | 50 +- doc/models/basic-date-field.md | 44 +- doc/models/batch-job-response.md | 54 +- doc/models/batch-job.md | 58 +- doc/models/billing-address.md | 60 +- doc/models/billing-manifest-item.md | 76 +- doc/models/billing-manifest-line-item-kind.md | 40 +- doc/models/billing-manifest.md | 110 +- doc/models/billing-schedule.md | 46 +- doc/models/breakouts.md | 54 +- ...bulk-component-s-price-point-assignment.md | 58 +- ...ulk-create-product-price-points-request.md | 68 +- ...lk-create-product-price-points-response.md | 58 +- doc/models/bulk-create-segments.md | 134 +- doc/models/bulk-update-segments-item.md | 68 +- doc/models/bulk-update-segments.md | 164 +- doc/models/calendar-billing.md | 56 +- .../cancel-grouped-subscriptions-request.md | 42 +- doc/models/cancellation-method.md | 38 +- doc/models/cancellation-options.md | 46 +- doc/models/cancellation-request.md | 48 +- doc/models/card-type.md | 100 +- doc/models/chargify-ebb.md | 60 +- doc/models/cleanup-scope.md | 32 +- ...lection-method.md => collection-method.md} | 36 +- .../component-allocation-error-exception.md | 80 +- doc/models/component-allocation-error-item.md | 54 +- doc/models/component-cost-data-rate-tier.md | 58 +- doc/models/component-cost-data.md | 62 +- doc/models/component-currency-price.md | 60 +- .../component-currency-prices-response.md | 58 +- doc/models/component-custom-price.md | 88 +- doc/models/component-kind.md | 38 +- .../component-price-point-error-exception.md | 64 +- .../component-price-point-error-item.md | 50 +- doc/models/component-price-point-item.md | 60 +- doc/models/component-price-point-response.md | 55 +- doc/models/component-price-point.md | 83 +- doc/models/component-price-points-response.md | 86 +- doc/models/component-price.md | 64 +- doc/models/component-response.md | 56 +- .../component-s-price-point-assignment.md | 52 +- doc/models/component.md | 118 +- doc/models/compounding-strategy.md | 28 +- doc/models/consolidated-invoice.md | 72 +- doc/models/count-response.md | 42 +- doc/models/coupon-currency-request.md | 52 +- doc/models/coupon-currency-response.md | 80 +- doc/models/coupon-currency.md | 54 +- doc/models/coupon-response.md | 54 +- doc/models/coupon-restriction.md | 58 +- doc/models/coupon-subcodes-response.md | 70 +- doc/models/coupon-subcodes.md | 46 +- doc/models/coupon-usage.md | 62 +- doc/models/coupon.md | 106 +- doc/models/create-allocation-request.md | 56 +- doc/models/create-allocation.md | 72 +- .../create-component-price-point-request.md | 140 +- .../create-component-price-points-request.md | 88 +- doc/models/create-currency-price.md | 50 +- doc/models/create-currency-prices-request.md | 54 +- doc/models/create-customer-request.md | 60 +- doc/models/create-customer.md | 90 +- doc/models/create-ebb-component.md | 92 +- doc/models/create-invoice-address.md | 70 +- doc/models/create-invoice-coupon.md | 78 +- doc/models/create-invoice-item.md | 84 +- .../create-invoice-payment-application.md | 46 +- doc/models/create-invoice-payment-request.md | 62 +- doc/models/create-invoice-payment.md | 60 +- doc/models/create-invoice-request.md | 136 +- doc/models/create-invoice-status.md | 40 +- doc/models/create-invoice.md | 98 +- doc/models/create-metadata-request.md | 52 +- doc/models/create-metadata.md | 46 +- doc/models/create-metafields-request.md | 48 +- doc/models/create-metered-component.md | 146 +- .../create-multi-invoice-payment-request.md | 72 +- doc/models/create-multi-invoice-payment.md | 78 +- doc/models/create-offer-component.md | 46 +- doc/models/create-offer-request.md | 80 +- doc/models/create-offer.md | 88 +- doc/models/create-on-off-component.md | 86 +- doc/models/create-or-update-coupon.md | 64 +- .../create-or-update-product-request.md | 64 +- doc/models/create-or-update-product.md | 78 +- doc/models/create-or-update-segment-price.md | 56 +- doc/models/create-payment-profile-request.md | 57 +- doc/models/create-payment-profile.md | 115 +- doc/models/create-payment.md | 54 +- doc/models/create-prepaid-component.md | 56 +- doc/models/create-prepayment-request.md | 54 +- doc/models/create-prepayment-response.md | 54 +- doc/models/create-prepayment.md | 58 +- doc/models/create-product-currency-price.md | 50 +- .../create-product-currency-prices-request.md | 54 +- doc/models/create-product-family-request.md | 48 +- doc/models/create-product-family.md | 46 +- .../create-product-price-point-request.md | 64 +- doc/models/create-product-price-point.md | 86 +- doc/models/create-quantity-based-component.md | 118 +- doc/models/create-reason-code-request.md | 50 +- doc/models/create-reason-code.md | 50 +- doc/models/create-segment-request.md | 130 +- doc/models/create-segment.md | 136 +- doc/models/create-subscription-component.md | 74 +- .../create-subscription-group-request.md | 60 +- doc/models/create-subscription-group.md | 56 +- doc/models/create-subscription-request.md | 112 +- doc/models/create-subscription.md | 204 +- doc/models/create-usage-request.md | 56 +- doc/models/create-usage.md | 58 +- doc/models/created-prepayment.md | 62 +- doc/models/credit-card-attributes.md | 50 +- doc/models/credit-card-payment-profile.md | 122 +- doc/models/credit-note-1.md | 102 +- doc/models/credit-note-application.md | 58 +- doc/models/credit-note-line-item.md | 80 +- doc/models/credit-note-status.md | 16 + doc/models/credit-note.md | 102 +- doc/models/credit-scheme-request.md | 42 +- doc/models/credit-scheme.md | 30 +- doc/models/credit-type.md | 34 +- doc/models/currency-price-role.md | 34 +- doc/models/currency-price.md | 60 +- doc/models/currency-prices-response.md | 58 +- doc/models/current-vault.md | 82 +- doc/models/custom-field-owner.md | 14 + doc/models/customer-1.md | 62 +- doc/models/customer-attributes.md | 92 +- doc/models/customer-billing-address-change.md | 29 - doc/models/customer-change.md | 204 +- .../customer-changes-preview-response.md | 202 +- doc/models/customer-custom-fields-change.md | 85 +- .../customer-error-response-exception.md | 48 +- doc/models/customer-payer-change.md | 62 +- doc/models/customer-response.md | 54 +- .../customer-shipping-address-change.md | 29 - doc/models/customer.md | 102 +- doc/models/deduct-service-credit-request.md | 54 +- doc/models/deduct-service-credit.md | 52 +- doc/models/delayed-cancellation-response.md | 42 +- .../delete-subscription-group-response.md | 46 +- doc/models/direction.md | 28 +- doc/models/discount-type.md | 28 +- doc/models/ebb-component.md | 120 +- doc/models/ebb-event.md | 76 +- doc/models/enable-webhooks-request.md | 42 +- doc/models/enable-webhooks-response.md | 42 +- doc/models/endpoint-response.md | 58 +- doc/models/endpoint.md | 64 +- .../error-array-map-response-exception.md | 52 +- doc/models/error-list-response-exception.md | 54 +- .../error-string-map-response-exception.md | 48 +- doc/models/errors.md | 58 +- ...-billing-list-segments-errors-exception.md | 64 +- .../event-based-billing-segment-error.md | 60 +- ...-based-billing-segment-errors-exception.md | 68 +- .../event-based-billing-segment-exception.md | 56 +- doc/models/event-response.md | 64 +- doc/models/event-type.md | 92 +- doc/models/event.md | 72 +- doc/models/extended-interval-unit.md | 30 +- doc/models/failed-payment-action.md | 34 +- doc/models/first-charge-type.md | 30 +- .../full-subscription-group-response.md | 80 +- .../get-one-time-token-payment-profile.md | 122 +- doc/models/get-one-time-token-request.md | 86 +- doc/models/group-billing.md | 54 +- doc/models/group-settings.md | 60 +- doc/models/group-target-type.md | 38 +- doc/models/group-target.md | 50 +- doc/models/include-not-null.md | 42 +- doc/models/include-option.md | 28 +- doc/models/interval-unit.md | 28 +- doc/models/invoice-address.md | 60 +- doc/models/invoice-balance-item.md | 50 +- doc/models/invoice-consolidation-level.md | 34 +- doc/models/invoice-credit.md | 62 +- doc/models/invoice-custom-field.md | 56 +- doc/models/invoice-customer.md | 66 +- doc/models/invoice-date-field.md | 46 +- doc/models/invoice-discount-breakout.md | 50 +- doc/models/invoice-discount.md | 72 +- doc/models/invoice-display-settings.md | 46 +- ...voice-event-1.md => invoice-event-data.md} | 112 +- doc/models/invoice-event-payment-1.md | 43 + doc/models/invoice-event-payment-method.md | 17 + ...ested-data.md => invoice-event-payment.md} | 74 +- doc/models/invoice-event-type.md | 56 +- doc/models/invoice-event.md | 82 +- .../invoice-line-item-component-cost-data.md | 86 +- doc/models/invoice-line-item.md | 90 +- doc/models/invoice-payer-change.md | 27 + doc/models/invoice-payer.md | 60 +- doc/models/invoice-payment-application.md | 50 +- doc/models/invoice-payment-method-type.md | 40 +- doc/models/invoice-payment-method.md | 64 +- doc/models/invoice-payment-type.md | 36 +- doc/models/invoice-payment.md | 80 +- doc/models/invoice-pre-payment.md | 50 +- doc/models/invoice-previous-balance.md | 58 +- doc/models/invoice-refund.md | 60 +- doc/models/invoice-response.md | 61 +- doc/models/invoice-role.md | 22 + doc/models/invoice-seller.md | 70 +- doc/models/invoice-sort-field.md | 52 +- doc/models/invoice-status.md | 40 +- doc/models/invoice-tax-breakout.md | 50 +- doc/models/invoice-tax-component-breakout.md | 54 +- doc/models/invoice-tax.md | 70 +- doc/models/invoice.md | 159 +- doc/models/issue-advance-invoice-request.md | 42 +- doc/models/issue-invoice-request.md | 42 +- doc/models/issue-service-credit-request.md | 54 +- doc/models/issue-service-credit.md | 52 +- doc/models/item-category.md | 50 +- doc/models/line-item-kind.md | 48 +- doc/models/line-item-transaction-type.md | 42 +- .../list-components-price-points-include.md | 38 +- .../list-components-price-points-response.md | 59 +- doc/models/list-credit-notes-response.md | 58 +- doc/models/list-events-date-field.md | 38 +- doc/models/list-invoice-events-response.md | 94 +- doc/models/list-invoices-response.md | 65 +- doc/models/list-metafields-response.md | 86 +- doc/models/list-mrr-response-result.md | 62 +- doc/models/list-mrr-response.md | 54 +- doc/models/list-offers-response.md | 86 +- .../list-product-price-points-response.md | 58 +- doc/models/list-products-include.md | 38 +- .../list-products-price-points-include.md | 38 +- doc/models/list-public-keys-meta.md | 54 +- doc/models/list-public-keys-response.md | 78 +- doc/models/list-sale-rep-item.md | 90 +- doc/models/list-segments-response.md | 58 +- .../list-subcription-group-prepayment-item.md | 66 +- .../list-subscription-components-include.md | 38 +- .../list-subscription-components-response.md | 58 +- .../list-subscription-components-sort.md | 40 +- ...ubscription-group-prepayment-date-field.md | 40 +- ...-subscription-group-prepayment-response.md | 62 +- .../list-subscription-group-prepayment.md | 54 +- doc/models/list-subscription-groups-item.md | 72 +- doc/models/list-subscription-groups-meta.md | 46 +- .../list-subscription-groups-response.md | 108 +- doc/models/metadata.md | 60 +- doc/models/metafield-input.md | 18 + doc/models/metafield-scope.md | 66 +- doc/models/metafield.md | 72 +- doc/models/metered-component.md | 122 +- doc/models/movement-line-item.md | 66 +- doc/models/movement.md | 66 +- doc/models/mrr-movement.md | 54 +- doc/models/mrr-response.md | 64 +- doc/models/mrr.md | 70 +- doc/models/multi-invoice-payment-response.md | 84 +- doc/models/multi-invoice-payment.md | 66 +- doc/models/nested-subscription-group.md | 54 +- doc/models/net-terms.md | 58 +- doc/models/offer-discount.md | 50 +- doc/models/offer-item.md | 68 +- doc/models/offer-response.md | 54 +- doc/models/offer-signup-page.md | 60 +- doc/models/offer.md | 86 +- doc/models/on-off-component.md | 170 +- doc/models/organization-address.md | 64 +- doc/models/origin-invoice.md | 46 +- doc/models/overage-pricing.md | 132 +- doc/models/override-subscription-request.md | 54 +- doc/models/override-subscription.md | 58 +- doc/models/paginated-metadata.md | 88 +- doc/models/pause-request.md | 50 +- doc/models/payer-attributes.md | 92 +- doc/models/payer-error.md | 68 +- doc/models/payment-collection-method-1.md | 18 - doc/models/payment-for-allocation.md | 58 +- doc/models/payment-method-apple-pay.md | 21 + doc/models/payment-method-bank-account.md | 25 + doc/models/payment-method-credit-card.md | 29 + doc/models/payment-method-external.md | 27 + doc/models/payment-method-paypal.md | 23 + doc/models/payment-profile-attributes.md | 102 +- doc/models/payment-profile-response.md | 48 +- doc/models/payment-response.md | 68 +- doc/models/payment-type.md | 30 +- doc/models/payment.md | 54 +- doc/models/portal-management-link.md | 60 +- doc/models/prepaid-component-price-point.md | 152 +- doc/models/prepaid-configuration-response.md | 54 +- doc/models/prepaid-configuration.md | 58 +- doc/models/prepaid-usage-component.md | 94 +- doc/models/prepayment-aggregated-error.md | 72 +- doc/models/prepayment-method.md | 42 +- doc/models/prepayment-response.md | 64 +- doc/models/prepayment.md | 78 +- doc/models/prepayments-response.md | 92 +- doc/models/preview-allocations-request.md | 72 +- doc/models/price-point-type.md | 34 +- doc/models/price-point.md | 104 +- doc/models/price.md | 68 +- doc/models/pricing-scheme.md | 36 +- doc/models/product-family-response.md | 54 +- doc/models/product-family.md | 62 +- ...ct-price-point-error-response-exception.md | 82 +- doc/models/product-price-point-errors.md | 88 +- doc/models/product-price-point-response.md | 54 +- doc/models/product-price-point.md | 96 +- doc/models/product-response.md | 54 +- doc/models/product.md | 122 +- ...ma-bad-request-error-response-exception.md | 56 +- doc/models/proforma-custom-field.md | 29 - doc/models/proforma-error.md | 52 +- doc/models/proforma-invoice-credit.md | 54 +- .../proforma-invoice-discount-breakout.md | 46 +- doc/models/proforma-invoice-discount.md | 60 +- doc/models/proforma-invoice-payment.md | 54 +- doc/models/proforma-invoice-preview.md | 120 +- doc/models/proforma-invoice-tax-breakout.md | 46 +- doc/models/proforma-invoice-tax.md | 62 +- doc/models/proforma-invoice.md | 120 +- doc/models/proration.md | 42 +- doc/models/public-key.md | 50 +- doc/models/public-signup-page.md | 54 +- doc/models/quantity-based-component.md | 124 +- .../reactivate-subscription-group-request.md | 46 +- .../reactivate-subscription-group-response.md | 72 +- doc/models/reactivate-subscription-request.md | 64 +- doc/models/reactivation-billing.md | 46 +- doc/models/reactivation-charge.md | 34 +- doc/models/reason-code-response.md | 54 +- doc/models/reason-code.md | 62 +- doc/models/reason-codes-json-response.md | 42 +- doc/models/record-payment-request.md | 52 +- doc/models/recurring-scheme.md | 30 +- doc/models/referral-code.md | 54 +- doc/models/referral-validation-response.md | 52 +- doc/models/refund-invoice-request.md | 54 +- .../refund-prepayment-aggregated-error.md | 64 +- ...nt-aggregated-errors-response-exception.md | 72 +- ...epayment-base-errors-response-exception.md | 64 +- .../refund-prepayment-base-refund-error.md | 56 +- doc/models/refund-prepayment-request.md | 58 +- doc/models/refund-prepayment.md | 60 +- doc/models/refund.md | 62 +- doc/models/renewal-preview-component.md | 62 +- doc/models/renewal-preview-line-item.md | 76 +- doc/models/renewal-preview-request.md | 110 +- doc/models/renewal-preview-response.md | 54 +- doc/models/renewal-preview.md | 66 +- doc/models/replay-webhooks-request.md | 46 +- doc/models/replay-webhooks-response.md | 42 +- doc/models/resent-invitation.md | 54 +- doc/models/resource-type.md | 28 +- doc/models/restriction-type.md | 28 +- doc/models/resumption-charge.md | 34 +- doc/models/revoked-invitation.md | 50 +- doc/models/sale-rep-item-mrr.md | 50 +- doc/models/sale-rep-settings.md | 62 +- doc/models/sale-rep-subscription.md | 68 +- doc/models/sale-rep.md | 88 +- doc/models/segment-price.md | 64 +- doc/models/segment-response.md | 54 +- doc/models/segment.md | 72 +- doc/models/seller.md | 66 +- doc/models/send-invoice-request.md | 66 +- doc/models/service-credit-response.md | 54 +- doc/models/service-credit-type.md | 32 +- doc/models/service-credit.md | 58 +- doc/models/shipping-address.md | 60 +- .../signup-proforma-preview-response.md | 72 +- doc/models/signup-proforma-preview.md | 70 +- doc/models/single-error-response-exception.md | 42 +- .../single-string-error-response-exception.md | 42 +- doc/models/site-response.md | 54 +- doc/models/site-statistics.md | 70 +- doc/models/site-summary.md | 70 +- doc/models/site.md | 80 +- doc/models/sorting-direction.md | 32 +- ...subscription-add-coupon-error-exception.md | 76 +- ...on-component-allocation-error-exception.md | 52 +- ...ription-component-allocation-error-item.md | 46 +- doc/models/subscription-component-response.md | 54 +- .../subscription-component-subscription.md | 50 +- doc/models/subscription-component.md | 110 +- doc/models/subscription-custom-price.md | 108 +- doc/models/subscription-date-field.md | 42 +- doc/models/subscription-group-balances.md | 70 +- doc/models/subscription-group-bank-account.md | 82 +- ...bscription-group-component-custom-price.md | 128 +- doc/models/subscription-group-credit-card.md | 106 +- doc/models/subscription-group-customer.md | 58 +- doc/models/subscription-group-item.md | 68 +- doc/models/subscription-group-member-error.md | 50 +- .../subscription-group-payment-profile.md | 54 +- .../subscription-group-prepayment-method.md | 36 +- .../subscription-group-prepayment-request.md | 52 +- .../subscription-group-prepayment-response.md | 58 +- doc/models/subscription-group-prepayment.md | 54 +- doc/models/subscription-group-response.md | 70 +- .../subscription-group-signup-component.md | 276 +- ...n-group-signup-error-response-exception.md | 116 +- doc/models/subscription-group-signup-error.md | 148 +- doc/models/subscription-group-signup-item.md | 82 +- .../subscription-group-signup-request.md | 92 +- .../subscription-group-signup-response.md | 80 +- doc/models/subscription-group-signup.md | 102 +- .../subscription-group-subscription-error.md | 82 +- ...n-group-update-error-response-exception.md | 68 +- doc/models/subscription-group-update-error.md | 74 +- doc/models/subscription-group.md | 76 +- doc/models/subscription-include.md | 28 +- doc/models/subscription-included-coupon.md | 66 +- doc/models/subscription-list-date-field.md | 38 +- doc/models/subscription-list-include.md | 26 +- .../subscription-migration-preview-options.md | 70 +- .../subscription-migration-preview-request.md | 56 +- ...subscription-migration-preview-response.md | 52 +- doc/models/subscription-migration-preview.md | 54 +- doc/models/subscription-mrr-breakout.md | 46 +- doc/models/subscription-mrr-response.md | 60 +- doc/models/subscription-mrr.md | 56 +- doc/models/subscription-note-response.md | 54 +- doc/models/subscription-note.md | 60 +- doc/models/subscription-preview-response.md | 132 +- doc/models/subscription-preview.md | 130 +- .../subscription-product-migration-request.md | 56 +- doc/models/subscription-product-migration.md | 68 +- doc/models/subscription-purge-type.md | 28 +- ...cription-remove-coupon-errors-exception.md | 46 +- doc/models/subscription-response.md | 54 +- doc/models/subscription-sort.md | 36 +- doc/models/subscription-state-filter.md | 52 +- doc/models/subscription-state.md | 58 +- doc/models/subscription.md | 221 +- ...scriptions-mrr-error-response-exception.md | 50 +- doc/models/tax-configuration-kind.md | 32 +- doc/models/tax-configuration.md | 50 +- doc/models/tax-destination-address.md | 32 +- ...anagement-link-requests-error-exception.md | 48 +- .../too-many-management-link-requests.md | 46 +- .../update-allocation-expiration-date.md | 46 +- .../update-component-price-point-request.md | 54 +- doc/models/update-component-price-point.md | 64 +- doc/models/update-component-request.md | 56 +- doc/models/update-component.md | 68 +- doc/models/update-coupon-currency.md | 46 +- doc/models/update-currency-price.md | 46 +- doc/models/update-currency-prices-request.md | 52 +- doc/models/update-customer-request.md | 54 +- doc/models/update-customer.md | 84 +- doc/models/update-endpoint-request.md | 56 +- doc/models/update-endpoint.md | 54 +- doc/models/update-metadata-request.md | 50 +- doc/models/update-metadata.md | 50 +- doc/models/update-metafields-request.md | 48 +- doc/models/update-payment-profile-request.md | 54 +- doc/models/update-payment-profile.md | 74 +- doc/models/update-price.md | 76 +- .../update-product-price-point-request.md | 48 +- doc/models/update-product-price-point.md | 46 +- doc/models/update-reason-code-request.md | 50 +- doc/models/update-reason-code.md | 50 +- doc/models/update-segment-request.md | 98 +- doc/models/update-segment.md | 64 +- doc/models/update-subscription-component.md | 114 +- .../update-subscription-group-request.md | 52 +- doc/models/update-subscription-group.md | 50 +- .../update-subscription-note-request.md | 52 +- doc/models/update-subscription-note.md | 50 +- doc/models/update-subscription-request.md | 65 +- doc/models/update-subscription.md | 93 +- .../upsert-prepaid-configuration-request.md | 52 +- doc/models/upsert-prepaid-configuration.md | 54 +- doc/models/usage-response.md | 60 +- doc/models/usage.md | 72 +- doc/models/void-invoice-request.md | 46 +- doc/models/void-invoice.md | 42 +- doc/models/webhook-order.md | 28 +- doc/models/webhook-response.md | 54 +- doc/models/webhook-status.md | 32 +- doc/models/webhook-subscription.md | 94 +- doc/models/webhook.md | 72 +- doc/retry-configuration.md | 42 +- errors/errors.go | 852 +-- events_based_billing_segments_controller.go | 564 +- events_controller.go | 452 +- go.mod | 2 +- go.sum | 4 +- insights_controller.go | 346 +- invoices_controller.go | 1852 +++--- maxio-advanced-billing-go_generic_lib.zip | Bin 0 -> 922463 bytes models/account_balance.go | 46 +- models/account_balances.go | 88 +- models/ach_agreement.go | 90 +- models/activate_subscription_request.go | 46 +- models/add_coupons_request.go | 44 +- models/add_subscription_to_a_group.go | 44 +- models/address_change.go | 44 + models/agreement_acceptance.go | 110 +- models/allocate_components.go | 142 +- models/allocation.go | 364 +- models/allocation_expiration_date.go | 44 +- models/allocation_preview.go | 190 +- models/allocation_preview_item.go | 260 +- models/allocation_preview_line_item.go | 146 +- models/allocation_preview_response.go | 40 +- models/allocation_response.go | 44 +- models/allocation_settings.go | 78 +- models/applied_credit_note_data.go | 60 +- models/attribute_error.go | 40 +- models/auto_resume.go | 72 +- models/bank_account_attributes.go | 194 +- models/bank_account_payment_profile.go | 326 +- models/bank_account_response.go | 40 +- models/bank_account_verification.go | 56 +- models/bank_account_verification_request.go | 40 +- models/base_refund_error.go | 44 +- models/base_string_error.go | 46 +- models/batch_job.go | 92 +- models/batch_job_response.go | 40 +- models/billing_address.go | 104 +- models/billing_manifest.go | 140 +- models/billing_manifest_item.go | 204 +- models/billing_schedule.go | 64 +- models/breakouts.go | 80 +- ...bulk_component_s_price_point_assignment.go | 44 +- ...ulk_create_product_price_points_request.go | 40 +- ...lk_create_product_price_points_response.go | 44 +- models/bulk_create_segments.go | 44 +- models/bulk_update_segments.go | 44 +- models/bulk_update_segments_item.go | 60 +- models/calendar_billing.go | 60 +- .../cancel_grouped_subscriptions_request.go | 44 +- models/cancellation_options.go | 60 +- models/cancellation_request.go | 40 +- models/chargify_ebb.go | 120 +- models/component.go | 528 +- models/component_allocation_error_item.go | 80 +- models/component_cost_data.go | 118 +- models/component_cost_data_rate_tier.go | 92 +- models/component_currency_price.go | 104 +- models/component_currency_prices_response.go | 40 +- models/component_custom_price.go | 90 +- models/component_price.go | 128 +- models/component_price_point.go | 310 +- models/component_price_point_error_item.go | 68 +- models/component_price_point_item.go | 110 +- models/component_price_point_response.go | 40 +- models/component_price_points_response.go | 56 +- models/component_response.go | 40 +- models/component_s_price_point_assignment.go | 56 +- models/consolidated_invoice.go | 44 +- models/count_response.go | 44 +- models/coupon.go | 380 +- models/coupon_currency.go | 80 +- models/coupon_currency_request.go | 40 +- models/coupon_currency_response.go | 44 +- models/coupon_response.go | 44 +- models/coupon_restriction.go | 92 +- models/coupon_subcodes.go | 44 +- models/coupon_subcodes_response.go | 68 +- models/coupon_usage.go | 130 +- models/create_allocation.go | 188 +- models/create_allocation_request.go | 40 +- .../create_component_price_point_request.go | 40 +- .../create_component_price_points_request.go | 40 +- models/create_currency_price.go | 74 +- models/create_currency_prices_request.go | 40 +- models/create_customer.go | 240 +- models/create_customer_request.go | 40 +- models/create_ebb_component.go | 40 +- models/create_invoice.go | 178 +- models/create_invoice_address.go | 142 +- models/create_invoice_coupon.go | 104 +- models/create_invoice_item.go | 194 +- models/create_invoice_payment.go | 88 +- models/create_invoice_payment_application.go | 52 +- models/create_invoice_payment_request.go | 54 +- models/create_invoice_request.go | 40 +- models/create_metadata.go | 56 +- models/create_metadata_request.go | 40 +- models/create_metafields_request.go | 40 +- models/create_metered_component.go | 40 +- models/create_multi_invoice_payment.go | 106 +- .../create_multi_invoice_payment_request.go | 40 +- models/create_offer.go | 104 +- models/create_offer_component.go | 56 +- models/create_offer_request.go | 40 +- models/create_on_off_component.go | 40 +- models/create_or_update_coupon.go | 72 +- models/create_or_update_product.go | 150 +- models/create_or_update_product_request.go | 40 +- models/create_or_update_segment_price.go | 66 +- models/create_payment.go | 64 +- models/create_payment_profile.go | 474 +- models/create_payment_profile_request.go | 40 +- models/create_prepaid_component.go | 40 +- models/create_prepayment.go | 78 +- models/create_prepayment_request.go | 40 +- models/create_prepayment_response.go | 40 +- models/create_product_currency_price.go | 62 +- .../create_product_currency_prices_request.go | 40 +- models/create_product_family.go | 56 +- models/create_product_family_request.go | 40 +- models/create_product_price_point.go | 208 +- models/create_product_price_point_request.go | 40 +- models/create_quantity_based_component.go | 40 +- models/create_reason_code.go | 66 +- models/create_reason_code_request.go | 40 +- models/create_segment.go | 110 +- models/create_segment_request.go | 40 +- models/create_subscription.go | 762 +-- models/create_subscription_component.go | 126 +- models/create_subscription_group.go | 52 +- models/create_subscription_group_request.go | 40 +- models/create_subscription_request.go | 40 +- models/create_usage.go | 84 +- models/create_usage_request.go | 40 +- models/created_prepayment.go | 116 +- models/credit_card_attributes.go | 68 +- models/credit_card_payment_profile.go | 330 +- models/credit_note.go | 426 +- models/credit_note_1.go | 418 +- models/credit_note_application.go | 92 +- models/credit_note_line_item.go | 270 +- models/credit_scheme_request.go | 40 +- models/currency_price.go | 106 +- models/currency_prices_response.go | 40 +- models/customer.go | 408 +- models/customer_1.go | 116 +- models/customer_attributes.go | 282 +- models/customer_billing_address_change.go | 48 - models/customer_change.go | 80 +- models/customer_changes_preview_response.go | 40 +- models/customer_custom_fields_change.go | 52 +- models/customer_payer_change.go | 52 +- models/customer_response.go | 40 +- models/customer_shipping_address_change.go | 48 - models/deduct_service_credit.go | 48 +- models/deduct_service_credit_request.go | 40 +- models/delayed_cancellation_response.go | 44 +- models/delete_subscription_group_response.go | 56 +- models/ebb_component.go | 256 +- models/ebb_event.go | 44 +- models/enable_webhooks_request.go | 40 +- models/enable_webhooks_response.go | 44 +- models/endpoint.go | 92 +- models/endpoint_response.go | 44 +- models/enums.go | 1265 ++-- models/event.go | 88 +- models/event_based_billing_segment_error.go | 42 +- models/event_response.go | 40 +- models/full_subscription_group_response.go | 176 +- models/get_one_time_token_payment_profile.go | 224 +- models/get_one_time_token_request.go | 40 +- models/group_billing.go | 76 +- models/group_settings.go | 56 +- models/group_target.go | 58 +- models/invoice.go | 832 +-- models/invoice_address.go | 104 +- models/invoice_balance_item.go | 68 +- models/invoice_credit.go | 132 +- models/invoice_custom_field.go | 86 +- models/invoice_customer.go | 118 +- models/invoice_discount.go | 176 +- models/invoice_discount_breakout.go | 68 +- models/invoice_display_settings.go | 56 +- models/invoice_event.go | 96 +- models/invoice_event_1.go | 245 - models/invoice_event_data.go | 270 + models/invoice_event_payment.go | 110 + models/invoice_event_payment_1.go | 89 + models/invoice_line_item.go | 372 +- .../invoice_line_item_component_cost_data.go | 44 +- models/invoice_payer.go | 104 +- models/invoice_payer_change.go | 60 + models/invoice_payment.go | 170 +- models/invoice_payment_application.go | 74 +- models/invoice_payment_method.go | 128 +- models/invoice_pre_payment.go | 74 +- models/invoice_previous_balance.go | 72 +- models/invoice_refund.go | 106 +- models/invoice_response.go | 40 +- models/invoice_seller.go | 82 +- models/invoice_tax.go | 164 +- models/invoice_tax_breakout.go | 68 +- models/invoice_tax_component_breakout.go | 80 +- models/issue_advance_invoice_request.go | 44 +- models/issue_invoice_request.go | 52 +- models/issue_service_credit.go | 48 +- models/issue_service_credit_request.go | 40 +- .../list_components_price_points_response.go | 40 +- models/list_credit_notes_response.go | 40 +- models/list_invoice_events_response.go | 80 +- models/list_invoices_response.go | 40 +- models/list_metafields_response.go | 92 +- models/list_mrr_response.go | 40 +- models/list_mrr_response_result.go | 116 +- models/list_offers_response.go | 44 +- models/list_product_price_points_response.go | 40 +- models/list_public_keys_meta.go | 80 +- models/list_public_keys_response.go | 56 +- models/list_sale_rep_item.go | 92 +- models/list_segments_response.go | 44 +- .../list_subcription_group_prepayment_item.go | 142 +- .../list_subscription_components_response.go | 40 +- models/list_subscription_group_prepayment.go | 40 +- ..._subscription_group_prepayment_response.go | 40 +- models/list_subscription_groups_item.go | 152 +- models/list_subscription_groups_meta.go | 56 +- models/list_subscription_groups_response.go | 56 +- models/m_errors.go | 56 +- models/metadata.go | 104 +- models/metafield.go | 109 +- models/metafield_scope.go | 130 +- models/metered_component.go | 282 +- models/movement.go | 140 +- models/movement_line_item.go | 144 +- models/mrr.go | 106 +- models/mrr_movement.go | 80 +- models/mrr_response.go | 40 +- models/multi_invoice_payment.go | 86 +- models/multi_invoice_payment_response.go | 40 +- models/nested_subscription_group.go | 88 +- models/net_terms.go | 92 +- models/offer.go | 260 +- models/offer_discount.go | 68 +- models/offer_item.go | 156 +- models/offer_response.go | 44 +- models/offer_signup_page.go | 104 +- models/on_off_component.go | 262 +- models/organization_address.go | 128 +- models/origin_invoice.go | 60 +- models/overage_pricing.go | 54 +- models/override_subscription.go | 154 +- models/override_subscription_request.go | 40 +- models/paginated_metadata.go | 92 +- models/pause_request.go | 46 +- models/payer_attributes.go | 250 +- models/payer_error.go | 68 +- models/payment.go | 88 +- models/payment_for_allocation.go | 82 +- models/payment_method_apple_pay.go | 40 + models/payment_method_bank_account.go | 48 + models/payment_method_credit_card.go | 60 + models/payment_method_external.go | 52 + models/payment_method_nested_data.go | 103 - models/payment_method_paypal.go | 44 + models/payment_profile_attributes.go | 374 +- models/payment_profile_response.go | 40 +- models/payment_response.go | 56 +- models/portal_management_link.go | 104 +- models/prepaid_component_price_point.go | 94 +- models/prepaid_configuration.go | 92 +- models/prepaid_configuration_response.go | 40 +- models/prepaid_usage_component.go | 328 +- models/prepayment.go | 126 +- models/prepayment_aggregated_error.go | 68 +- models/prepayment_response.go | 40 +- models/prepayments_response.go | 44 +- models/preview_allocations_request.go | 102 +- models/price.go | 62 +- models/price_point.go | 204 +- models/product.go | 580 +- models/product_family.go | 116 +- models/product_family_response.go | 44 +- models/product_price_point.go | 414 +- models/product_price_point_errors.go | 104 +- models/product_price_point_response.go | 40 +- models/product_response.go | 40 +- models/proforma_custom_field.go | 66 - models/proforma_error.go | 46 +- models/proforma_invoice.go | 468 +- models/proforma_invoice_credit.go | 80 +- models/proforma_invoice_discount.go | 104 +- models/proforma_invoice_discount_breakout.go | 56 +- models/proforma_invoice_payment.go | 80 +- models/proforma_invoice_preview.go | 468 +- models/proforma_invoice_tax.go | 116 +- models/proforma_invoice_tax_breakout.go | 56 +- models/proration.go | 46 +- models/public_key.go | 68 +- models/public_signup_page.go | 88 +- models/quantity_based_component.go | 294 +- .../reactivate_subscription_group_request.go | 56 +- .../reactivate_subscription_group_response.go | 140 +- models/reactivate_subscription_request.go | 116 +- models/reactivation_billing.go | 48 +- models/reason_code.go | 116 +- models/reason_code_response.go | 40 +- models/reason_codes_json_response.go | 44 +- models/record_payment_request.go | 40 +- models/referral_code.go | 80 +- models/referral_validation_response.go | 44 +- models/refund.go | 130 +- models/refund_invoice_request.go | 40 +- models/refund_prepayment.go | 74 +- models/refund_prepayment_aggregated_error.go | 44 +- models/refund_prepayment_base_refund_error.go | 44 +- models/refund_prepayment_request.go | 40 +- models/renewal_preview.go | 158 +- models/renewal_preview_component.go | 84 +- models/renewal_preview_line_item.go | 204 +- models/renewal_preview_request.go | 46 +- models/renewal_preview_response.go | 40 +- models/replay_webhooks_request.go | 40 +- models/replay_webhooks_response.go | 44 +- models/resent_invitation.go | 80 +- models/revoked_invitation.go | 68 +- models/sale_rep.go | 92 +- models/sale_rep_item_mrr.go | 68 +- models/sale_rep_settings.go | 116 +- models/sale_rep_subscription.go | 152 +- models/segment.go | 178 +- models/segment_price.go | 128 +- models/segment_response.go | 44 +- models/seller.go | 80 +- models/send_invoice_request.go | 68 +- models/service_credit.go | 100 +- models/service_credit_response.go | 40 +- models/shipping_address.go | 104 +- models/signup_proforma_preview.go | 56 +- models/signup_proforma_preview_response.go | 40 +- models/site.go | 224 +- models/site_response.go | 40 +- models/site_statistics.go | 164 +- models/site_summary.go | 92 +- models/subscription.go | 1190 ++-- models/subscription_component.go | 452 +- ...ription_component_allocation_error_item.go | 56 +- models/subscription_component_response.go | 44 +- models/subscription_component_subscription.go | 98 +- models/subscription_custom_price.go | 204 +- models/subscription_group.go | 92 +- models/subscription_group_balances.go | 80 +- models/subscription_group_bank_account.go | 240 +- ...bscription_group_component_custom_price.go | 72 +- models/subscription_group_credit_card.go | 276 +- models/subscription_group_customer.go | 92 +- models/subscription_group_item.go | 152 +- models/subscription_group_member_error.go | 68 +- models/subscription_group_payment_profile.go | 80 +- models/subscription_group_prepayment.go | 64 +- .../subscription_group_prepayment_request.go | 40 +- .../subscription_group_prepayment_response.go | 100 +- models/subscription_group_response.go | 40 +- models/subscription_group_signup.go | 126 +- models/subscription_group_signup_component.go | 96 +- models/subscription_group_signup_error.go | 106 +- models/subscription_group_signup_item.go | 212 +- models/subscription_group_signup_request.go | 40 +- models/subscription_group_signup_response.go | 166 +- .../subscription_group_subscription_error.go | 82 +- models/subscription_group_update_error.go | 44 +- models/subscription_included_coupon.go | 116 +- models/subscription_migration_preview.go | 88 +- .../subscription_migration_preview_options.go | 170 +- .../subscription_migration_preview_request.go | 40 +- ...subscription_migration_preview_response.go | 40 +- models/subscription_mrr.go | 60 +- models/subscription_mrr_breakout.go | 48 +- models/subscription_mrr_response.go | 40 +- models/subscription_note.go | 104 +- models/subscription_note_response.go | 40 +- models/subscription_preview.go | 56 +- models/subscription_preview_response.go | 40 +- models/subscription_product_migration.go | 156 +- .../subscription_product_migration_request.go | 40 +- models/subscription_response.go | 44 +- models/tax_configuration.go | 70 +- models/too_many_management_link_requests.go | 60 +- models/update_allocation_expiration_date.go | 44 +- models/update_component.go | 154 +- models/update_component_price_point.go | 138 +- .../update_component_price_point_request.go | 44 +- models/update_component_request.go | 40 +- models/update_coupon_currency.go | 52 +- models/update_currency_price.go | 52 +- models/update_currency_prices_request.go | 40 +- models/update_customer.go | 250 +- models/update_customer_request.go | 40 +- models/update_endpoint.go | 50 +- models/update_endpoint_request.go | 44 +- models/update_metadata.go | 68 +- models/update_metadata_request.go | 44 +- models/update_metafields_request.go | 44 +- models/update_payment_profile.go | 214 +- models/update_payment_profile_request.go | 40 +- models/update_price.go | 94 +- models/update_product_price_point.go | 56 +- models/update_product_price_point_request.go | 40 +- models/update_reason_code.go | 74 +- models/update_reason_code_request.go | 40 +- models/update_segment.go | 54 +- models/update_segment_request.go | 40 +- models/update_subscription.go | 252 +- models/update_subscription_component.go | 58 +- models/update_subscription_group.go | 44 +- models/update_subscription_group_request.go | 40 +- models/update_subscription_note.go | 50 +- models/update_subscription_note_request.go | 44 +- models/update_subscription_request.go | 40 +- models/upsert_prepaid_configuration.go | 80 +- .../upsert_prepaid_configuration_request.go | 40 +- models/usage.go | 156 +- models/usage_response.go | 40 +- models/utilities.go | 70 +- models/void_invoice.go | 40 +- models/void_invoice_request.go | 40 +- models/webhook.go | 200 +- models/webhook_response.go | 49 +- offers_controller.go | 314 +- payment_profiles_controller.go | 1312 ++--- product_families_controller.go | 380 +- product_price_points_controller.go | 914 +-- products_controller.go | 492 +- proforma_invoices_controller.go | 780 +-- reason_codes_controller.go | 368 +- referral_codes_controller.go | 82 +- sales_commissions_controller.go | 318 +- sites_controller.go | 188 +- subscription_components_controller.go | 1724 +++--- ...iption_group_invoice_account_controller.go | 358 +- subscription_group_status_controller.go | 286 +- subscription_groups_controller.go | 650 +-- subscription_invoice_account_controller.go | 488 +- subscription_notes_controller.go | 354 +- subscription_products_controller.go | 248 +- subscription_status_controller.go | 990 ++-- subscriptions_controller.go | 2022 +++---- test/go.mod | 2 +- test/go.sum | 4 +- test/metafields_test.go | 23 +- test/site_test.go | 2 +- test/subscription_test.go | 4 +- test/suite.go | 4 +- webhooks_controller.go | 462 +- 1015 files changed, 66704 insertions(+), 66082 deletions(-) create mode 100644 doc/models/address-change.md rename doc/models/{payment-collection-method.md => collection-method.md} (86%) create mode 100644 doc/models/credit-note-status.md create mode 100644 doc/models/custom-field-owner.md delete mode 100644 doc/models/customer-billing-address-change.md delete mode 100644 doc/models/customer-shipping-address-change.md rename doc/models/{invoice-event-1.md => invoice-event-data.md} (88%) create mode 100644 doc/models/invoice-event-payment-1.md create mode 100644 doc/models/invoice-event-payment-method.md rename doc/models/{payment-method-nested-data.md => invoice-event-payment.md} (74%) create mode 100644 doc/models/invoice-payer-change.md create mode 100644 doc/models/invoice-role.md create mode 100644 doc/models/metafield-input.md delete mode 100644 doc/models/payment-collection-method-1.md create mode 100644 doc/models/payment-method-apple-pay.md create mode 100644 doc/models/payment-method-bank-account.md create mode 100644 doc/models/payment-method-credit-card.md create mode 100644 doc/models/payment-method-external.md create mode 100644 doc/models/payment-method-paypal.md delete mode 100644 doc/models/proforma-custom-field.md create mode 100644 maxio-advanced-billing-go_generic_lib.zip create mode 100644 models/address_change.go delete mode 100644 models/customer_billing_address_change.go delete mode 100644 models/customer_shipping_address_change.go delete mode 100644 models/invoice_event_1.go create mode 100644 models/invoice_event_data.go create mode 100644 models/invoice_event_payment.go create mode 100644 models/invoice_event_payment_1.go create mode 100644 models/invoice_payer_change.go create mode 100644 models/payment_method_apple_pay.go create mode 100644 models/payment_method_bank_account.go create mode 100644 models/payment_method_credit_card.go create mode 100644 models/payment_method_external.go delete mode 100644 models/payment_method_nested_data.go create mode 100644 models/payment_method_paypal.go delete mode 100644 models/proforma_custom_field.go diff --git a/README.md b/README.md index 305d5ebe..bd656098 100644 --- a/README.md +++ b/README.md @@ -1,262 +1,262 @@ - -# Getting Started with Maxio Advanced Billing - -## Introduction - -### Introduction - -#### API Integration - -Maxio Advanced Billing (formerly Chargify API) can be integrated with many environments and programming languages via our REST API. Some of our users have contributed their API wrappers in various programming languages. Check out the [API Code Overview](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI2-api-code-samples) doc for an introduction to the wrappers and available code samples. - -#### Testing Guide - -Maxio Advanced Billing has compiled a [testing guide](https://chargify.zendesk.com/hc/en-us/articles/4407904658587) that covers a list of important factors to consider while in the testing phase. Here's a high-level overiew of what's covered in our testing guide: - + +# Getting Started with Maxio Advanced Billing + +## Introduction + +### Introduction + +#### API Integration + +Maxio Advanced Billing (formerly Chargify API) can be integrated with many environments and programming languages via our REST API. Some of our users have contributed their API wrappers in various programming languages. Check out the [API Code Overview](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI2-api-code-samples) doc for an introduction to the wrappers and available code samples. + +#### Testing Guide + +Maxio Advanced Billing has compiled a [testing guide](https://chargify.zendesk.com/hc/en-us/articles/4407904658587) that covers a list of important factors to consider while in the testing phase. Here's a high-level overiew of what's covered in our testing guide: + + Test credit card basics + Test site limits -+ Live mode versus test mode - -We strongly suggest reading over the testing guide, as well as the entire set of application-based documentation to aid in your discovery of the product. - -#### Engage Support - -We always enjoy (and appreciate) hearing about larger integrations ahead of time. If you’re planning on importing a large amount of data into Maxio via our API, we suggest sending a “heads up” to “support@chargify.com” so we can coordinate with you to ensure your import process goes smoothly. - -Our API, while considered stable, is continually being improved and polished. Please feel free to contact support if you experience issues when integrating with the Maxio Advanced Billing API. - -If you have any additional questions regarding our documentation please don't hesitate in reaching out. - -#### Support Access - -Access to our Technical Specialist team for API support is currently limited to purchasers of our larger Maxio support plans. - -But don’t worry! There are quite a few options to help you get the answers you need: - ++ Live mode versus test mode + +We strongly suggest reading over the testing guide, as well as the entire set of application-based documentation to aid in your discovery of the product. + +#### Engage Support + +We always enjoy (and appreciate) hearing about larger integrations ahead of time. If you’re planning on importing a large amount of data into Maxio via our API, we suggest sending a “heads up” to “support@chargify.com” so we can coordinate with you to ensure your import process goes smoothly. + +Our API, while considered stable, is continually being improved and polished. Please feel free to contact support if you experience issues when integrating with the Maxio Advanced Billing API. + +If you have any additional questions regarding our documentation please don't hesitate in reaching out. + +#### Support Access + +Access to our Technical Specialist team for API support is currently limited to purchasers of our larger Maxio support plans. + +But don’t worry! There are quite a few options to help you get the answers you need: + - [Read our documentation for developers](https://developers.chargify.com/docs/developer-docs/ZG9jOjM0NjA3MQ-overview) - Explore the endpoints of our API Documentation - [Watch our videos and tutorials](https://chargify.com/tutorials) -- [Check out the Chargify tag on Stack Overflow](http://stackoverflow.com/questions/tagged/chargify) - -### API Overview - -The Chargify API allows you to interact with our system programmatically from your own application. Using the API you interact with Resources such as: - +- [Check out the Chargify tag on Stack Overflow](http://stackoverflow.com/questions/tagged/chargify) + +### API Overview + +The Chargify API allows you to interact with our system programmatically from your own application. Using the API you interact with Resources such as: + - Products - Subscriptions - Customers -- etc. - +- etc. + The API attempts to conform to the [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) design principles. You interact with the resources exposed via the API by accessing resource collection and element URIs using the HTTP verbs (GET, POST, PUT, and DELETE). -Chargify accepts and returns both JSON and XML data via the API. - -You’ll likely need access to a web developer or programmer (if you’re not one) to get the most use out of the API. - -#### Available Formats: JSON and XML - -JSON is the primary and recommended format for use with the Chargify API. XML is also provided as a backwards compatible option for Merchants who require it. - -#### Authentication - -Authentication is implemented as HTTP Basic Authentication over TLS >= 1.2 (HTTPS), as described in [API Authentication](https://developers.chargify.com/docs/developer-docs/ZG9jOjE1NTUxNQ-authentication) - -#### URL - -The URL for API requests includes the subdomain of the Site you are working with: - -`https://.chargify.com/` - -#### Response Data - -Response data is sent as either XML or JSON, depending on the type of data requested (`HTTP Content-Type` header) or the type specified as being accepted (HTTP `Accept` header). - -GETs for individual statements & invoices may also be requested as PDF using `application/pdf` or appending `.pdf` to the resource URI. - -Response codes are sent via the normal HTTP Response Code, and are documented separately for each resource. - -For boolean fields, please note that a value of `null` may be considered as false. However, this is not true across all cases. Please excercise good judgement here, or contact support with any questions. - -For example: - -+ `null` can define that there's no data available for that attribute - -#### Pagination - -When an endpoint returns a list of items, it will be paginated. Usually, 20 items will be returned by default, and you may request up to a maximum of 200 at a time. Pagination is done with query string parameters, for example: `?page=5&per_page=200` - -#### Response Time Zones - -API responses from Chargify are sent with the timezone of current Chargify site. - -Alternately, webhooks sent from Chargify globally utilize EST as the timezone for all content in the body of the payload. - -#### Request Data - -POST and PUT request data may be formatted as either XML (`application/xml`) or JSON (`application/json`). For best results, you should set your HTTP `Content-Type` request header accordingly, although you may also specify your format by appending `.xml` or `.json` extensions on to the resource URI. - -Note that Chargify does not accept PUT or POST data sent as query params or form encoded data – data must be sent as either XML or JSON. If you fail to set your `Content-Type` to either `application/xml` or `application/json`, your request may fail due to triggering of forgery protection mechanisms. - -##### About Decimal Numbers - -In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers. - -We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic. - -##### About Amount Fields - -Fields holding amount values are given as a string representing a decimal whole currency amount. - -For example, `"1.23"` in currency `"USD"` would equate to `$1.23`. - -Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination. - -It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application. - -#### Debugging - -If you’re having difficulty executing a request via our API, try the simplest thing and attempt your request via the curl command-line tool, as shown in the below example. Add the `--verbose` flag to your request to receive even more debugging information. - -Another handy tool is [Beeceptor](https://beeceptor.com/). You can use this to intercept your request to see exactly what is being sent. - -If you are unable to connect at all, check that you are using TLS 1.2 or better. - -If you see a "Could not resolve host" error, double check that the url is correct, including your subdomain. For example: `mysite.chargify.com`. This error means your DNS server could not find an IP address for the domain you are trying to connect to. - -#### Backwards Compatibility - -We consider the following changes to be backwards compatible and may make them without advance notice: - +Chargify accepts and returns both JSON and XML data via the API. + +You’ll likely need access to a web developer or programmer (if you’re not one) to get the most use out of the API. + +#### Available Formats: JSON and XML + +JSON is the primary and recommended format for use with the Chargify API. XML is also provided as a backwards compatible option for Merchants who require it. + +#### Authentication + +Authentication is implemented as HTTP Basic Authentication over TLS >= 1.2 (HTTPS), as described in [API Authentication](https://developers.chargify.com/docs/developer-docs/ZG9jOjE1NTUxNQ-authentication) + +#### URL + +The URL for API requests includes the subdomain of the Site you are working with: + +`https://.chargify.com/` + +#### Response Data + +Response data is sent as either XML or JSON, depending on the type of data requested (`HTTP Content-Type` header) or the type specified as being accepted (HTTP `Accept` header). + +GETs for individual statements & invoices may also be requested as PDF using `application/pdf` or appending `.pdf` to the resource URI. + +Response codes are sent via the normal HTTP Response Code, and are documented separately for each resource. + +For boolean fields, please note that a value of `null` may be considered as false. However, this is not true across all cases. Please excercise good judgement here, or contact support with any questions. + +For example: + ++ `null` can define that there's no data available for that attribute + +#### Pagination + +When an endpoint returns a list of items, it will be paginated. Usually, 20 items will be returned by default, and you may request up to a maximum of 200 at a time. Pagination is done with query string parameters, for example: `?page=5&per_page=200` + +#### Response Time Zones + +API responses from Chargify are sent with the timezone of current Chargify site. + +Alternately, webhooks sent from Chargify globally utilize EST as the timezone for all content in the body of the payload. + +#### Request Data + +POST and PUT request data may be formatted as either XML (`application/xml`) or JSON (`application/json`). For best results, you should set your HTTP `Content-Type` request header accordingly, although you may also specify your format by appending `.xml` or `.json` extensions on to the resource URI. + +Note that Chargify does not accept PUT or POST data sent as query params or form encoded data – data must be sent as either XML or JSON. If you fail to set your `Content-Type` to either `application/xml` or `application/json`, your request may fail due to triggering of forgery protection mechanisms. + +##### About Decimal Numbers + +In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers. + +We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic. + +##### About Amount Fields + +Fields holding amount values are given as a string representing a decimal whole currency amount. + +For example, `"1.23"` in currency `"USD"` would equate to `$1.23`. + +Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination. + +It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application. + +#### Debugging + +If you’re having difficulty executing a request via our API, try the simplest thing and attempt your request via the curl command-line tool, as shown in the below example. Add the `--verbose` flag to your request to receive even more debugging information. + +Another handy tool is [Beeceptor](https://beeceptor.com/). You can use this to intercept your request to see exactly what is being sent. + +If you are unable to connect at all, check that you are using TLS 1.2 or better. + +If you see a "Could not resolve host" error, double check that the url is correct, including your subdomain. For example: `mysite.chargify.com`. This error means your DNS server could not find an IP address for the domain you are trying to connect to. + +#### Backwards Compatibility + +We consider the following changes to be backwards compatible and may make them without advance notice: + + Adding new API endpoints, or adding new attributes in the responses of existing endpoints + Adding new optional parameters to be sent to existing API endpoints + Adding new fields to exported data + Changing the type or length of any of the ID attributes - + For example, most IDs are currently integers, but you should not assume that this will always be the case. - -In addition, you should not depend on the order of attributes within the API response as this may change. - -Chargify does not provide notifications for additions that are clearly defined as backwards compatible. - -#### Examples - -The following examples use the curl command-line tool to execute API requests. - -##### Subscription Listing - -**Request** - -curl -u :x -H Accept:application/json -H Content-Type:application/json https://acme.chargify.com/subscriptions.json - -### API Access Limitations - + + For example, most IDs are currently integers, but you should not assume that this will always be the case. + +In addition, you should not depend on the order of attributes within the API response as this may change. + +Chargify does not provide notifications for additions that are clearly defined as backwards compatible. + +#### Examples + +The following examples use the curl command-line tool to execute API requests. + +##### Subscription Listing + +**Request** + +curl -u :x -H Accept:application/json -H Content-Type:application/json https://acme.chargify.com/subscriptions.json + +### API Access Limitations + There are a few scenarios that may end up in causing an API request to be blocked even with correct credentials. -**Please note:** All relevant API requests will be blocked if any of the below conditions are true. These limitations also apply to [Chargify Direct](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDE3-introduction). - -Those scenarios are as follows: - +**Please note:** All relevant API requests will be blocked if any of the below conditions are true. These limitations also apply to [Chargify Direct](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDE3-introduction). + +Those scenarios are as follows: + - Your Chargify subscription is canceled. - Your Chargify trial has reached an end. - The site you're making a request for is in the process of ["clearing site data"](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309) - _Note: any API request for another site that is in a good state will NOT be blocked_ - The site you're making a request for has been deleted. - - _Note: any API request for another site that is in a good state will NOT be blocked_ - -Read more about your Chargify subscription [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405430043149-Advanced-Billing-Subscription#advanced-billing-subscription-0-0) - -#### What happens when an API request is blocked - -The request will fail with a `422` http status code. The response will also include a message explaining the reason for the request being blocked. For example: - -- If your Chargify subscription is canceled: - + - _Note: any API request for another site that is in a good state will NOT be blocked_ + +Read more about your Chargify subscription [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405430043149-Advanced-Billing-Subscription#advanced-billing-subscription-0-0) + +#### What happens when an API request is blocked + +The request will fail with a `422` http status code. The response will also include a message explaining the reason for the request being blocked. For example: + +- If your Chargify subscription is canceled: + ```json { "errors" => [ [0] "Your Chargify account has been canceled. Please contact support@chargify.com to reactivate." ] } -``` - -- If your Chargify trial has reached and end and you attempted to make an API request, the response body will look like: - +``` + +- If your Chargify trial has reached and end and you attempted to make an API request, the response body will look like: + ```json { "errors" => [ [0] "Your trial has ended, please contact sales." ] } -``` - -- If the site you're making a request for is in the process of ["clearing site data"](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309): - +``` + +- If the site you're making a request for is in the process of ["clearing site data"](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309): + ```json { "errors" => [ [0] "Site data clearing is in progress. Please try later." ] } -``` - -- If the site you're making a request for has been deleted: - +``` + +- If the site you're making a request for has been deleted: + ```json { "errors" => [ [0] "This site has been deleted." ] } -``` - -### Secure Applications - -Please note that it is NOT possible to make API requests directly from the customer's browser or device. Doing so would expose your API key on the client side, and anyone who has that key has full access to all of your Chargify data. - -Instead you will need to take care to tokenize sensitive information by using [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) or a similar JavaScript library provided by your gateway, and then post the token and other information to your own server, from which you can make the API call to Chargify. - -#### Troubleshooting - -If you attempt to make a Chargify API request directly from the customer's browser, you may see an error such as: - +``` + +### Secure Applications + +Please note that it is NOT possible to make API requests directly from the customer's browser or device. Doing so would expose your API key on the client side, and anyone who has that key has full access to all of your Chargify data. + +Instead you will need to take care to tokenize sensitive information by using [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) or a similar JavaScript library provided by your gateway, and then post the token and other information to your own server, from which you can make the API call to Chargify. + +#### Troubleshooting + +If you attempt to make a Chargify API request directly from the customer's browser, you may see an error such as: + ``` Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. -``` - -or - +``` + +or + ``` Origin 'https://example.com' is therefore not allowed access.` `The response had HTTP status code 404. -``` - -This is an error message indicating that Cross-Origin Resource Sharing (CORS) is not enabled on the Chargify server. - -### Relationship Invoicing - -#### API Compatibility for Relationship Invoicing - -This section describes the API for the new, [Relationship Invoicing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253) style of invoices introduced in January 2018. - -If you are an existing customer from prior to January 2018 or have not otherwise explicitly opted into this new style of invoices, you are probably looking for the legacy "Invoices" section that describes [invoice-billing legacy-style invoices](./b3A6MTQxMDgzNjQ-read-invoice). - -These new invoices provide a single representation of all of your Chargify billing, whether you collect automatically or via remittance. - -#### About Decimal Numbers - -In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers. - -We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic. - -#### About Amount Fields - -Fields holding amount values are given as a string representing a decimal whole currency amount. - -For example, `"1.23"` in currency `"USD"` would equate to `$1.23`. - -Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination. - -It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application. - -##### Relationship Invoicing Summary - +``` + +This is an error message indicating that Cross-Origin Resource Sharing (CORS) is not enabled on the Chargify server. + +### Relationship Invoicing + +#### API Compatibility for Relationship Invoicing + +This section describes the API for the new, [Relationship Invoicing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253) style of invoices introduced in January 2018. + +If you are an existing customer from prior to January 2018 or have not otherwise explicitly opted into this new style of invoices, you are probably looking for the legacy "Invoices" section that describes [invoice-billing legacy-style invoices](./b3A6MTQxMDgzNjQ-read-invoice). + +These new invoices provide a single representation of all of your Chargify billing, whether you collect automatically or via remittance. + +#### About Decimal Numbers + +In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers. + +We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic. + +#### About Amount Fields + +Fields holding amount values are given as a string representing a decimal whole currency amount. + +For example, `"1.23"` in currency `"USD"` would equate to `$1.23`. + +Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination. + +It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application. + +##### Relationship Invoicing Summary + + If your site **is** using relationship invoicing, you may only use the methods described in this section for working with invoices. + If your site is **not** using relationship invoicing, please use the legacy invoice methods: @@ -264,44 +264,44 @@ It is up to API consumers to parse the string into a decimal number representati + [Invoices](./b3A6MTQxMTA0MTA-read-invoice) + [Invoices: Payments](./b3A6MTQxMTA0MTI-create-invoice-payment) + [Invoices: Charges](./b3A6MTQxMTA0MTM-create-charge) - + [Invoices: Credits](./b3A6MTQxMTA0MTQ-create-invoice-credit) - -### Requirements - -The SDK requires **Go version 1.18 or above**. - -## Installation - -The following section explains how to use the advancedbilling library in a new project. - -### 1. Install the Package - -To use the package in your application, you can install the package from [pkg.go.dev](https://pkg.go.dev/) using the following command: - + + [Invoices: Credits](./b3A6MTQxMTA0MTQ-create-invoice-credit) + +### Requirements + +The SDK requires **Go version 1.18 or above**. + +## Installation + +The following section explains how to use the advancedbilling library in a new project. + +### 1. Install the Package + +To use the package in your application, you can install the package from [pkg.go.dev](https://pkg.go.dev/) using the following command: + ```bash $ go get github.com/maxio-com/ab-golang-sdk@v0.0.4 -``` - -You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.0.4 - -## Initialize the API Client - -**_Note:_** Documentation for the client can be found [here.](doc/client.md) - -The following parameters are configurable for the API Client: - -| Parameter | Type | Description | -| --- | --- | --- | -| `subdomain` | `string` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | -| `domain` | `string` | The Chargify server domain.
*Default*: `"chargify.com"` | -| `environment` | Environment | The API environment.
**Default: `Environment.PRODUCTION`** | -| `httpConfiguration` | [`HttpConfiguration`](doc/http-configuration.md) | Configurable http client options like timeout and retries. | -| `basicAuthUserName` | `string` | The username to use with basic authentication | -| `basicAuthPassword` | `string` | The password to use with basic authentication | - -The API client can be initialized as follows: - -```go +``` + +You can also view the package at: https://pkg.go.dev/github.com/maxio-com/ab-golang-sdk@v0.0.4 + +## Initialize the API Client + +**_Note:_** Documentation for the client can be found [here.](doc/client.md) + +The following parameters are configurable for the API Client: + +| Parameter | Type | Description | +| --- | --- | --- | +| `subdomain` | `string` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | +| `domain` | `string` | The Chargify server domain.
*Default*: `"chargify.com"` | +| `environment` | Environment | The API environment.
**Default: `Environment.PRODUCTION`** | +| `httpConfiguration` | [`HttpConfiguration`](doc/http-configuration.md) | Configurable http client options like timeout and retries. | +| `basicAuthUserName` | `string` | The username to use with basic authentication | +| `basicAuthPassword` | `string` | The password to use with basic authentication | + +The API client can be initialized as follows: + +```go config := advancedbilling.CreateConfiguration( advancedbilling.WithHttpConfiguration( advancedbilling.CreateHttpConfiguration( @@ -324,26 +324,26 @@ config := advancedbilling.CreateConfiguration( advancedbilling.WithBasicAuthUserName("BasicAuthUserName"), advancedbilling.WithBasicAuthPassword("BasicAuthPassword"), ) -client := advancedbilling.NewClient(config) -``` - -## Environments - -The SDK can be configured to use a different environment for making API calls. Available environments are: - -### Fields - -| Name | Description | -| --- | --- | -| production | **Default** Production server | -| environment2 | Production server | - -## Authorization - -This API uses `Basic Authentication`. - -## List of APIs - +client := advancedbilling.NewClient(config) +``` + +## Environments + +The SDK can be configured to use a different environment for making API calls. Available environments are: + +### Fields + +| Name | Description | +| --- | --- | +| production | **Default** Production server | +| environment2 | Production server | + +## Authorization + +This API uses `Basic Authentication`. + +## List of APIs + * [API Exports](doc/controllers/api-exports.md) * [Advance Invoice](doc/controllers/advance-invoice.md) * [Billing Portal](doc/controllers/billing-portal.md) @@ -374,10 +374,10 @@ This API uses `Basic Authentication`. * [Products](doc/controllers/products.md) * [Sites](doc/controllers/sites.md) * [Subscriptions](doc/controllers/subscriptions.md) -* [Webhooks](doc/controllers/webhooks.md) - -## Classes Documentation - +* [Webhooks](doc/controllers/webhooks.md) + +## Classes Documentation + * [HttpConfiguration](doc/http-configuration.md) -* [RetryConfiguration](doc/retry-configuration.md) - +* [RetryConfiguration](doc/retry-configuration.md) + diff --git a/advance_invoice_controller.go b/advance_invoice_controller.go index 6bb13526..f259375b 100644 --- a/advance_invoice_controller.go +++ b/advance_invoice_controller.go @@ -1,149 +1,149 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // AdvanceInvoiceController represents a controller struct. type AdvanceInvoiceController struct { - baseController + baseController } -// NewAdvanceInvoiceController creates a new instance of AdvanceInvoiceController. +// NewAdvanceInvoiceController creates a new instance of AdvanceInvoiceController. // It takes a baseController as a parameter and returns a pointer to the AdvanceInvoiceController. func NewAdvanceInvoiceController(baseController baseController) *AdvanceInvoiceController { - advanceInvoiceController := AdvanceInvoiceController{baseController: baseController} - return &advanceInvoiceController + advanceInvoiceController := AdvanceInvoiceController{baseController: baseController} + return &advanceInvoiceController } -// IssueAdvanceInvoice takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice) for more information on advance invoices, including eligibility on 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. +// IssueAdvanceInvoice takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice) for more information on advance invoices, including eligibility on 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. func (a *AdvanceInvoiceController) IssueAdvanceInvoice( - ctx context.Context, - subscriptionId int, - body *models.IssueAdvanceInvoiceRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := a.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/advance_invoice/issue.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.IssueAdvanceInvoiceRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := a.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/advance_invoice/issue.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadAdvanceInvoice takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. +// ReadAdvanceInvoice takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. // Once an advance invoice has been generated for a subscription's upcoming renewal, it can be viewed through this endpoint. There can only be one advance invoice per subscription per billing cycle. func (a *AdvanceInvoiceController) ReadAdvanceInvoice( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.Invoice], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/advance_invoice.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.Invoice], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/advance_invoice.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// VoidAdvanceInvoice takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. +// VoidAdvanceInvoice takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. // A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, please [see our help docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice). func (a *AdvanceInvoiceController) VoidAdvanceInvoice( - ctx context.Context, - subscriptionId int, - body *models.VoidInvoiceRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := a.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/advance_invoice/void.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.VoidInvoiceRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := a.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/advance_invoice/void.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } diff --git a/api_exports_controller.go b/api_exports_controller.go index 879c9993..57dc4175 100644 --- a/api_exports_controller.go +++ b/api_exports_controller.go @@ -1,367 +1,367 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // APIExportsController represents a controller struct. type APIExportsController struct { - baseController + baseController } -// NewAPIExportsController creates a new instance of APIExportsController. +// NewAPIExportsController creates a new instance of APIExportsController. // It takes a baseController as a parameter and returns a pointer to the APIExportsController. func NewAPIExportsController(baseController baseController) *APIExportsController { - APIExportsController := APIExportsController{baseController: baseController} - return &APIExportsController + APIExportsController := APIExportsController{baseController: baseController} + return &APIExportsController } -// ListExportedProformaInvoices takes context, batchId, perPage, page as parameters and -// returns an models.ApiResponse with []models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// This API returns an array of exported proforma invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +// ListExportedProformaInvoices takes context, batchId, perPage, page as parameters and +// returns an models.ApiResponse with []models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// This API returns an array of exported proforma invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. // Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`. func (a *APIExportsController) ListExportedProformaInvoices( - ctx context.Context, - batchId string, - perPage *int, - page *int) ( - models.ApiResponse[[]models.ProformaInvoice], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/proforma_invoices/%v/rows.json", batchId), - ) - req.Authenticate(true) - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if page != nil { - req.QueryParam("page", *page) - } - - var result []models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string, + perPage *int, + page *int) ( + models.ApiResponse[[]models.ProformaInvoice], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/proforma_invoices/%v/rows.json", batchId), + ) + req.Authenticate(true) + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if page != nil { + req.QueryParam("page", *page) + } + + var result []models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ListExportedInvoices takes context, batchId, perPage, page as parameters and -// returns an models.ApiResponse with []models.Invoice data and -// an error if there was an issue with the request or response. -// This API returns an array of exported invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +// ListExportedInvoices takes context, batchId, perPage, page as parameters and +// returns an models.ApiResponse with []models.Invoice data and +// an error if there was an issue with the request or response. +// This API returns an array of exported invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. // Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`. func (a *APIExportsController) ListExportedInvoices( - ctx context.Context, - batchId string, - perPage *int, - page *int) ( - models.ApiResponse[[]models.Invoice], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/invoices/%v/rows.json", batchId), - ) - req.Authenticate(true) - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if page != nil { - req.QueryParam("page", *page) - } - - var result []models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string, + perPage *int, + page *int) ( + models.ApiResponse[[]models.Invoice], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/invoices/%v/rows.json", batchId), + ) + req.Authenticate(true) + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if page != nil { + req.QueryParam("page", *page) + } + + var result []models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ListExportedSubscriptions takes context, batchId, perPage, page as parameters and -// returns an models.ApiResponse with []models.Subscription data and -// an error if there was an issue with the request or response. -// This API returns an array of exported subscriptions for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +// ListExportedSubscriptions takes context, batchId, perPage, page as parameters and +// returns an models.ApiResponse with []models.Subscription data and +// an error if there was an issue with the request or response. +// This API returns an array of exported subscriptions for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. // Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`. func (a *APIExportsController) ListExportedSubscriptions( - ctx context.Context, - batchId string, - perPage *int, - page *int) ( - models.ApiResponse[[]models.Subscription], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/subscriptions/%v/rows.json", batchId), - ) - req.Authenticate(true) - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if page != nil { - req.QueryParam("page", *page) - } - - var result []models.Subscription - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Subscription](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string, + perPage *int, + page *int) ( + models.ApiResponse[[]models.Subscription], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/subscriptions/%v/rows.json", batchId), + ) + req.Authenticate(true) + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if page != nil { + req.QueryParam("page", *page) + } + + var result []models.Subscription + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Subscription](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ExportProformaInvoices takes context as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. -// This API creates a proforma invoices export and returns a batchjob object. +// ExportProformaInvoices takes context as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. +// This API creates a proforma invoices export and returns a batchjob object. // It is only available for Relationship Invoicing architecture. func (a *APIExportsController) ExportProformaInvoices(ctx context.Context) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest(ctx, "POST", "/api_exports/proforma_invoices.json") - req.Authenticate(true) - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 409 { - err = errors.NewSingleErrorResponse(409, "Conflict") - } - return models.NewApiResponse(result, resp), err + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest(ctx, "POST", "/api_exports/proforma_invoices.json") + req.Authenticate(true) + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 409 { + err = errors.NewSingleErrorResponse(409, "Conflict") + } + return models.NewApiResponse(result, resp), err } -// ExportInvoices takes context as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. +// ExportInvoices takes context as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. // This API creates an invoices export and returns a batchjob object. func (a *APIExportsController) ExportInvoices(ctx context.Context) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest(ctx, "POST", "/api_exports/invoices.json") - req.Authenticate(true) - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 409 { - err = errors.NewSingleErrorResponse(409, "Conflict") - } - return models.NewApiResponse(result, resp), err + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest(ctx, "POST", "/api_exports/invoices.json") + req.Authenticate(true) + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 409 { + err = errors.NewSingleErrorResponse(409, "Conflict") + } + return models.NewApiResponse(result, resp), err } -// ExportSubscriptions takes context as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. +// ExportSubscriptions takes context as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. // This API creates a subscriptions export and returns a batchjob object. func (a *APIExportsController) ExportSubscriptions(ctx context.Context) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest(ctx, "POST", "/api_exports/subscriptions.json") - req.Authenticate(true) - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 409 { - err = errors.NewSingleErrorResponse(409, "Conflict") - } - return models.NewApiResponse(result, resp), err + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest(ctx, "POST", "/api_exports/subscriptions.json") + req.Authenticate(true) + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 409 { + err = errors.NewSingleErrorResponse(409, "Conflict") + } + return models.NewApiResponse(result, resp), err } -// ReadProformaInvoicesExport takes context, batchId as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. +// ReadProformaInvoicesExport takes context, batchId as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. // This API returns a batchjob object for proforma invoices export. func (a *APIExportsController) ReadProformaInvoicesExport( - ctx context.Context, - batchId string) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/proforma_invoices/%v.json", batchId), - ) - req.Authenticate(true) - - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string) ( + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/proforma_invoices/%v.json", batchId), + ) + req.Authenticate(true) + + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ReadInvoicesExport takes context, batchId as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. +// ReadInvoicesExport takes context, batchId as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. // This API returns a batchjob object for invoices export. func (a *APIExportsController) ReadInvoicesExport( - ctx context.Context, - batchId string) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/invoices/%v.json", batchId), - ) - req.Authenticate(true) - - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string) ( + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/invoices/%v.json", batchId), + ) + req.Authenticate(true) + + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ReadSubscriptionsExport takes context, batchId as parameters and -// returns an models.ApiResponse with models.BatchJobResponse data and -// an error if there was an issue with the request or response. +// ReadSubscriptionsExport takes context, batchId as parameters and +// returns an models.ApiResponse with models.BatchJobResponse data and +// an error if there was an issue with the request or response. // This API returns a batchjob object for subscriptions export. func (a *APIExportsController) ReadSubscriptionsExport( - ctx context.Context, - batchId string) ( - models.ApiResponse[models.BatchJobResponse], - error) { - req := a.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/api_exports/subscriptions/%v.json", batchId), - ) - req.Authenticate(true) - - var result models.BatchJobResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + batchId string) ( + models.ApiResponse[models.BatchJobResponse], + error) { + req := a.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/api_exports/subscriptions/%v.json", batchId), + ) + req.Authenticate(true) + + var result models.BatchJobResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BatchJobResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } diff --git a/base_controller.go b/base_controller.go index 9a3989ec..4d888eb3 100644 --- a/base_controller.go +++ b/base_controller.go @@ -1,33 +1,33 @@ -package advancedbilling - +package advancedbilling + import ( - "github.com/apimatic/go-core-runtime/https" - "net/http" + "github.com/apimatic/go-core-runtime/https" + "net/http" ) -// callBuilderFactory is an interface that defines a method to get a CallBuilderFactory. -// It allows objects to get a reference to a CallBuilderFactory for creating API call. -type callBuilderFactory interface { - GetCallBuilder() https.CallBuilderFactory -} - -// baseController represents a controller used as a base for other controllers. -// It encapsulates common functionality required by controllers for making API call. -type baseController struct { - callBuilder callBuilderFactory - prepareRequest https.CallBuilderFactory -} - -// NewBaseController creates a new instance of baseController. -// It takes a callBuilderFactory as a parameter and returns a pointer to the baseController. -func NewBaseController(cb callBuilderFactory) *baseController { - baseController := baseController{callBuilder: cb} - baseController.prepareRequest = baseController.callBuilder.GetCallBuilder() - return &baseController -} - -// validateResponse is a function used to validate the HTTP response. -// It takes an http.Response object as a parameter and returns an error, if any. +// callBuilderFactory is an interface that defines a method to get a CallBuilderFactory. +// It allows objects to get a reference to a CallBuilderFactory for creating API call. +type callBuilderFactory interface { + GetCallBuilder() https.CallBuilderFactory +} + +// baseController represents a controller used as a base for other controllers. +// It encapsulates common functionality required by controllers for making API call. +type baseController struct { + callBuilder callBuilderFactory + prepareRequest https.CallBuilderFactory +} + +// NewBaseController creates a new instance of baseController. +// It takes a callBuilderFactory as a parameter and returns a pointer to the baseController. +func NewBaseController(cb callBuilderFactory) *baseController { + baseController := baseController{callBuilder: cb} + baseController.prepareRequest = baseController.callBuilder.GetCallBuilder() + return &baseController +} + +// validateResponse is a function used to validate the HTTP response. +// It takes an http.Response object as a parameter and returns an error, if any. func validateResponse(response http.Response) error { return nil } diff --git a/billing_portal_controller.go b/billing_portal_controller.go index cb883d8e..3b51c2c3 100644 --- a/billing_portal_controller.go +++ b/billing_portal_controller.go @@ -1,198 +1,198 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // BillingPortalController represents a controller struct. type BillingPortalController struct { - baseController + baseController } -// NewBillingPortalController creates a new instance of BillingPortalController. +// NewBillingPortalController creates a new instance of BillingPortalController. // It takes a baseController as a parameter and returns a pointer to the BillingPortalController. func NewBillingPortalController(baseController baseController) *BillingPortalController { - billingPortalController := BillingPortalController{baseController: baseController} - return &billingPortalController + billingPortalController := BillingPortalController{baseController: baseController} + return &billingPortalController } -// EnableBillingPortalForCustomer takes context, customerId, autoInvite as parameters and -// returns an models.ApiResponse with models.CustomerResponse data and -// an error if there was an issue with the request or response. -// ## Billing Portal Documentation -// Full documentation on how the Billing Portal operates within the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407648972443). -// This documentation is focused on how the 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 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 Chargify. +// EnableBillingPortalForCustomer takes context, customerId, autoInvite as parameters and +// returns an models.ApiResponse with models.CustomerResponse data and +// an error if there was an issue with the request or response. +// ## Billing Portal Documentation +// Full documentation on how the Billing Portal operates within the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407648972443). +// This documentation is focused on how the 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 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 Chargify. // 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), please **do not** make an API request to Chargify every time. func (b *BillingPortalController) EnableBillingPortalForCustomer( - ctx context.Context, - customerId int, - autoInvite *models.AutoInvite) ( - models.ApiResponse[models.CustomerResponse], - error) { - req := b.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/portal/customers/%v/enable.json", customerId), - ) - req.Authenticate(true) - if autoInvite != nil { - req.QueryParam("auto_invite", *autoInvite) - } - - var result models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + customerId int, + autoInvite *models.AutoInvite) ( + models.ApiResponse[models.CustomerResponse], + error) { + req := b.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/portal/customers/%v/enable.json", customerId), + ) + req.Authenticate(true) + if autoInvite != nil { + req.QueryParam("auto_invite", *autoInvite) + } + + var result models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadBillingPortalLink takes context, customerId as parameters and -// returns an models.ApiResponse with models.PortalManagementLink data and -// an error if there was an issue with the request or response. -// This method will provide to the API user the exact URL required for a subscriber to access the Billing Portal. -// ## Rules for Management Link API -// + 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 -// + 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 +// ReadBillingPortalLink takes context, customerId as parameters and +// returns an models.ApiResponse with models.PortalManagementLink data and +// an error if there was an issue with the request or response. +// This method will provide to the API user the exact URL required for a subscriber to access the Billing Portal. +// ## Rules for Management Link API +// + 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 +// + 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`) func (b *BillingPortalController) ReadBillingPortalLink( - ctx context.Context, - customerId int) ( - models.ApiResponse[models.PortalManagementLink], - error) { - req := b.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/portal/customers/%v/management_link.json", customerId), - ) - req.Authenticate(true) - - var result models.PortalManagementLink - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PortalManagementLink](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - if resp.StatusCode == 429 { - err = errors.NewTooManyManagementLinkRequestsError(429, "Too Many Requests") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + customerId int) ( + models.ApiResponse[models.PortalManagementLink], + error) { + req := b.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/portal/customers/%v/management_link.json", customerId), + ) + req.Authenticate(true) + + var result models.PortalManagementLink + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PortalManagementLink](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + if resp.StatusCode == 429 { + err = errors.NewTooManyManagementLinkRequestsError(429, "Too Many Requests") + } + return models.NewApiResponse(result, resp), err } -// ResendBillingPortalInvitation takes context, customerId as parameters and -// returns an models.ApiResponse with models.ResentInvitation data and -// an error if there was an issue with the request or response. -// You can resend a customer's Billing Portal invitation. -// If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with `error` message in the body. -// If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. -// If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. -// If you attempt to resend an invitation when the Customer does not exist a Customer, you will receive a `404` error response. -// ## Limitations +// ResendBillingPortalInvitation takes context, customerId as parameters and +// returns an models.ApiResponse with models.ResentInvitation data and +// an error if there was an issue with the request or response. +// You can resend a customer's Billing Portal invitation. +// If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with `error` message in the body. +// If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. +// If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. +// If you attempt to resend an invitation when the Customer does not exist a Customer, you will receive a `404` error response. +// ## Limitations // This endpoint will only return a JSON response. func (b *BillingPortalController) ResendBillingPortalInvitation( - ctx context.Context, - customerId int) ( - models.ApiResponse[models.ResentInvitation], - error) { - req := b.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/portal/customers/%v/invitations/invite.json", customerId), - ) - req.Authenticate(true) - - var result models.ResentInvitation - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ResentInvitation](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + customerId int) ( + models.ApiResponse[models.ResentInvitation], + error) { + req := b.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/portal/customers/%v/invitations/invite.json", customerId), + ) + req.Authenticate(true) + + var result models.ResentInvitation + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ResentInvitation](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// RevokeBillingPortalAccess takes context, customerId as parameters and -// returns an models.ApiResponse with models.RevokedInvitation data and -// an error if there was an issue with the request or response. -// You can revoke a customer's Billing Portal invitation. -// If you attempt to revoke an invitation when the Billing Portal is already disabled for a Customer, you will receive a 422 error response. -// ## Limitations +// RevokeBillingPortalAccess takes context, customerId as parameters and +// returns an models.ApiResponse with models.RevokedInvitation data and +// an error if there was an issue with the request or response. +// You can revoke a customer's Billing Portal invitation. +// If you attempt to revoke an invitation when the Billing Portal is already disabled for a Customer, you will receive a 422 error response. +// ## Limitations // This endpoint will only return a JSON response. func (b *BillingPortalController) RevokeBillingPortalAccess( - ctx context.Context, - customerId int) ( - models.ApiResponse[models.RevokedInvitation], - error) { - req := b.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/portal/customers/%v/invitations/revoke.json", customerId), - ) - req.Authenticate(true) - - var result models.RevokedInvitation - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.RevokedInvitation](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + customerId int) ( + models.ApiResponse[models.RevokedInvitation], + error) { + req := b.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/portal/customers/%v/invitations/revoke.json", customerId), + ) + req.Authenticate(true) + + var result models.RevokedInvitation + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.RevokedInvitation](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/client.go b/client.go index 0802e072..cba249d3 100644 --- a/client.go +++ b/client.go @@ -1,334 +1,334 @@ -/* -Package advancedbilling - -This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). +/* +Package advancedbilling + +This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/https" - "github.com/apimatic/go-core-runtime/utilities" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/https" + "github.com/apimatic/go-core-runtime/utilities" + "net/http" ) // Client is an interface representing the main client for accessing configuration and controllers. type ClientInterface interface { - Configuration() *Configuration - APIExportsController() *APIExportsController - AdvanceInvoiceController() *AdvanceInvoiceController - BillingPortalController() *BillingPortalController - CouponsController() *CouponsController - ComponentsController() *ComponentsController - CustomersController() *CustomersController - CustomFieldsController() *CustomFieldsController - EventsController() *EventsController - EventsBasedBillingSegmentsController() *EventsBasedBillingSegmentsController - InsightsController() *InsightsController - InvoicesController() *InvoicesController - OffersController() *OffersController - PaymentProfilesController() *PaymentProfilesController - ProductFamiliesController() *ProductFamiliesController - ProductsController() *ProductsController - ProductPricePointsController() *ProductPricePointsController - ProformaInvoicesController() *ProformaInvoicesController - ReasonCodesController() *ReasonCodesController - ReferralCodesController() *ReferralCodesController - SalesCommissionsController() *SalesCommissionsController - SitesController() *SitesController - SubscriptionsController() *SubscriptionsController - SubscriptionComponentsController() *SubscriptionComponentsController - SubscriptionGroupsController() *SubscriptionGroupsController - SubscriptionGroupInvoiceAccountController() *SubscriptionGroupInvoiceAccountController - SubscriptionGroupStatusController() *SubscriptionGroupStatusController - SubscriptionInvoiceAccountController() *SubscriptionInvoiceAccountController - SubscriptionNotesController() *SubscriptionNotesController - SubscriptionProductsController() *SubscriptionProductsController - SubscriptionStatusController() *SubscriptionStatusController - WebhooksController() *WebhooksController - UserAgent() *string + Configuration() *Configuration + APIExportsController() *APIExportsController + AdvanceInvoiceController() *AdvanceInvoiceController + BillingPortalController() *BillingPortalController + CouponsController() *CouponsController + ComponentsController() *ComponentsController + CustomersController() *CustomersController + CustomFieldsController() *CustomFieldsController + EventsController() *EventsController + EventsBasedBillingSegmentsController() *EventsBasedBillingSegmentsController + InsightsController() *InsightsController + InvoicesController() *InvoicesController + OffersController() *OffersController + PaymentProfilesController() *PaymentProfilesController + ProductFamiliesController() *ProductFamiliesController + ProductsController() *ProductsController + ProductPricePointsController() *ProductPricePointsController + ProformaInvoicesController() *ProformaInvoicesController + ReasonCodesController() *ReasonCodesController + ReferralCodesController() *ReferralCodesController + SalesCommissionsController() *SalesCommissionsController + SitesController() *SitesController + SubscriptionsController() *SubscriptionsController + SubscriptionComponentsController() *SubscriptionComponentsController + SubscriptionGroupsController() *SubscriptionGroupsController + SubscriptionGroupInvoiceAccountController() *SubscriptionGroupInvoiceAccountController + SubscriptionGroupStatusController() *SubscriptionGroupStatusController + SubscriptionInvoiceAccountController() *SubscriptionInvoiceAccountController + SubscriptionNotesController() *SubscriptionNotesController + SubscriptionProductsController() *SubscriptionProductsController + SubscriptionStatusController() *SubscriptionStatusController + WebhooksController() *WebhooksController + UserAgent() *string } // client is an implementation of the Client interface. type client struct { - callBuilderFactory https.CallBuilderFactory - configuration Configuration - userAgent string - apiExportsController APIExportsController - advanceInvoiceController AdvanceInvoiceController - billingPortalController BillingPortalController - couponsController CouponsController - componentsController ComponentsController - customersController CustomersController - customFieldsController CustomFieldsController - eventsController EventsController - eventsBasedBillingSegmentsController EventsBasedBillingSegmentsController - insightsController InsightsController - invoicesController InvoicesController - offersController OffersController - paymentProfilesController PaymentProfilesController - productFamiliesController ProductFamiliesController - productsController ProductsController - productPricePointsController ProductPricePointsController - proformaInvoicesController ProformaInvoicesController - reasonCodesController ReasonCodesController - referralCodesController ReferralCodesController - salesCommissionsController SalesCommissionsController - sitesController SitesController - subscriptionsController SubscriptionsController - subscriptionComponentsController SubscriptionComponentsController - subscriptionGroupsController SubscriptionGroupsController - subscriptionGroupInvoiceAccountController SubscriptionGroupInvoiceAccountController - subscriptionGroupStatusController SubscriptionGroupStatusController - subscriptionInvoiceAccountController SubscriptionInvoiceAccountController - subscriptionNotesController SubscriptionNotesController - subscriptionProductsController SubscriptionProductsController - subscriptionStatusController SubscriptionStatusController - webhooksController WebhooksController -} - -// NewClient is the constructor for creating a new client instance. + callBuilderFactory https.CallBuilderFactory + configuration Configuration + userAgent string + apiExportsController APIExportsController + advanceInvoiceController AdvanceInvoiceController + billingPortalController BillingPortalController + couponsController CouponsController + componentsController ComponentsController + customersController CustomersController + customFieldsController CustomFieldsController + eventsController EventsController + eventsBasedBillingSegmentsController EventsBasedBillingSegmentsController + insightsController InsightsController + invoicesController InvoicesController + offersController OffersController + paymentProfilesController PaymentProfilesController + productFamiliesController ProductFamiliesController + productsController ProductsController + productPricePointsController ProductPricePointsController + proformaInvoicesController ProformaInvoicesController + reasonCodesController ReasonCodesController + referralCodesController ReferralCodesController + salesCommissionsController SalesCommissionsController + sitesController SitesController + subscriptionsController SubscriptionsController + subscriptionComponentsController SubscriptionComponentsController + subscriptionGroupsController SubscriptionGroupsController + subscriptionGroupInvoiceAccountController SubscriptionGroupInvoiceAccountController + subscriptionGroupStatusController SubscriptionGroupStatusController + subscriptionInvoiceAccountController SubscriptionInvoiceAccountController + subscriptionNotesController SubscriptionNotesController + subscriptionProductsController SubscriptionProductsController + subscriptionStatusController SubscriptionStatusController + webhooksController WebhooksController +} + +// NewClient is the constructor for creating a new client instance. // It takes a Configuration object as a parameter and returns the Client interface. func NewClient(configuration Configuration) ClientInterface { - client := &client{ - configuration: configuration, - } - - client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.0.4 on OS {os-info}") - client.callBuilderFactory = callBuilderHandler( - func(server string) string { - if server == "" { - server = "default" - } - return getBaseUri(Server(server), client.configuration) - }, - BasicAuthentication(configuration), - https.NewHttpClient(configuration.HttpConfiguration()), - configuration.httpConfiguration.RetryConfiguration(), - withUserAgent(client.userAgent), - ) - - baseController := NewBaseController(client) - client.apiExportsController = *NewAPIExportsController(*baseController) - client.advanceInvoiceController = *NewAdvanceInvoiceController(*baseController) - client.billingPortalController = *NewBillingPortalController(*baseController) - client.couponsController = *NewCouponsController(*baseController) - client.componentsController = *NewComponentsController(*baseController) - client.customersController = *NewCustomersController(*baseController) - client.customFieldsController = *NewCustomFieldsController(*baseController) - client.eventsController = *NewEventsController(*baseController) - client.eventsBasedBillingSegmentsController = *NewEventsBasedBillingSegmentsController(*baseController) - client.insightsController = *NewInsightsController(*baseController) - client.invoicesController = *NewInvoicesController(*baseController) - client.offersController = *NewOffersController(*baseController) - client.paymentProfilesController = *NewPaymentProfilesController(*baseController) - client.productFamiliesController = *NewProductFamiliesController(*baseController) - client.productsController = *NewProductsController(*baseController) - client.productPricePointsController = *NewProductPricePointsController(*baseController) - client.proformaInvoicesController = *NewProformaInvoicesController(*baseController) - client.reasonCodesController = *NewReasonCodesController(*baseController) - client.referralCodesController = *NewReferralCodesController(*baseController) - client.salesCommissionsController = *NewSalesCommissionsController(*baseController) - client.sitesController = *NewSitesController(*baseController) - client.subscriptionsController = *NewSubscriptionsController(*baseController) - client.subscriptionComponentsController = *NewSubscriptionComponentsController(*baseController) - client.subscriptionGroupsController = *NewSubscriptionGroupsController(*baseController) - client.subscriptionGroupInvoiceAccountController = *NewSubscriptionGroupInvoiceAccountController(*baseController) - client.subscriptionGroupStatusController = *NewSubscriptionGroupStatusController(*baseController) - client.subscriptionInvoiceAccountController = *NewSubscriptionInvoiceAccountController(*baseController) - client.subscriptionNotesController = *NewSubscriptionNotesController(*baseController) - client.subscriptionProductsController = *NewSubscriptionProductsController(*baseController) - client.subscriptionStatusController = *NewSubscriptionStatusController(*baseController) - client.webhooksController = *NewWebhooksController(*baseController) - return client + client := &client{ + configuration: configuration, + } + + client.userAgent = utilities.UpdateUserAgent("AB SDK Go:0.0.4 on OS {os-info}") + client.callBuilderFactory = callBuilderHandler( + func(server string) string { + if server == "" { + server = "default" + } + return getBaseUri(Server(server), client.configuration) + }, + BasicAuthentication(configuration), + https.NewHttpClient(configuration.HttpConfiguration()), + configuration.httpConfiguration.RetryConfiguration(), + withUserAgent(client.userAgent), + ) + + baseController := NewBaseController(client) + client.apiExportsController = *NewAPIExportsController(*baseController) + client.advanceInvoiceController = *NewAdvanceInvoiceController(*baseController) + client.billingPortalController = *NewBillingPortalController(*baseController) + client.couponsController = *NewCouponsController(*baseController) + client.componentsController = *NewComponentsController(*baseController) + client.customersController = *NewCustomersController(*baseController) + client.customFieldsController = *NewCustomFieldsController(*baseController) + client.eventsController = *NewEventsController(*baseController) + client.eventsBasedBillingSegmentsController = *NewEventsBasedBillingSegmentsController(*baseController) + client.insightsController = *NewInsightsController(*baseController) + client.invoicesController = *NewInvoicesController(*baseController) + client.offersController = *NewOffersController(*baseController) + client.paymentProfilesController = *NewPaymentProfilesController(*baseController) + client.productFamiliesController = *NewProductFamiliesController(*baseController) + client.productsController = *NewProductsController(*baseController) + client.productPricePointsController = *NewProductPricePointsController(*baseController) + client.proformaInvoicesController = *NewProformaInvoicesController(*baseController) + client.reasonCodesController = *NewReasonCodesController(*baseController) + client.referralCodesController = *NewReferralCodesController(*baseController) + client.salesCommissionsController = *NewSalesCommissionsController(*baseController) + client.sitesController = *NewSitesController(*baseController) + client.subscriptionsController = *NewSubscriptionsController(*baseController) + client.subscriptionComponentsController = *NewSubscriptionComponentsController(*baseController) + client.subscriptionGroupsController = *NewSubscriptionGroupsController(*baseController) + client.subscriptionGroupInvoiceAccountController = *NewSubscriptionGroupInvoiceAccountController(*baseController) + client.subscriptionGroupStatusController = *NewSubscriptionGroupStatusController(*baseController) + client.subscriptionInvoiceAccountController = *NewSubscriptionInvoiceAccountController(*baseController) + client.subscriptionNotesController = *NewSubscriptionNotesController(*baseController) + client.subscriptionProductsController = *NewSubscriptionProductsController(*baseController) + client.subscriptionStatusController = *NewSubscriptionStatusController(*baseController) + client.webhooksController = *NewWebhooksController(*baseController) + return client } // Configuration returns the configuration instance of the client. func (c *client) Configuration() *Configuration { - return &c.configuration + return &c.configuration } // APIExportsController returns the apiExportsController instance of the client. func (c *client) APIExportsController() *APIExportsController { - return &c.apiExportsController + return &c.apiExportsController } // AdvanceInvoiceController returns the advanceInvoiceController instance of the client. func (c *client) AdvanceInvoiceController() *AdvanceInvoiceController { - return &c.advanceInvoiceController + return &c.advanceInvoiceController } // BillingPortalController returns the billingPortalController instance of the client. func (c *client) BillingPortalController() *BillingPortalController { - return &c.billingPortalController + return &c.billingPortalController } // CouponsController returns the couponsController instance of the client. func (c *client) CouponsController() *CouponsController { - return &c.couponsController + return &c.couponsController } // ComponentsController returns the componentsController instance of the client. func (c *client) ComponentsController() *ComponentsController { - return &c.componentsController + return &c.componentsController } // CustomersController returns the customersController instance of the client. func (c *client) CustomersController() *CustomersController { - return &c.customersController + return &c.customersController } // CustomFieldsController returns the customFieldsController instance of the client. func (c *client) CustomFieldsController() *CustomFieldsController { - return &c.customFieldsController + return &c.customFieldsController } // EventsController returns the eventsController instance of the client. func (c *client) EventsController() *EventsController { - return &c.eventsController + return &c.eventsController } // EventsBasedBillingSegmentsController returns the eventsBasedBillingSegmentsController instance of the client. func (c *client) EventsBasedBillingSegmentsController() *EventsBasedBillingSegmentsController { - return &c.eventsBasedBillingSegmentsController + return &c.eventsBasedBillingSegmentsController } // InsightsController returns the insightsController instance of the client. func (c *client) InsightsController() *InsightsController { - return &c.insightsController + return &c.insightsController } // InvoicesController returns the invoicesController instance of the client. func (c *client) InvoicesController() *InvoicesController { - return &c.invoicesController + return &c.invoicesController } // OffersController returns the offersController instance of the client. func (c *client) OffersController() *OffersController { - return &c.offersController + return &c.offersController } // PaymentProfilesController returns the paymentProfilesController instance of the client. func (c *client) PaymentProfilesController() *PaymentProfilesController { - return &c.paymentProfilesController + return &c.paymentProfilesController } // ProductFamiliesController returns the productFamiliesController instance of the client. func (c *client) ProductFamiliesController() *ProductFamiliesController { - return &c.productFamiliesController + return &c.productFamiliesController } // ProductsController returns the productsController instance of the client. func (c *client) ProductsController() *ProductsController { - return &c.productsController + return &c.productsController } // ProductPricePointsController returns the productPricePointsController instance of the client. func (c *client) ProductPricePointsController() *ProductPricePointsController { - return &c.productPricePointsController + return &c.productPricePointsController } // ProformaInvoicesController returns the proformaInvoicesController instance of the client. func (c *client) ProformaInvoicesController() *ProformaInvoicesController { - return &c.proformaInvoicesController + return &c.proformaInvoicesController } // ReasonCodesController returns the reasonCodesController instance of the client. func (c *client) ReasonCodesController() *ReasonCodesController { - return &c.reasonCodesController + return &c.reasonCodesController } // ReferralCodesController returns the referralCodesController instance of the client. func (c *client) ReferralCodesController() *ReferralCodesController { - return &c.referralCodesController + return &c.referralCodesController } // SalesCommissionsController returns the salesCommissionsController instance of the client. func (c *client) SalesCommissionsController() *SalesCommissionsController { - return &c.salesCommissionsController + return &c.salesCommissionsController } // SitesController returns the sitesController instance of the client. func (c *client) SitesController() *SitesController { - return &c.sitesController + return &c.sitesController } // SubscriptionsController returns the subscriptionsController instance of the client. func (c *client) SubscriptionsController() *SubscriptionsController { - return &c.subscriptionsController + return &c.subscriptionsController } // SubscriptionComponentsController returns the subscriptionComponentsController instance of the client. func (c *client) SubscriptionComponentsController() *SubscriptionComponentsController { - return &c.subscriptionComponentsController + return &c.subscriptionComponentsController } // SubscriptionGroupsController returns the subscriptionGroupsController instance of the client. func (c *client) SubscriptionGroupsController() *SubscriptionGroupsController { - return &c.subscriptionGroupsController + return &c.subscriptionGroupsController } // SubscriptionGroupInvoiceAccountController returns the subscriptionGroupInvoiceAccountController instance of the client. func (c *client) SubscriptionGroupInvoiceAccountController() *SubscriptionGroupInvoiceAccountController { - return &c.subscriptionGroupInvoiceAccountController + return &c.subscriptionGroupInvoiceAccountController } // SubscriptionGroupStatusController returns the subscriptionGroupStatusController instance of the client. func (c *client) SubscriptionGroupStatusController() *SubscriptionGroupStatusController { - return &c.subscriptionGroupStatusController + return &c.subscriptionGroupStatusController } // SubscriptionInvoiceAccountController returns the subscriptionInvoiceAccountController instance of the client. func (c *client) SubscriptionInvoiceAccountController() *SubscriptionInvoiceAccountController { - return &c.subscriptionInvoiceAccountController + return &c.subscriptionInvoiceAccountController } // SubscriptionNotesController returns the subscriptionNotesController instance of the client. func (c *client) SubscriptionNotesController() *SubscriptionNotesController { - return &c.subscriptionNotesController + return &c.subscriptionNotesController } // SubscriptionProductsController returns the subscriptionProductsController instance of the client. func (c *client) SubscriptionProductsController() *SubscriptionProductsController { - return &c.subscriptionProductsController + return &c.subscriptionProductsController } // SubscriptionStatusController returns the subscriptionStatusController instance of the client. func (c *client) SubscriptionStatusController() *SubscriptionStatusController { - return &c.subscriptionStatusController + return &c.subscriptionStatusController } // WebhooksController returns the webhooksController instance of the client. func (c *client) WebhooksController() *WebhooksController { - return &c.webhooksController + return &c.webhooksController } // UserAgent returns the userAgent instance of the client. func (c *client) UserAgent() *string { - return &c.userAgent + return &c.userAgent } // GetCallBuilder returns the CallBuilderFactory used by the client. func (c *client) GetCallBuilder() https.CallBuilderFactory { - return c.callBuilderFactory + return c.callBuilderFactory } // getBaseUri returns the base URI based on the server and configuration. func getBaseUri( - server Server, - configuration Configuration) string { - if configuration.Environment() == Environment(PRODUCTION) { - if server == Server(ENUMDEFAULT) { - return fmt.Sprintf("https://%v.%v", configuration.Subdomain(), configuration.Domain()) - } - } - if configuration.Environment() == Environment(ENVIRONMENT2) { - if server == Server(ENUMDEFAULT) { - return "https://events.chargify.com" - } - } - return "TODO: Select a valid server." + server Server, + configuration Configuration) string { + if configuration.Environment() == Environment(PRODUCTION) { + if server == Server(ENUMDEFAULT) { + return fmt.Sprintf("https://%v.%v", configuration.Subdomain(), configuration.Domain()) + } + } + if configuration.Environment() == Environment(ENVIRONMENT2) { + if server == Server(ENUMDEFAULT) { + return "https://events.chargify.com" + } + } + return "TODO: Select a valid server." } // clientOptions is a function type representing options for the client. @@ -336,35 +336,35 @@ type clientOptions func(cb https.CallBuilder) // callBuilderHandler creates the call builder factory with various options. func callBuilderHandler( - baseUrlProvider func(server string) string, - auth https.Authenticator, - httpClient https.HttpClient, - retryConfig RetryConfiguration, - opts ...clientOptions) https.CallBuilderFactory { - callBuilderFactory := https.CreateCallBuilderFactory(baseUrlProvider, auth, httpClient, retryConfig) - return tap(callBuilderFactory, opts...) + baseUrlProvider func(server string) string, + auth https.Authenticator, + httpClient https.HttpClient, + retryConfig RetryConfiguration, + opts ...clientOptions) https.CallBuilderFactory { + callBuilderFactory := https.CreateCallBuilderFactory(baseUrlProvider, auth, httpClient, retryConfig) + return tap(callBuilderFactory, opts...) } // tap is a utility function to apply client options to the call builder factory. func tap( - callBuilderFactory https.CallBuilderFactory, - opts ...clientOptions) https.CallBuilderFactory { - return func(ctx context.Context, httpMethod, path string) https.CallBuilder { - callBuilder := callBuilderFactory(ctx, httpMethod, path) - for _, opt := range opts { - opt(callBuilder) - } - return callBuilder - } + callBuilderFactory https.CallBuilderFactory, + opts ...clientOptions) https.CallBuilderFactory { + return func(ctx context.Context, httpMethod, path string) https.CallBuilder { + callBuilder := callBuilderFactory(ctx, httpMethod, path) + for _, opt := range opts { + opt(callBuilder) + } + return callBuilder + } } // withUserAgent is an option to add a user agent header to the HTTP request. func withUserAgent(userAgent string) clientOptions { - f := func(request *http.Request) *http.Request { - request.Header.Add("user-agent", userAgent) - return request - } - return func(cb https.CallBuilder) { - cb.InterceptRequest(f) - } + f := func(request *http.Request) *http.Request { + request.Header.Add("user-agent", userAgent) + return request + } + return func(cb https.CallBuilder) { + cb.InterceptRequest(f) + } } diff --git a/components_controller.go b/components_controller.go index e2cb3c72..5273f84a 100644 --- a/components_controller.go +++ b/components_controller.go @@ -1,1050 +1,1050 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "time" ) // ComponentsController represents a controller struct. type ComponentsController struct { - baseController + baseController } -// NewComponentsController creates a new instance of ComponentsController. +// NewComponentsController creates a new instance of ComponentsController. // It takes a baseController as a parameter and returns a pointer to the ComponentsController. func NewComponentsController(baseController baseController) *ComponentsController { - componentsController := ComponentsController{baseController: baseController} - return &componentsController + componentsController := ComponentsController{baseController: baseController} + return &componentsController } -// CreateMeteredComponent takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription. -// Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. -// 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. +// CreateMeteredComponent takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription. +// Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. +// 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. // For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). func (c *ComponentsController) CreateMeteredComponent( - ctx context.Context, - productFamilyId int, - body *models.CreateMeteredComponent) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/metered_components.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateMeteredComponent) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/metered_components.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateQuantityBasedComponent takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will create a component definition of kind **quantity_based_component** under the specified product family. Quantity Based component can then be added and “allocated” for a subscription. -// When defining Quantity Based component, You can choose one of 2 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 a box-a-month club). This is most commonly associated with billing for user licenses, number of users, number of employees, etc. -// #### One-time -// One-time quantity-based components are used to create ad hoc usage charges that do not recur. For example, at the time of signup, you might want to 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. +// CreateQuantityBasedComponent takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will create a component definition of kind **quantity_based_component** under the specified product family. Quantity Based component can then be added and “allocated” for a subscription. +// When defining Quantity Based component, You can choose one of 2 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 a box-a-month club). This is most commonly associated with billing for user licenses, number of users, number of employees, etc. +// #### One-time +// One-time quantity-based components are used to create ad hoc usage charges that do not recur. For example, at the time of signup, you might want to 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 on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). func (c *ComponentsController) CreateQuantityBasedComponent( - ctx context.Context, - productFamilyId int, - body *models.CreateQuantityBasedComponent) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/quantity_based_components.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateQuantityBasedComponent) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/quantity_based_components.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateOnOffComponent takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription. -// On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). +// CreateOnOffComponent takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription. +// On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). // For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). func (c *ComponentsController) CreateOnOffComponent( - ctx context.Context, - productFamilyId int, - body *models.CreateOnOffComponent) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/on_off_components.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateOnOffComponent) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/on_off_components.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreatePrepaidUsageComponent takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will create a component definition of kind **prepaid_usage_component** under the specified product family. 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. +// CreatePrepaidUsageComponent takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will create a component definition of kind **prepaid_usage_component** under the specified product family. 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. // For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). func (c *ComponentsController) CreatePrepaidUsageComponent( - ctx context.Context, - productFamilyId int, - body *models.CreatePrepaidComponent) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/prepaid_usage_components.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreatePrepaidComponent) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/prepaid_usage_components.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateEventBasedComponent takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will create a component definition of kind **event_based_component** under the specified product family. Event-based component can then be added and “allocated” for a subscription. -// Event-based components are similar to other component types, in that you define the component parameters (such as name and taxability) and the pricing. A key difference for the event-based component is that it must be attached to a metric. This is because the metric provides the component with the actual quantity used in computing what and how much will be billed each 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. +// CreateEventBasedComponent takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will create a component definition of kind **event_based_component** under the specified product family. Event-based component can then be added and “allocated” for a subscription. +// Event-based components are similar to other component types, in that you define the component parameters (such as name and taxability) and the pricing. A key difference for the event-based component is that it must be attached to a metric. This is because the metric provides the component with the actual quantity used in computing what and how much will be billed each 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, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). func (c *ComponentsController) CreateEventBasedComponent( - ctx context.Context, - productFamilyId int, - body *models.CreateEBBComponent) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/event_based_components.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateEBBComponent) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/event_based_components.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadComponentByHandle takes context, handle as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. +// FindComponent takes context, handle as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. // This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate. -func (c *ComponentsController) ReadComponentByHandle( - ctx context.Context, - handle string) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/components/lookup.json") - req.Authenticate(true) - req.QueryParam("handle", handle) - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *ComponentsController) FindComponent( + ctx context.Context, + handle string) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/components/lookup.json") + req.Authenticate(true) + req.QueryParam("handle", handle) + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadComponentById takes context, productFamilyId, componentId as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will return information regarding a component from a specific product family. +// ReadComponent takes context, productFamilyId, componentId as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will return information regarding 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:`. -func (c *ComponentsController) ReadComponentById( - ctx context.Context, - productFamilyId int, - componentId string) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), - ) - req.Authenticate(true) - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *ComponentsController) ReadComponent( + ctx context.Context, + productFamilyId int, + componentId string) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), + ) + req.Authenticate(true) + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateProductFamilyComponent takes context, productFamilyId, componentId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will update a component from a specific product family. +// UpdateProductFamilyComponent takes context, productFamilyId, componentId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will update 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:`. func (c *ComponentsController) UpdateProductFamilyComponent( - ctx context.Context, - productFamilyId int, - componentId string, - body *models.UpdateComponentRequest) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + componentId string, + body *models.UpdateComponentRequest) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ArchiveComponent takes context, productFamilyId, componentId as parameters and -// returns an models.ApiResponse with models.Component data and -// an error if there was an issue with the request or response. +// ArchiveComponent takes context, productFamilyId, componentId as parameters and +// returns an models.ApiResponse with models.Component data and +// an error if there was an issue with the request or response. // Sending a DELETE request to this endpoint will archive the component. All current subscribers will be unffected; their subscription/purchase will continue to be charged as usual. func (c *ComponentsController) ArchiveComponent( - ctx context.Context, - productFamilyId int, - componentId string) ( - models.ApiResponse[models.Component], - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), - ) - req.Authenticate(true) - - var result models.Component - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Component](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + componentId string) ( + models.ApiResponse[models.Component], + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/product_families/%v/components/%v.json", productFamilyId, componentId), + ) + req.Authenticate(true) + + var result models.Component + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Component](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListComponents takes context, dateField, startDate, endDate, startDatetime, endDatetime, includeArchived, page, perPage, filterIds, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.ComponentResponse data and -// an error if there was an issue with the request or response. +// ListComponents takes context, dateField, startDate, endDate, startDatetime, endDatetime, includeArchived, page, perPage, filterIds, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.ComponentResponse data and +// an error if there was an issue with the request or response. // This request will return a list of components for a site. func (c *ComponentsController) ListComponents( - ctx context.Context, - dateField *models.BasicDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string, - includeArchived *bool, - page *int, - perPage *int, - filterIds []string, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.ComponentResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/components.json") - req.Authenticate(true) - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if includeArchived != nil { - req.QueryParam("include_archived", *includeArchived) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - var result []models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + dateField *models.BasicDateField, + startDate *string, + endDate *string, + startDatetime *string, + endDatetime *string, + includeArchived *bool, + page *int, + perPage *int, + filterIds []string, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.ComponentResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/components.json") + req.Authenticate(true) + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if includeArchived != nil { + req.QueryParam("include_archived", *includeArchived) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + var result []models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateComponent takes context, componentId, body as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// This request will update a component. +// UpdateComponent takes context, componentId, body as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// This request will update 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:`. func (c *ComponentsController) UpdateComponent( - ctx context.Context, - componentId string, - body *models.UpdateComponentRequest) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v.json", componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId string, + body *models.UpdateComponentRequest) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v.json", componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateDefaultPricePointForComponent takes context, componentId, pricePointId as parameters and -// returns an models.ApiResponse with models.ComponentResponse data and -// an error if there was an issue with the request or response. -// Sets a new default price point for the component. This new default will apply to all new subscriptions going forward - existing subscriptions will remain on their current price point. -// See [Price Points Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-points) for more information on price points and moving subscriptions between price points. +// PromoteComponentPricePointToDefault takes context, componentId, pricePointId as parameters and +// returns an models.ApiResponse with models.ComponentResponse data and +// an error if there was an issue with the request or response. +// Sets a new default price point for the component. This new default will apply to all new subscriptions going forward - existing subscriptions will remain on their current price point. +// See [Price Points Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-points) for more information on price points and moving subscriptions between price points. // Note: Custom price points are not able to be set as the default for a component. -func (c *ComponentsController) UpdateDefaultPricePointForComponent( - ctx context.Context, - componentId int, - pricePointId int) ( - models.ApiResponse[models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v/price_points/%v/default.json", componentId, pricePointId), - ) - req.Authenticate(true) - - var result models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *ComponentsController) PromoteComponentPricePointToDefault( + ctx context.Context, + componentId int, + pricePointId int) ( + models.ApiResponse[models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v/price_points/%v/default.json", componentId, pricePointId), + ) + req.Authenticate(true) + + var result models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListComponentsForProductFamily takes context, productFamilyId, includeArchived, filterIds, page, perPage, dateField, endDate, endDatetime, startDate, startDatetime, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.ComponentResponse data and -// an error if there was an issue with the request or response. +// ListComponentsForProductFamily takes context, productFamilyId, includeArchived, filterIds, page, perPage, dateField, endDate, endDatetime, startDate, startDatetime, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.ComponentResponse data and +// an error if there was an issue with the request or response. // This request will return a list of components for a particular product family. func (c *ComponentsController) ListComponentsForProductFamily( - ctx context.Context, - productFamilyId int, - includeArchived *bool, - filterIds []int, - page *int, - perPage *int, - dateField *models.BasicDateField, - endDate *string, - endDatetime *string, - startDate *string, - startDatetime *string, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.ComponentResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/components.json", productFamilyId), - ) - req.Authenticate(true) - if includeArchived != nil { - req.QueryParam("include_archived", *includeArchived) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - - var result []models.ComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + includeArchived *bool, + filterIds []int, + page *int, + perPage *int, + dateField *models.BasicDateField, + endDate *string, + endDatetime *string, + startDate *string, + startDatetime *string, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.ComponentResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/components.json", productFamilyId), + ) + req.Authenticate(true) + if includeArchived != nil { + req.QueryParam("include_archived", *includeArchived) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + + var result []models.ComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateComponentPricePoint takes context, componentId, body as parameters and -// returns an models.ApiResponse with models.ComponentPricePointResponse data and -// an error if there was an issue with the request or response. +// CreateComponentPricePoint takes context, componentId, body as parameters and +// returns an models.ApiResponse with models.ComponentPricePointResponse data and +// an error if there was an issue with the request or response. // This endpoint can be used to create a new price point for an existing component. func (c *ComponentsController) CreateComponentPricePoint( - ctx context.Context, - componentId int, - body *models.CreateComponentPricePointRequest) ( - models.ApiResponse[models.ComponentPricePointResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/components/%v/price_points.json", componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId int, + body *models.CreateComponentPricePointRequest) ( + models.ApiResponse[models.ComponentPricePointResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/components/%v/price_points.json", componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListComponentPricePoints takes context, componentId, currencyPrices, page, perPage, filterType as parameters and -// returns an models.ApiResponse with models.ComponentPricePointsResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to read current price points that are 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. +// ListComponentPricePoints takes context, componentId, currencyPrices, page, perPage, filterType as parameters and +// returns an models.ApiResponse with models.ComponentPricePointsResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to read current price points that are 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. func (c *ComponentsController) ListComponentPricePoints( - ctx context.Context, - componentId int, - currencyPrices *bool, - page *int, - perPage *int, - filterType []models.PricePointType) ( - models.ApiResponse[models.ComponentPricePointsResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/components/%v/price_points.json", componentId), - ) - req.Authenticate(true) - if currencyPrices != nil { - req.QueryParam("currency_prices", *currencyPrices) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterType != nil { - req.QueryParam("filter[type]", filterType) - } - - var result models.ComponentPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId int, + currencyPrices *bool, + page *int, + perPage *int, + filterType []models.PricePointType) ( + models.ApiResponse[models.ComponentPricePointsResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/components/%v/price_points.json", componentId), + ) + req.Authenticate(true) + if currencyPrices != nil { + req.QueryParam("currency_prices", *currencyPrices) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterType != nil { + req.QueryParam("filter[type]", filterType) + } + + var result models.ComponentPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateComponentPricePoints takes context, componentId, body as parameters and -// returns an models.ApiResponse with models.ComponentPricePointsResponse data and -// an error if there was an issue with the request or response. +// BulkCreateComponentPricePoints takes context, componentId, body as parameters and +// returns an models.ApiResponse with models.ComponentPricePointsResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to create multiple component price points in one request. -func (c *ComponentsController) CreateComponentPricePoints( - ctx context.Context, - componentId string, - body *models.CreateComponentPricePointsRequest) ( - models.ApiResponse[models.ComponentPricePointsResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/components/%v/price_points/bulk.json", componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *ComponentsController) BulkCreateComponentPricePoints( + ctx context.Context, + componentId string, + body *models.CreateComponentPricePointsRequest) ( + models.ApiResponse[models.ComponentPricePointsResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/components/%v/price_points/bulk.json", componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateComponentPricePoint takes context, componentId, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ComponentPricePointResponse data and -// an error if there was an issue with the request or response. -// When updating a price point, it's prices can be updated as well by creating new prices or editing / removing existing ones. -// Passing in a price bracket without an `id` will attempt to create a new price. -// Including an `id` will update the corresponding price, and including the `_destroy` flag set to true along with the `id` will remove that price. +// UpdateComponentPricePoint takes context, componentId, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ComponentPricePointResponse data and +// an error if there was an issue with the request or response. +// When updating a price point, it's prices can be updated as well by creating new prices or editing / removing existing ones. +// Passing in a price bracket without an `id` will attempt to create a new price. +// Including an `id` will update the corresponding price, and including the `_destroy` flag set to true along with the `id` will remove that price. // Note: Custom price points cannot be updated directly. They must be edited through the Subscription. func (c *ComponentsController) UpdateComponentPricePoint( - ctx context.Context, - componentId int, - pricePointId int, - body *models.UpdateComponentPricePointRequest) ( - models.ApiResponse[models.ComponentPricePointResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v/price_points/%v.json", componentId, pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId int, + pricePointId int, + body *models.UpdateComponentPricePointRequest) ( + models.ApiResponse[models.ComponentPricePointResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v/price_points/%v.json", componentId, pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ArchiveComponentPricePoint takes context, componentId, pricePointId as parameters and -// returns an models.ApiResponse with models.ComponentPricePointResponse data and -// an error if there was an issue with the request or response. +// ArchiveComponentPricePoint takes context, componentId, pricePointId as parameters and +// returns an models.ApiResponse with models.ComponentPricePointResponse data and +// an error if there was an issue with the request or response. // A price point can be archived at any time. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point. func (c *ComponentsController) ArchiveComponentPricePoint( - ctx context.Context, - componentId int, - pricePointId int) ( - models.ApiResponse[models.ComponentPricePointResponse], - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/components/%v/price_points/%v.json", componentId, pricePointId), - ) - req.Authenticate(true) - - var result models.ComponentPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId int, + pricePointId int) ( + models.ApiResponse[models.ComponentPricePointResponse], + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/components/%v/price_points/%v.json", componentId, pricePointId), + ) + req.Authenticate(true) + + var result models.ComponentPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UnarchiveComponentPricePoint takes context, componentId, pricePointId as parameters and -// returns an models.ApiResponse with models.ComponentPricePointResponse data and -// an error if there was an issue with the request or response. +// UnarchiveComponentPricePoint takes context, componentId, pricePointId as parameters and +// returns an models.ApiResponse with models.ComponentPricePointResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to unarchive a component price point. func (c *ComponentsController) UnarchiveComponentPricePoint( - ctx context.Context, - componentId int, - pricePointId int) ( - models.ApiResponse[models.ComponentPricePointResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v/price_points/%v/unarchive.json", componentId, pricePointId), - ) - req.Authenticate(true) - - var result models.ComponentPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId int, + pricePointId int) ( + models.ApiResponse[models.ComponentPricePointResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v/price_points/%v/unarchive.json", componentId, pricePointId), + ) + req.Authenticate(true) + + var result models.ComponentPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateCurrencyPrices takes context, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ComponentCurrencyPricesResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. -// When creating currency prices, they need to mirror the structure of your primary pricing. For each price level defined on the component price point, there should be a matching price level created in the given currency. +// CreateCurrencyPrices takes context, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ComponentCurrencyPricesResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. +// When creating currency prices, they need to mirror the structure of your primary pricing. For each price level defined on the component price point, there should be a matching price level created in the given currency. // Note: Currency Prices are not able to be created for custom price points. func (c *ComponentsController) CreateCurrencyPrices( - ctx context.Context, - pricePointId int, - body *models.CreateCurrencyPricesRequest) ( - models.ApiResponse[models.ComponentCurrencyPricesResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/price_points/%v/currency_prices.json", pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentCurrencyPricesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentCurrencyPricesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + pricePointId int, + body *models.CreateCurrencyPricesRequest) ( + models.ApiResponse[models.ComponentCurrencyPricesResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/price_points/%v/currency_prices.json", pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentCurrencyPricesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentCurrencyPricesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateCurrencyPrices takes context, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ComponentCurrencyPricesResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to update currency prices for a given currency that has been defined on the site level in your settings. +// UpdateCurrencyPrices takes context, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ComponentCurrencyPricesResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to update currency prices for a given currency that has been defined on the site level in your settings. // Note: Currency Prices are not able to be updated for custom price points. func (c *ComponentsController) UpdateCurrencyPrices( - ctx context.Context, - pricePointId int, - body *models.UpdateCurrencyPricesRequest) ( - models.ApiResponse[models.ComponentCurrencyPricesResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/price_points/%v/currency_prices.json", pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ComponentCurrencyPricesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ComponentCurrencyPricesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + pricePointId int, + body *models.UpdateCurrencyPricesRequest) ( + models.ApiResponse[models.ComponentCurrencyPricesResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/price_points/%v/currency_prices.json", pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ComponentCurrencyPricesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ComponentCurrencyPricesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListAllComponentPricePoints takes context, filterDateField, filterEndDate, filterEndDatetime, include, page, perPage, filterStartDate, filterStartDatetime, filterType, direction, filterIds, filterArchivedAt as parameters and -// returns an models.ApiResponse with models.ListComponentsPricePointsResponse data and -// an error if there was an issue with the request or response. +// ListAllComponentPricePoints takes context, filterDateField, filterEndDate, filterEndDatetime, include, page, perPage, filterStartDate, filterStartDatetime, filterType, direction, filterIds, filterArchivedAt as parameters and +// returns an models.ApiResponse with models.ListComponentsPricePointsResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve a list of Components Price Points belonging to a Site. func (c *ComponentsController) ListAllComponentPricePoints( - ctx context.Context, - filterDateField *models.BasicDateField, - filterEndDate *time.Time, - filterEndDatetime *time.Time, - include *models.ListComponentsPricePointsInclude, - page *int, - perPage *int, - filterStartDate *time.Time, - filterStartDatetime *time.Time, - filterType []models.PricePointType, - direction *models.SortingDirection, - filterIds []int, - filterArchivedAt *models.IncludeNotNull) ( - models.ApiResponse[models.ListComponentsPricePointsResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/components_price_points.json") - req.Authenticate(true) - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - if filterEndDatetime != nil { - req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) - } - if include != nil { - req.QueryParam("include", *include) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if filterStartDatetime != nil { - req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) - } - if filterType != nil { - req.QueryParam("filter[type]", filterType) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if filterArchivedAt != nil { - req.QueryParam("filter[archived_at]", *filterArchivedAt) - } - var result models.ListComponentsPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListComponentsPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + filterDateField *models.BasicDateField, + filterEndDate *time.Time, + filterEndDatetime *time.Time, + include *models.ListComponentsPricePointsInclude, + page *int, + perPage *int, + filterStartDate *time.Time, + filterStartDatetime *time.Time, + filterType []models.PricePointType, + direction *models.SortingDirection, + filterIds []int, + filterArchivedAt *models.IncludeNotNull) ( + models.ApiResponse[models.ListComponentsPricePointsResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/components_price_points.json") + req.Authenticate(true) + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + if filterEndDatetime != nil { + req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) + } + if include != nil { + req.QueryParam("include", *include) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if filterStartDatetime != nil { + req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) + } + if filterType != nil { + req.QueryParam("filter[type]", filterType) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if filterArchivedAt != nil { + req.QueryParam("filter[archived_at]", *filterArchivedAt) + } + var result models.ListComponentsPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListComponentsPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/configuration.go b/configuration.go index 8b019d65..4bb00b95 100644 --- a/configuration.go +++ b/configuration.go @@ -1,7 +1,7 @@ package advancedbilling import ( - "os" + "os" ) // ConfigurationOptions represents a function type that can be used to apply options to the Configuration struct. @@ -9,168 +9,168 @@ type ConfigurationOptions func(*Configuration) // Configuration holds configuration settings. type Configuration struct { - environment Environment - subdomain string - domain string - httpConfiguration HttpConfiguration - basicAuthUserName string - basicAuthPassword string + environment Environment + subdomain string + domain string + httpConfiguration HttpConfiguration + basicAuthUserName string + basicAuthPassword string } // newConfiguration creates a new Configuration with the provided options. func newConfiguration(options ...ConfigurationOptions) Configuration { - config := Configuration{} - - for _, option := range options { - option(&config) - } - return config + config := Configuration{} + + for _, option := range options { + option(&config) + } + return config } // WithEnvironment is an option that sets the Environment in the Configuration. func WithEnvironment(environment Environment) ConfigurationOptions { - return func(c *Configuration) { - c.environment = environment - } + return func(c *Configuration) { + c.environment = environment + } } // WithSubdomain is an option that sets the Subdomain in the Configuration. func WithSubdomain(subdomain string) ConfigurationOptions { - return func(c *Configuration) { - c.subdomain = subdomain - } + return func(c *Configuration) { + c.subdomain = subdomain + } } // WithDomain is an option that sets the Domain in the Configuration. func WithDomain(domain string) ConfigurationOptions { - return func(c *Configuration) { - c.domain = domain - } + return func(c *Configuration) { + c.domain = domain + } } // WithHttpConfiguration is an option that sets the HttpConfiguration in the Configuration. func WithHttpConfiguration(httpConfiguration HttpConfiguration) ConfigurationOptions { - return func(c *Configuration) { - c.httpConfiguration = httpConfiguration - } + return func(c *Configuration) { + c.httpConfiguration = httpConfiguration + } } // WithBasicAuthUserName is an option that sets the BasicAuthUserName in the Configuration. func WithBasicAuthUserName(basicAuthUserName string) ConfigurationOptions { - return func(c *Configuration) { - c.basicAuthUserName = basicAuthUserName - } + return func(c *Configuration) { + c.basicAuthUserName = basicAuthUserName + } } // WithBasicAuthPassword is an option that sets the BasicAuthPassword in the Configuration. func WithBasicAuthPassword(basicAuthPassword string) ConfigurationOptions { - return func(c *Configuration) { - c.basicAuthPassword = basicAuthPassword - } + return func(c *Configuration) { + c.basicAuthPassword = basicAuthPassword + } } // Environment returns the Environment from the Configuration. func (c *Configuration) Environment() Environment { - return c.environment + return c.environment } // Subdomain returns the Subdomain from the Configuration. func (c *Configuration) Subdomain() string { - return c.subdomain + return c.subdomain } // Domain returns the Domain from the Configuration. func (c *Configuration) Domain() string { - return c.domain + return c.domain } // HttpConfiguration returns the HttpConfiguration from the Configuration. func (c *Configuration) HttpConfiguration() HttpConfiguration { - return c.httpConfiguration + return c.httpConfiguration } // BasicAuthUserName returns the BasicAuthUserName from the Configuration. func (c *Configuration) BasicAuthUserName() string { - return c.basicAuthUserName + return c.basicAuthUserName } // BasicAuthPassword returns the BasicAuthPassword from the Configuration. func (c *Configuration) BasicAuthPassword() string { - return c.basicAuthPassword + return c.basicAuthPassword } -// CreateConfigurationFromEnvironment creates a new Configuration with default settings. +// CreateConfigurationFromEnvironment creates a new Configuration with default settings. // It also configures various Configuration options. func CreateConfigurationFromEnvironment(options ...ConfigurationOptions) Configuration { - config := DefaultConfiguration() - - environment := os.Getenv("ADVANCEDBILLING_ENVIRONMENT") - if environment != "" { - config.environment = Environment(environment) - } - subdomain := os.Getenv("ADVANCEDBILLING_SUBDOMAIN") - if subdomain != "" { - config.subdomain = subdomain - } - domain := os.Getenv("ADVANCEDBILLING_DOMAIN") - if domain != "" { - config.domain = domain - } - basicAuthUserName := os.Getenv("ADVANCEDBILLING_BASIC_AUTH_USER_NAME") - if basicAuthUserName != "" { - config.basicAuthUserName = basicAuthUserName - } - basicAuthPassword := os.Getenv("ADVANCEDBILLING_BASIC_AUTH_PASSWORD") - if basicAuthPassword != "" { - config.basicAuthPassword = basicAuthPassword - } - for _, option := range options { - option(&config) - } - return config + config := DefaultConfiguration() + + environment := os.Getenv("ADVANCEDBILLING_ENVIRONMENT") + if environment != "" { + config.environment = Environment(environment) + } + subdomain := os.Getenv("ADVANCEDBILLING_SUBDOMAIN") + if subdomain != "" { + config.subdomain = subdomain + } + domain := os.Getenv("ADVANCEDBILLING_DOMAIN") + if domain != "" { + config.domain = domain + } + basicAuthUserName := os.Getenv("ADVANCEDBILLING_BASIC_AUTH_USER_NAME") + if basicAuthUserName != "" { + config.basicAuthUserName = basicAuthUserName + } + basicAuthPassword := os.Getenv("ADVANCEDBILLING_BASIC_AUTH_PASSWORD") + if basicAuthPassword != "" { + config.basicAuthPassword = basicAuthPassword + } + for _, option := range options { + option(&config) + } + return config } // Server represents available servers. type Server string const ( - ENUMDEFAULT Server = "default" + ENUMDEFAULT Server = "default" ) // Environment represents available environments. type Environment string const ( - PRODUCTION Environment = "production" - ENVIRONMENT2 Environment = "environment2" + PRODUCTION Environment = "production" + ENVIRONMENT2 Environment = "environment2" ) // CreateRetryConfiguration creates a new RetryConfiguration with the provided options. func CreateRetryConfiguration(options ...RetryConfigurationOptions) RetryConfiguration { - config := DefaultRetryConfiguration() - - for _, option := range options { - option(&config) - } - return config + config := DefaultRetryConfiguration() + + for _, option := range options { + option(&config) + } + return config } // CreateHttpConfiguration creates a new HttpConfiguration with the provided options. func CreateHttpConfiguration(options ...HttpConfigurationOptions) HttpConfiguration { - config := DefaultHttpConfiguration() - - for _, option := range options { - option(&config) - } - return config + config := DefaultHttpConfiguration() + + for _, option := range options { + option(&config) + } + return config } // CreateConfiguration creates a new Configuration with the provided options. func CreateConfiguration(options ...ConfigurationOptions) Configuration { - config := DefaultConfiguration() - - for _, option := range options { - option(&config) - } - return config + config := DefaultConfiguration() + + for _, option := range options { + option(&config) + } + return config } diff --git a/coupons_controller.go b/coupons_controller.go index 176598da..f408b631 100644 --- a/coupons_controller.go +++ b/coupons_controller.go @@ -1,719 +1,719 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" + "time" ) // CouponsController represents a controller struct. type CouponsController struct { - baseController + baseController } -// NewCouponsController creates a new instance of CouponsController. +// NewCouponsController creates a new instance of CouponsController. // It takes a baseController as a parameter and returns a pointer to the CouponsController. func NewCouponsController(baseController baseController) *CouponsController { - couponsController := CouponsController{baseController: baseController} - return &couponsController + couponsController := CouponsController{baseController: baseController} + return &couponsController } -// CreateCoupon takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// ## Coupons Documentation -// Coupons can be administered in the Chargify application or created via API. Please view our section on [creating coupons](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404742830733) for more information. -// Additionally, for documentation on how to apply a coupon to a subscription within the Chargify UI, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404761012877). -// ## Create Coupon -// This request will create a coupon, based on the provided information. -// When creating a coupon, you must specify a product family using the `product_family_id`. If no `product_family_id` is passed, the first product family available is used. You will also need to formulate your URL to cite the Product Family ID in your request. -// 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: +// CreateCoupon takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// ## Coupons Documentation +// Coupons can be administered in the Chargify application or created via API. Please view our section on [creating coupons](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404742830733) for more information. +// Additionally, for documentation on how to apply a coupon to a subscription within the Chargify UI, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404761012877). +// ## Create Coupon +// This request will create a coupon, based on the provided information. +// When creating a coupon, you must specify a product family using the `product_family_id`. If no `product_family_id` is passed, the first product family available is used. You will also need to formulate your URL to cite the Product Family ID in your request. +// 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 }` func (c *CouponsController) CreateCoupon( - ctx context.Context, - productFamilyId int, - body *models.CreateOrUpdateCoupon) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/coupons.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateOrUpdateCoupon) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/coupons.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListCouponsForProductFamily takes context, productFamilyId, page, perPage, filterDateField, filterEndDate, filterEndDatetime, filterStartDate, filterStartDatetime, filterIds, filterCodes, currencyPrices, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.CouponResponse data and -// an error if there was an issue with the request or response. -// List coupons for a specific Product Family in a Site. +// ListCouponsForProductFamily takes context, productFamilyId, page, perPage, filterDateField, filterEndDate, filterEndDatetime, filterStartDate, filterStartDatetime, filterIds, filterCodes, currencyPrices, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.CouponResponse data and +// an error if there was an issue with the request or response. +// List coupons for a specific Product Family in a Site. // 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. func (c *CouponsController) ListCouponsForProductFamily( - ctx context.Context, - productFamilyId int, - page *int, - perPage *int, - filterDateField *models.BasicDateField, - filterEndDate *time.Time, - filterEndDatetime *time.Time, - filterStartDate *time.Time, - filterStartDatetime *time.Time, - filterIds []int, - filterCodes []string, - currencyPrices *bool, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.CouponResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/coupons.json", productFamilyId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - if filterEndDatetime != nil { - req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if filterStartDatetime != nil { - req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if filterCodes != nil { - req.QueryParam("filter[codes]", filterCodes) - } - if currencyPrices != nil { - req.QueryParam("currency_prices", *currencyPrices) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - - var result []models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + page *int, + perPage *int, + filterDateField *models.BasicDateField, + filterEndDate *time.Time, + filterEndDatetime *time.Time, + filterStartDate *time.Time, + filterStartDatetime *time.Time, + filterIds []int, + filterCodes []string, + currencyPrices *bool, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.CouponResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/coupons.json", productFamilyId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + if filterEndDatetime != nil { + req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if filterStartDatetime != nil { + req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if filterCodes != nil { + req.QueryParam("filter[codes]", filterCodes) + } + if currencyPrices != nil { + req.QueryParam("currency_prices", *currencyPrices) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + + var result []models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadCouponByCode takes context, productFamilyId, code as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// You can search for a coupon via the API with the find method. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If no coupon is found, a 404 is returned. +// FindCoupon takes context, productFamilyId, code as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// You can search for a coupon via the API with the find method. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If no coupon is found, a 404 is returned. // 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. -func (c *CouponsController) ReadCouponByCode( - ctx context.Context, - productFamilyId *int, - code *string) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/coupons/find.json") - req.Authenticate(true) - if productFamilyId != nil { - req.QueryParam("product_family_id", *productFamilyId) - } - if code != nil { - req.QueryParam("code", *code) - } - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *CouponsController) FindCoupon( + ctx context.Context, + productFamilyId *int, + code *string) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/coupons/find.json") + req.Authenticate(true) + if productFamilyId != nil { + req.QueryParam("product_family_id", *productFamilyId) + } + if code != nil { + req.QueryParam("code", *code) + } + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadCoupon takes context, productFamilyId, couponId as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// You can retrieve the Coupon via the API with the Show method. You must identify the Coupon in this call by the ID parameter that Chargify 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. +// ReadCoupon takes context, productFamilyId, couponId as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// You can retrieve the Coupon via the API with the Show method. You must identify the Coupon in this call by the ID parameter that Chargify 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. func (c *CouponsController) ReadCoupon( - ctx context.Context, - productFamilyId int, - couponId int) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), - ) - req.Authenticate(true) - - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + couponId int) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), + ) + req.Authenticate(true) + + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateCoupon takes context, productFamilyId, couponId, body as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// ## Update Coupon -// You can update a Coupon via the API with a PUT request to the resource endpoint. -// 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: +// UpdateCoupon takes context, productFamilyId, couponId, body as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// ## Update Coupon +// You can update a Coupon via the API with a PUT request to the resource endpoint. +// 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 }` func (c *CouponsController) UpdateCoupon( - ctx context.Context, - productFamilyId int, - couponId int, - body *models.CreateOrUpdateCoupon) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + couponId int, + body *models.CreateOrUpdateCoupon) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ArchiveCoupon takes context, productFamilyId, couponId as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// You can archive a Coupon via the API with the archive method. -// Archiving makes that Coupon unavailable for future use, but allows it to remain attached and functional on existing Subscriptions that are using it. +// ArchiveCoupon takes context, productFamilyId, couponId as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// You can archive a Coupon via the API with the archive method. +// 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. func (c *CouponsController) ArchiveCoupon( - ctx context.Context, - productFamilyId int, - couponId int) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), - ) - req.Authenticate(true) - - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + couponId int) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/product_families/%v/coupons/%v.json", productFamilyId, couponId), + ) + req.Authenticate(true) + + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListCoupons takes context, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, filterIds, filterCodes, currencyPrices, filterEndDate, filterEndDatetime, filterStartDate, filterStartDatetime, filterDateField, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.CouponResponse data and -// an error if there was an issue with the request or response. -// You can retrieve a list of coupons. +// ListCoupons takes context, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, filterIds, filterCodes, currencyPrices, filterEndDate, filterEndDatetime, filterStartDate, filterStartDatetime, filterDateField, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.CouponResponse data and +// an error if there was an issue with the request or response. +// You can retrieve a list of coupons. // 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. func (c *CouponsController) ListCoupons( - ctx context.Context, - page *int, - perPage *int, - dateField *models.BasicDateField, - startDate *time.Time, - endDate *time.Time, - startDatetime *time.Time, - endDatetime *time.Time, - filterIds []int, - filterCodes []string, - currencyPrices *bool, - filterEndDate *time.Time, - filterEndDatetime *time.Time, - filterStartDate *time.Time, - filterStartDatetime *time.Time, - filterDateField *models.BasicDateField, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.CouponResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/coupons.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) - } - if endDate != nil { - req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) - } - if startDatetime != nil { - req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) - } - if endDatetime != nil { - req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if filterCodes != nil { - req.QueryParam("filter[codes]", filterCodes) - } - if currencyPrices != nil { - req.QueryParam("currency_prices", *currencyPrices) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - if filterEndDatetime != nil { - req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if filterStartDatetime != nil { - req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) - } - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - var result []models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + dateField *models.BasicDateField, + startDate *time.Time, + endDate *time.Time, + startDatetime *time.Time, + endDatetime *time.Time, + filterIds []int, + filterCodes []string, + currencyPrices *bool, + filterEndDate *time.Time, + filterEndDatetime *time.Time, + filterStartDate *time.Time, + filterStartDatetime *time.Time, + filterDateField *models.BasicDateField, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.CouponResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/coupons.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) + } + if endDate != nil { + req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) + } + if startDatetime != nil { + req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) + } + if endDatetime != nil { + req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if filterCodes != nil { + req.QueryParam("filter[codes]", filterCodes) + } + if currencyPrices != nil { + req.QueryParam("currency_prices", *currencyPrices) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + if filterEndDatetime != nil { + req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if filterStartDatetime != nil { + req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) + } + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + var result []models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadCouponUsage takes context, productFamilyId, couponId as parameters and -// returns an models.ApiResponse with []models.CouponUsage data and -// an error if there was an issue with the request or response. +// ReadCouponUsage takes context, productFamilyId, couponId as parameters and +// returns an models.ApiResponse with []models.CouponUsage data and +// an error if there was an issue with the request or response. // This request will provide details about the coupon usage as an array of data hashes, one per product. func (c *CouponsController) ReadCouponUsage( - ctx context.Context, - productFamilyId int, - couponId int) ( - models.ApiResponse[[]models.CouponUsage], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/coupons/%v/usage.json", productFamilyId, couponId), - ) - req.Authenticate(true) - - var result []models.CouponUsage - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.CouponUsage](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + couponId int) ( + models.ApiResponse[[]models.CouponUsage], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/coupons/%v/usage.json", productFamilyId, couponId), + ) + req.Authenticate(true) + + var result []models.CouponUsage + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.CouponUsage](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ValidateCoupon takes context, code, productFamilyId as parameters and -// returns an models.ApiResponse with models.CouponResponse data and -// an error if there was an issue with the request or response. -// You can verify if a specific coupon code is valid using the `validate` method. 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 -// 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. -// ``` -// https://.chargify.com/product_families/handle:/coupons/validate.?code= -// ``` -// Or: -// ``` -// https://.chargify.com/coupons/validate.?code=&product_family_id= +// ValidateCoupon takes context, code, productFamilyId as parameters and +// returns an models.ApiResponse with models.CouponResponse data and +// an error if there was an issue with the request or response. +// You can verify if a specific coupon code is valid using the `validate` method. 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 +// 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. +// ``` +// https://.chargify.com/product_families/handle:/coupons/validate.?code= +// ``` +// Or: +// ``` +// https://.chargify.com/coupons/validate.?code=&product_family_id= // ``` func (c *CouponsController) ValidateCoupon( - ctx context.Context, - code string, - productFamilyId *int) ( - models.ApiResponse[models.CouponResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/coupons/validate.json") - req.Authenticate(true) - req.QueryParam("code", code) - if productFamilyId != nil { - req.QueryParam("product_family_id", *productFamilyId) - } - var result models.CouponResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewSingleStringErrorResponse(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + code string, + productFamilyId *int) ( + models.ApiResponse[models.CouponResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/coupons/validate.json") + req.Authenticate(true) + req.QueryParam("code", code) + if productFamilyId != nil { + req.QueryParam("product_family_id", *productFamilyId) + } + var result models.CouponResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewSingleStringErrorResponse(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// UpdateCouponCurrencyPrices takes context, couponId, body as parameters and -// returns an models.ApiResponse with models.CouponCurrencyResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to create and/or update 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 an amount-based coupon, not percentage. +// CreateOrUpdateCouponCurrencyPrices takes context, couponId, body as parameters and +// returns an models.ApiResponse with models.CouponCurrencyResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to create and/or update 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 an amount-based coupon, not percentage. // 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. -func (c *CouponsController) UpdateCouponCurrencyPrices( - ctx context.Context, - couponId int, - body *models.CouponCurrencyRequest) ( - models.ApiResponse[models.CouponCurrencyResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/coupons/%v/currency_prices.json", couponId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CouponCurrencyResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponCurrencyResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (c *CouponsController) CreateOrUpdateCouponCurrencyPrices( + ctx context.Context, + couponId int, + body *models.CouponCurrencyRequest) ( + models.ApiResponse[models.CouponCurrencyResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/coupons/%v/currency_prices.json", couponId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CouponCurrencyResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponCurrencyResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateCouponSubcodes takes context, couponId, body as parameters and -// returns an models.ApiResponse with models.CouponSubcodesResponse data and -// an error if there was an issue with the request or response. -// ## 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: -// Master Coupon Code: -// + SPRING2020 -// Coupon Subcodes: -// + 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#coupon-codes). -// Additionally, for documentation on how to apply a coupon to a Subscription within the Chargify UI, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#coupon). -// ## 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. -// % to %25 -// @ to %40 -// + to %2B -// - to %2D -// _ to %5F -// . to %2E +// CreateCouponSubcodes takes context, couponId, body as parameters and +// returns an models.ApiResponse with models.CouponSubcodesResponse data and +// an error if there was an issue with the request or response. +// ## 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: +// Master Coupon Code: +// + SPRING2020 +// Coupon Subcodes: +// + 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#coupon-codes). +// Additionally, for documentation on how to apply a coupon to a Subscription within the Chargify UI, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#coupon). +// ## 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. +// % to %25 +// @ to %40 +// + to %2B +// - to %2D +// _ 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.` func (c *CouponsController) CreateCouponSubcodes( - ctx context.Context, - couponId int, - body *models.CouponSubcodes) ( - models.ApiResponse[models.CouponSubcodesResponse], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/coupons/%v/codes.json", couponId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CouponSubcodesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponSubcodesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + couponId int, + body *models.CouponSubcodes) ( + models.ApiResponse[models.CouponSubcodesResponse], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/coupons/%v/codes.json", couponId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CouponSubcodesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponSubcodesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListCouponSubcodes takes context, couponId, page, perPage as parameters and -// returns an models.ApiResponse with models.CouponSubcodes data and -// an error if there was an issue with the request or response. +// ListCouponSubcodes takes context, couponId, page, perPage as parameters and +// returns an models.ApiResponse with models.CouponSubcodes data and +// an error if there was an issue with the request or response. // This request allows you to request the subcodes that are attached to a coupon. func (c *CouponsController) ListCouponSubcodes( - ctx context.Context, - couponId int, - page *int, - perPage *int) ( - models.ApiResponse[models.CouponSubcodes], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/coupons/%v/codes.json", couponId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result models.CouponSubcodes - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponSubcodes](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + couponId int, + page *int, + perPage *int) ( + models.ApiResponse[models.CouponSubcodes], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/coupons/%v/codes.json", couponId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result models.CouponSubcodes + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponSubcodes](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateCouponSubcodes takes context, couponId, body as parameters and -// returns an models.ApiResponse with models.CouponSubcodesResponse data and -// an error if there was an issue with the request or response. -// You can update the subcodes for the given Coupon via the API with a PUT request to the resource endpoint. -// Send an array of new coupon subcodes. -// **Note**: All current subcodes for that Coupon will be deleted first, and replaced with the list of subcodes sent to this endpoint. -// The response will contain: -// + The created subcodes, -// + Subcodes that were not created because they already exist, +// UpdateCouponSubcodes takes context, couponId, body as parameters and +// returns an models.ApiResponse with models.CouponSubcodesResponse data and +// an error if there was an issue with the request or response. +// You can update the subcodes for the given Coupon via the API with a PUT request to the resource endpoint. +// Send an array of new coupon subcodes. +// **Note**: All current subcodes for that Coupon will be deleted first, and replaced with the list of subcodes sent to this endpoint. +// The response will contain: +// + The created subcodes, +// + Subcodes that were not created because they already exist, // + Any subcodes not created because they are invalid. func (c *CouponsController) UpdateCouponSubcodes( - ctx context.Context, - couponId int, - body *models.CouponSubcodes) ( - models.ApiResponse[models.CouponSubcodesResponse], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/coupons/%v/codes.json", couponId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CouponSubcodesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CouponSubcodesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + couponId int, + body *models.CouponSubcodes) ( + models.ApiResponse[models.CouponSubcodesResponse], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/coupons/%v/codes.json", couponId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CouponSubcodesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CouponSubcodesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// DeleteCouponSubcode takes context, couponId, subcode as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// ## Example -// Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to `DELETE` this coupon subcode would be: -// ``` -// http://subdomain.chargify.com/coupons/567/codes/20OFF. -// ``` -// Note: If you are using any of the allowed special characters (“%”, “@”, “+”, “-”, “_”, and “.”), you must encode them for use in the URL. -// | Special character | Encoding | -// |-------------------|----------| -// | % | %25 | -// | @ | %40 | -// | + | %2B | -// | – | %2D | -// | _ | %5F | -// | . | %2E | -// ## Percent Encoding Example +// DeleteCouponSubcode takes context, couponId, subcode as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// ## Example +// Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to `DELETE` this coupon subcode would be: +// ``` +// http://subdomain.chargify.com/coupons/567/codes/20OFF. +// ``` +// Note: If you are using any of the allowed special characters (“%”, “@”, “+”, “-”, “_”, and “.”), you must encode them for use in the URL. +// | Special character | Encoding | +// |-------------------|----------| +// | % | %25 | +// | @ | %40 | +// | + | %2B | +// | – | %2D | +// | _ | %5F | +// | . | %2E | +// ## 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. func (c *CouponsController) DeleteCouponSubcode( - ctx context.Context, - couponId int, - subcode string) ( - *http.Response, - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/coupons/%v/codes/%v.json", couponId, subcode), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return context.Response, err + ctx context.Context, + couponId int, + subcode string) ( + *http.Response, + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/coupons/%v/codes/%v.json", couponId, subcode), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return context.Response, err } diff --git a/custom_fields_controller.go b/custom_fields_controller.go index 13627e81..cd6141d9 100644 --- a/custom_fields_controller.go +++ b/custom_fields_controller.go @@ -1,471 +1,478 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" + "time" ) // CustomFieldsController represents a controller struct. type CustomFieldsController struct { - baseController + baseController } -// NewCustomFieldsController creates a new instance of CustomFieldsController. +// NewCustomFieldsController creates a new instance of CustomFieldsController. // It takes a baseController as a parameter and returns a pointer to the CustomFieldsController. func NewCustomFieldsController(baseController baseController) *CustomFieldsController { - customFieldsController := CustomFieldsController{baseController: baseController} - return &customFieldsController + customFieldsController := CustomFieldsController{baseController: baseController} + return &customFieldsController } -// CreateMetafields takes context, resourceType, body as parameters and -// returns an models.ApiResponse with []models.Metafield data and -// an error if there was an issue with the request or response. -// ## Custom Fields: Metafield Intro -// **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. -// + **Metafield is the custom field** -// + **Metadata is the data populating the custom field.** -// Chargify Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405332553613-Custom-Fields-Reference). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here.](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181-Subscription-Summary#custom-fields) -// Metafield are the place where you will set up your resource to accept additional data. It is scoped to the site instead of a specific customer or subscription. Think of it as the key, and Metadata as the value on every record. -// ## Create Metafields -// Use this endpoint to create metafields for your Site. Metafields can be populated with metadata after the fact. -// Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource. This means you can have 100 Metafields for Subscription and another 100 for Customer. -// ### Metafields "On-the-Fly" -// It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existant name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. -// ### Metafield Scope Warning +// CreateMetafields takes context, resourceType, body as parameters and +// returns an models.ApiResponse with []models.Metafield data and +// an error if there was an issue with the request or response. +// ## Custom Fields: Metafield Intro +// **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. +// + **Metafield is the custom field** +// + **Metadata is the data populating the custom field.** +// Chargify Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405332553613-Custom-Fields-Reference). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here.](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181-Subscription-Summary#custom-fields) +// Metafield are the place where you will set up your resource to accept additional data. It is scoped to the site instead of a specific customer or subscription. Think of it as the key, and Metadata as the value on every record. +// ## Create Metafields +// Use this endpoint to create metafields for your Site. Metafields can be populated with metadata after the fact. +// Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource. This means you can have 100 Metafields for Subscription and another 100 for Customer. +// ### Metafields "On-the-Fly" +// It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existant name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. +// ### Metafield Scope Warning // If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields with the scope attribute – **if a partial update is sent it will overwrite the current configuration**. func (c *CustomFieldsController) CreateMetafields( - ctx context.Context, - resourceType models.ResourceType, - body *models.CreateMetafieldsRequest) ( - models.ApiResponse[[]models.Metafield], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/%v/metafields.json", resourceType), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result []models.Metafield - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Metafield](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + body *models.CreateMetafieldsRequest) ( + models.ApiResponse[[]models.Metafield], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/%v/metafields.json", resourceType), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result []models.Metafield + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Metafield](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListMetafields takes context, resourceType, name, page, perPage, direction as parameters and -// returns an models.ApiResponse with models.ListMetafieldsResponse data and -// an error if there was an issue with the request or response. +// ListMetafields takes context, resourceType, name, page, perPage, direction as parameters and +// returns an models.ApiResponse with models.ListMetafieldsResponse data and +// an error if there was an issue with the request or response. // This endpoint lists metafields associated with a site. The metafield description and usage is contained in the response. func (c *CustomFieldsController) ListMetafields( - ctx context.Context, - resourceType models.ResourceType, - name *string, - page *int, - perPage *int, - direction *models.SortingDirection) ( - models.ApiResponse[models.ListMetafieldsResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/%v/metafields.json", resourceType), - ) - req.Authenticate(true) - if name != nil { - req.QueryParam("name", *name) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - - var result models.ListMetafieldsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListMetafieldsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + name *string, + page *int, + perPage *int, + direction *models.SortingDirection) ( + models.ApiResponse[models.ListMetafieldsResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/%v/metafields.json", resourceType), + ) + req.Authenticate(true) + if name != nil { + req.QueryParam("name", *name) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + + var result models.ListMetafieldsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListMetafieldsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateMetafield takes context, resourceType, body as parameters and -// returns an models.ApiResponse with []models.Metafield data and -// an error if there was an issue with the request or response. +// UpdateMetafield takes context, resourceType, body as parameters and +// returns an models.ApiResponse with []models.Metafield data and +// an error if there was an issue with the request or response. // Use the following method to update metafields for your Site. Metafields can be populated with metadata after the fact. func (c *CustomFieldsController) UpdateMetafield( - ctx context.Context, - resourceType models.ResourceType, - body *models.UpdateMetafieldsRequest) ( - models.ApiResponse[[]models.Metafield], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/%v/metafields.json", resourceType), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result []models.Metafield - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Metafield](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + body *models.UpdateMetafieldsRequest) ( + models.ApiResponse[[]models.Metafield], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/%v/metafields.json", resourceType), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result []models.Metafield + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Metafield](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteMetafield takes context, resourceType, name as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// Use the following method to delete a metafield. This will remove the metafield from the Site. +// DeleteMetafield takes context, resourceType, name as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// Use the following method to delete a metafield. This will remove the metafield from the Site. // Additionally, this will remove the metafield and associated metadata with all Subscriptions on the Site. func (c *CustomFieldsController) DeleteMetafield( - ctx context.Context, - resourceType models.ResourceType, - name *string) ( - *http.Response, - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/%v/metafields.json", resourceType), - ) - req.Authenticate(true) - if name != nil { - req.QueryParam("name", *name) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return context.Response, err + ctx context.Context, + resourceType models.ResourceType, + name *string) ( + *http.Response, + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/%v/metafields.json", resourceType), + ) + req.Authenticate(true) + if name != nil { + req.QueryParam("name", *name) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return context.Response, err } -// CreateMetadata takes context, resourceType, resourceId, body as parameters and -// returns an models.ApiResponse with []models.Metadata data and -// an error if there was an issue with the request or response. -// ## Custom Fields: Metadata Intro -// **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. -// + **Metafield is the custom field** -// + **Metadata is the data populating the custom field.** -// Chargify Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407659856411). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here.](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#custom-fields) -// Metadata is associated to a customer or subscription, and corresponds to a Metafield. When creating a new metadata object for a given record, **if the metafield is not present it will be created**. -// ## Metadata limits -// Metadata values are limited to 2kB in size. Additonally, there are limits on the number of unique metafields available per resource. -// ## Create Metadata -// This method will create a metafield for the site on the fly if it does not already exist, and populate the metadata value. -// ### Subscription or Customer Resource +// CreateMetadata takes context, resourceType, resourceId, body as parameters and +// returns an models.ApiResponse with []models.Metadata data and +// an error if there was an issue with the request or response. +// ## Custom Fields: Metadata Intro +// **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. +// + **Metafield is the custom field** +// + **Metadata is the data populating the custom field.** +// Chargify Metafields are used to add meaningful attributes to subscription and customer resources. Full documentation on how to create Custom Fields in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407659856411). For additional documentation on how to record data within custom fields, please see our subscription-based documentation [here.](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#custom-fields) +// Metadata is associated to a customer or subscription, and corresponds to a Metafield. When creating a new metadata object for a given record, **if the metafield is not present it will be created**. +// ## Metadata limits +// Metadata values are limited to 2kB in size. Additonally, there are limits on the number of unique metafields available per resource. +// ## Create Metadata +// This method will create a metafield for the site on the fly if it does not already exist, and populate the metadata value. +// ### Subscription or Customer Resource // Please pay special attention to the resource you use when creating metadata. func (c *CustomFieldsController) CreateMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, - body *models.CreateMetadataRequest) ( - models.ApiResponse[[]models.Metadata], - error) { - req := c.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result []models.Metadata - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Metadata](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + resourceId int, + body *models.CreateMetadataRequest) ( + models.ApiResponse[[]models.Metadata], + error) { + req := c.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result []models.Metadata + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Metadata](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListMetadata takes context, resourceType, resourceId, page, perPage as parameters and -// returns an models.ApiResponse with models.PaginatedMetadata data and -// an error if there was an issue with the request or response. -// This request will list all of the metadata belonging to a particular resource (ie. subscription, customer) that is specified. -// ## Metadata Data +// ListMetadata takes context, resourceType, resourceId, page, perPage as parameters and +// returns an models.ApiResponse with models.PaginatedMetadata data and +// an error if there was an issue with the request or response. +// This request will list all of the metadata belonging to a particular resource (ie. subscription, customer) that is specified. +// ## Metadata Data // This endpoint will also display the current stats of your metadata to use as a tool for pagination. func (c *CustomFieldsController) ListMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, - page *int, - perPage *int) ( - models.ApiResponse[models.PaginatedMetadata], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result models.PaginatedMetadata - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaginatedMetadata](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + resourceId int, + page *int, + perPage *int) ( + models.ApiResponse[models.PaginatedMetadata], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result models.PaginatedMetadata + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaginatedMetadata](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateMetadata takes context, resourceType, resourceId, body as parameters and -// returns an models.ApiResponse with []models.Metadata data and -// an error if there was an issue with the request or response. +// UpdateMetadata takes context, resourceType, resourceId, body as parameters and +// returns an models.ApiResponse with []models.Metadata data and +// an error if there was an issue with the request or response. // This method allows you to update the existing metadata associated with a subscription or customer. func (c *CustomFieldsController) UpdateMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, - body *models.UpdateMetadataRequest) ( - models.ApiResponse[[]models.Metadata], - error) { - req := c.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result []models.Metadata - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Metadata](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + resourceId int, + body *models.UpdateMetadataRequest) ( + models.ApiResponse[[]models.Metadata], + error) { + req := c.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result []models.Metadata + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Metadata](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteMetadata takes context, resourceType, resourceId, name, names as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This method removes the metadata from the subscriber/customer cited. -// ## Query String Usage -// For instance if you wanted to delete the metadata for customer 99 named weight you would request: -// ``` -// https://acme.chargify.com/customers/99/metadata.json?name=weight -// ``` -// If you want to delete multiple metadata fields for a customer 99 named: `weight` and `age` you wrould request: -// ``` -// https://acme.chargify.com/customers/99/metadata.json?names[]=weight&names[]=age -// ``` -// ## Successful Response -// For a success, there will be a code `200` and the plain text response `true`. -// ## Unsuccessful Response +// DeleteMetadata takes context, resourceType, resourceId, name, names as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This method removes the metadata from the subscriber/customer cited. +// ## Query String Usage +// For instance if you wanted to delete the metadata for customer 99 named weight you would request: +// ``` +// https://acme.chargify.com/customers/99/metadata.json?name=weight +// ``` +// If you want to delete multiple metadata fields for a customer 99 named: `weight` and `age` you wrould request: +// ``` +// https://acme.chargify.com/customers/99/metadata.json?names[]=weight&names[]=age +// ``` +// ## Successful Response +// For a success, there will be a code `200` and the plain text response `true`. +// ## Unsuccessful Response // When a failed response is encountered, you will receive a `404` response and the plain text response of `true`. func (c *CustomFieldsController) DeleteMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, - name *string, - names []string) ( - *http.Response, - error) { - req := c.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), - ) - req.Authenticate(true) - if name != nil { - req.QueryParam("name", *name) - } - if names != nil { - req.QueryParam("names[]", names) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return context.Response, err + ctx context.Context, + resourceType models.ResourceType, + resourceId int, + name *string, + names []string) ( + *http.Response, + error) { + req := c.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/%v/%v/metadata.json", resourceType, resourceId), + ) + req.Authenticate(true) + if name != nil { + req.QueryParam("name", *name) + } + if names != nil { + req.QueryParam("names[]", names) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return context.Response, err } -// ListMetadataForResourceType takes context, resourceType, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, withDeleted, resourceIds, direction as parameters and -// returns an models.ApiResponse with models.PaginatedMetadata data and -// an error if there was an issue with the request or response. -// This method will provide you information on usage of metadata across your selected resource (ie. subscriptions, customers) -// ## Metadata Data -// This endpoint will also display the current stats of your metadata to use as a tool for pagination. -// ### Metadata for multiple records -// `https://acme.chargify.com/subscriptions/metadata.json?resource_ids[]=1&resource_ids[]=2` -// ## Read Metadata for a Site +// ListMetadataForResourceType takes context, resourceType, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, withDeleted, resourceIds, direction as parameters and +// returns an models.ApiResponse with models.PaginatedMetadata data and +// an error if there was an issue with the request or response. +// This method will provide you information on usage of metadata across your selected resource (ie. subscriptions, customers) +// ## Metadata Data +// This endpoint will also display the current stats of your metadata to use as a tool for pagination. +// ### Metadata for multiple records +// `https://acme.chargify.com/subscriptions/metadata.json?resource_ids[]=1&resource_ids[]=2` +// ## Read Metadata for a Site // This endpoint will list the number of pages of metadata information that are contained within a site. func (c *CustomFieldsController) ListMetadataForResourceType( - ctx context.Context, - resourceType models.ResourceType, - page *int, - perPage *int, - dateField *models.BasicDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string, - withDeleted *bool, - resourceIds []int, - direction *models.SortingDirection) ( - models.ApiResponse[models.PaginatedMetadata], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/%v/metadata.json", resourceType), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if withDeleted != nil { - req.QueryParam("with_deleted", *withDeleted) - } - if resourceIds != nil { - req.QueryParam("resource_ids[]", resourceIds) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - - var result models.PaginatedMetadata - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaginatedMetadata](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + resourceType models.ResourceType, + page *int, + perPage *int, + dateField *models.BasicDateField, + startDate *time.Time, + endDate *time.Time, + startDatetime *time.Time, + endDatetime *time.Time, + withDeleted *bool, + resourceIds []int, + direction *models.SortingDirection) ( + models.ApiResponse[models.PaginatedMetadata], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/%v/metadata.json", resourceType), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) + } + if endDate != nil { + req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) + } + if startDatetime != nil { + req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) + } + if endDatetime != nil { + req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) + } + if withDeleted != nil { + req.QueryParam("with_deleted", *withDeleted) + } + if resourceIds != nil { + req.QueryParam("resource_ids[]", resourceIds) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + + var result models.PaginatedMetadata + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaginatedMetadata](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/customers_controller.go b/customers_controller.go index bb9e84d6..084ceaf6 100644 --- a/customers_controller.go +++ b/customers_controller.go @@ -1,301 +1,301 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // CustomersController represents a controller struct. type CustomersController struct { - baseController + baseController } -// NewCustomersController creates a new instance of CustomersController. +// NewCustomersController creates a new instance of CustomersController. // It takes a baseController as a parameter and returns a pointer to the CustomersController. func NewCustomersController(baseController baseController) *CustomersController { - customersController := CustomersController{baseController: baseController} - return &customersController + customersController := CustomersController{baseController: baseController} + return &customersController } -// CreateCustomer takes context, body as parameters and -// returns an models.ApiResponse with models.CustomerResponse data and -// an error if there was an issue with the request or response. -// You may create a new Customer at any time, or you may create a Customer at the same time you create a Subscription. The only validation restriction is that you may 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 Chargify’s unique ID for the customer, which is in the `id` attribute. -// Full documentation on how to locate, create and edit Customers in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407659914267). -// ## Required Country Format -// Chargify 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, please see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) -// ## Required State Format -// Chargify 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, please 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. -// ## Locale -// Chargify allows you to attribute a language/region to your customer to deliver invoices in any required language. +// CreateCustomer takes context, body as parameters and +// returns an models.ApiResponse with models.CustomerResponse data and +// an error if there was an issue with the request or response. +// You may create a new Customer at any time, or you may create a Customer at the same time you create a Subscription. The only validation restriction is that you may 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 Chargify’s unique ID for the customer, which is in the `id` attribute. +// Full documentation on how to locate, create and edit Customers in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407659914267). +// ## Required Country Format +// Chargify 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, please see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +// ## Required State Format +// Chargify 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, please 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. +// ## Locale +// Chargify allows you to attribute a language/region to your customer to deliver invoices in any required language. // For more: [Customer Locale](https://chargify.zendesk.com/hc/en-us/articles/4407870384283#customer-locale) func (c *CustomersController) CreateCustomer( - ctx context.Context, - body *models.CreateCustomerRequest) ( - models.ApiResponse[models.CustomerResponse], - error) { - req := c.prepareRequest(ctx, "POST", "/customers.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewCustomerErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateCustomerRequest) ( + models.ApiResponse[models.CustomerResponse], + error) { + req := c.prepareRequest(ctx, "POST", "/customers.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewCustomerErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListCustomers takes context, direction, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, q as parameters and -// returns an models.ApiResponse with []models.CustomerResponse data and -// an error if there was an issue with the request or response. -// This request will by default list all customers associated with your Site. -// ## Find Customer -// Use the search feature with the `q` query parameter to retrieve an array of customers that matches the search query. -// Common use cases are: -// + Search by an email -// + Search by a Chargify ID -// + Search by an organization -// + Search by a reference value from your application -// + Search by a first or last name +// ListCustomers takes context, direction, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, q as parameters and +// returns an models.ApiResponse with []models.CustomerResponse data and +// an error if there was an issue with the request or response. +// This request will by default list all customers associated with your Site. +// ## Find Customer +// Use the search feature with the `q` query parameter to retrieve an array of customers that matches the search query. +// Common use cases are: +// + Search by an email +// + Search by a Chargify ID +// + Search by an organization +// + Search by a reference value from your application +// + Search by a first or last name // To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). func (c *CustomersController) ListCustomers( - ctx context.Context, - direction *models.SortingDirection, - page *int, - perPage *int, - dateField *models.BasicDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string, - q *string) ( - models.ApiResponse[[]models.CustomerResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/customers.json") - req.Authenticate(true) - if direction != nil { - req.QueryParam("direction", *direction) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if q != nil { - req.QueryParam("q", *q) - } - var result []models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + direction *models.SortingDirection, + page *int, + perPage *int, + dateField *models.BasicDateField, + startDate *string, + endDate *string, + startDatetime *string, + endDatetime *string, + q *string) ( + models.ApiResponse[[]models.CustomerResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/customers.json") + req.Authenticate(true) + if direction != nil { + req.QueryParam("direction", *direction) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if q != nil { + req.QueryParam("q", *q) + } + var result []models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadCustomer takes context, id as parameters and -// returns an models.ApiResponse with models.CustomerResponse data and -// an error if there was an issue with the request or response. +// ReadCustomer takes context, id as parameters and +// returns an models.ApiResponse with models.CustomerResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve the Customer properties by Chargify-generated Customer ID. func (c *CustomersController) ReadCustomer( - ctx context.Context, - id int) ( - models.ApiResponse[models.CustomerResponse], - error) { - req := c.prepareRequest(ctx, "GET", fmt.Sprintf("/customers/%v.json", id)) - req.Authenticate(true) - - var result models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + id int) ( + models.ApiResponse[models.CustomerResponse], + error) { + req := c.prepareRequest(ctx, "GET", fmt.Sprintf("/customers/%v.json", id)) + req.Authenticate(true) + + var result models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateCustomer takes context, id, body as parameters and -// returns an models.ApiResponse with models.CustomerResponse data and -// an error if there was an issue with the request or response. +// UpdateCustomer takes context, id, body as parameters and +// returns an models.ApiResponse with models.CustomerResponse data and +// an error if there was an issue with the request or response. // This method allows to update the Customer. func (c *CustomersController) UpdateCustomer( - ctx context.Context, - id int, - body *models.UpdateCustomerRequest) ( - models.ApiResponse[models.CustomerResponse], - error) { - req := c.prepareRequest(ctx, "PUT", fmt.Sprintf("/customers/%v.json", id)) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewCustomerErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + id int, + body *models.UpdateCustomerRequest) ( + models.ApiResponse[models.CustomerResponse], + error) { + req := c.prepareRequest(ctx, "PUT", fmt.Sprintf("/customers/%v.json", id)) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewCustomerErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteCustomer takes context, id as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// DeleteCustomer takes context, id as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // This method allows you to delete the Customer. func (c *CustomersController) DeleteCustomer( - ctx context.Context, - id int) ( - *http.Response, - error) { - req := c.prepareRequest(ctx, "DELETE", fmt.Sprintf("/customers/%v.json", id)) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + id int) ( + *http.Response, + error) { + req := c.prepareRequest(ctx, "DELETE", fmt.Sprintf("/customers/%v.json", id)) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// ReadCustomerByReference takes context, reference as parameters and -// returns an models.ApiResponse with models.CustomerResponse data and -// an error if there was an issue with the request or response. +// ReadCustomerByReference takes context, reference as parameters and +// returns an models.ApiResponse with models.CustomerResponse data and +// an error if there was an issue with the request or response. // Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. func (c *CustomersController) ReadCustomerByReference( - ctx context.Context, - reference string) ( - models.ApiResponse[models.CustomerResponse], - error) { - req := c.prepareRequest(ctx, "GET", "/customers/lookup.json") - req.Authenticate(true) - req.QueryParam("reference", reference) - var result models.CustomerResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + reference string) ( + models.ApiResponse[models.CustomerResponse], + error) { + req := c.prepareRequest(ctx, "GET", "/customers/lookup.json") + req.Authenticate(true) + req.QueryParam("reference", reference) + var result models.CustomerResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListCustomerSubscriptions takes context, customerId as parameters and -// returns an models.ApiResponse with []models.SubscriptionResponse data and -// an error if there was an issue with the request or response. +// ListCustomerSubscriptions takes context, customerId as parameters and +// returns an models.ApiResponse with []models.SubscriptionResponse data and +// an error if there was an issue with the request or response. // This method lists all subscriptions that belong to a customer. func (c *CustomersController) ListCustomerSubscriptions( - ctx context.Context, - customerId int) ( - models.ApiResponse[[]models.SubscriptionResponse], - error) { - req := c.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/customers/%v/subscriptions.json", customerId), - ) - req.Authenticate(true) - - var result []models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + customerId int) ( + models.ApiResponse[[]models.SubscriptionResponse], + error) { + req := c.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/customers/%v/subscriptions.json", customerId), + ) + req.Authenticate(true) + + var result []models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/default_configuration.go b/default_configuration.go index 8397ec92..d5d5301a 100644 --- a/default_configuration.go +++ b/default_configuration.go @@ -1,39 +1,39 @@ package advancedbilling import ( - "net/http" + "net/http" ) -// DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests. +// DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests. // It also configures various retry options. func DefaultRetryConfiguration() RetryConfiguration { - return NewRetryConfiguration( - WithMaxRetryAttempts(0), - WithRetryOnTimeout(true), - WithRetryInterval(1), - WithMaximumRetryWaitTime(0), - WithBackoffFactor(2), - WithHttpStatusCodesToRetry([]int64{408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524}), - WithHttpMethodsToRetry([]string{"GET", "PUT", "GET", "PUT"}), - ) + return NewRetryConfiguration( + WithMaxRetryAttempts(0), + WithRetryOnTimeout(true), + WithRetryInterval(1), + WithMaximumRetryWaitTime(0), + WithBackoffFactor(2), + WithHttpStatusCodesToRetry([]int64{408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524}), + WithHttpMethodsToRetry([]string{"GET", "PUT", "GET", "PUT"}), + ) } -// DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests. +// DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests. // It also configures various HttpConfiguration options. func DefaultHttpConfiguration() HttpConfiguration { - return NewHttpConfiguration( - WithTimeout(30), - WithTransport(http.DefaultTransport), - WithRetryConfiguration(DefaultRetryConfiguration()), - ) + return NewHttpConfiguration( + WithTimeout(30), + WithTransport(http.DefaultTransport), + WithRetryConfiguration(DefaultRetryConfiguration()), + ) } // DefaultConfiguration returns the default Configuration. func DefaultConfiguration() Configuration { - return newConfiguration( - WithEnvironment(PRODUCTION), - WithSubdomain("subdomain"), - WithDomain("chargify.com"), - WithHttpConfiguration(DefaultHttpConfiguration()), - ) + return newConfiguration( + WithEnvironment(PRODUCTION), + WithSubdomain("subdomain"), + WithDomain("chargify.com"), + WithHttpConfiguration(DefaultHttpConfiguration()), + ) } diff --git a/doc/client.md b/doc/client.md index 5476ed96..1ec309b7 100644 --- a/doc/client.md +++ b/doc/client.md @@ -1,20 +1,20 @@ - -# Client Class Documentation - -The following parameters are configurable for the API Client: - -| Parameter | Type | Description | -| --- | --- | --- | -| `subdomain` | `string` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | -| `domain` | `string` | The Chargify server domain.
*Default*: `"chargify.com"` | -| `environment` | Environment | The API environment.
**Default: `Environment.PRODUCTION`** | -| `httpConfiguration` | [`HttpConfiguration`](http-configuration.md) | Configurable http client options like timeout and retries. | -| `basicAuthUserName` | `string` | The username to use with basic authentication | -| `basicAuthPassword` | `string` | The password to use with basic authentication | - -The API client can be initialized as follows: - -```go + +# Client Class Documentation + +The following parameters are configurable for the API Client: + +| Parameter | Type | Description | +| --- | --- | --- | +| `subdomain` | `string` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | +| `domain` | `string` | The Chargify server domain.
*Default*: `"chargify.com"` | +| `environment` | Environment | The API environment.
**Default: `Environment.PRODUCTION`** | +| `httpConfiguration` | [`HttpConfiguration`](http-configuration.md) | Configurable http client options like timeout and retries. | +| `basicAuthUserName` | `string` | The username to use with basic authentication | +| `basicAuthPassword` | `string` | The password to use with basic authentication | + +The API client can be initialized as follows: + +```go config := advancedbilling.CreateConfiguration( advancedbilling.WithHttpConfiguration( advancedbilling.CreateHttpConfiguration( @@ -37,46 +37,46 @@ config := advancedbilling.CreateConfiguration( advancedbilling.WithBasicAuthUserName("BasicAuthUserName"), advancedbilling.WithBasicAuthPassword("BasicAuthPassword"), ) -client := advancedbilling.NewClient(config) -``` - -## Maxio Advanced Billing Client - -The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK. - -## Controllers - -| Name | Description | -| --- | --- | -| aPIExports | Gets APIExportsController | -| advanceInvoice | Gets AdvanceInvoiceController | -| billingPortal | Gets BillingPortalController | -| coupons | Gets CouponsController | -| components | Gets ComponentsController | -| customers | Gets CustomersController | -| customFields | Gets CustomFieldsController | -| events | Gets EventsController | -| eventsBasedBillingSegments | Gets EventsBasedBillingSegmentsController | -| insights | Gets InsightsController | -| invoices | Gets InvoicesController | -| offers | Gets OffersController | -| paymentProfiles | Gets PaymentProfilesController | -| productFamilies | Gets ProductFamiliesController | -| products | Gets ProductsController | -| productPricePoints | Gets ProductPricePointsController | -| proformaInvoices | Gets ProformaInvoicesController | -| reasonCodes | Gets ReasonCodesController | -| referralCodes | Gets ReferralCodesController | -| salesCommissions | Gets SalesCommissionsController | -| sites | Gets SitesController | -| subscriptions | Gets SubscriptionsController | -| subscriptionComponents | Gets SubscriptionComponentsController | -| subscriptionGroups | Gets SubscriptionGroupsController | -| subscriptionGroupInvoiceAccount | Gets SubscriptionGroupInvoiceAccountController | -| subscriptionGroupStatus | Gets SubscriptionGroupStatusController | -| subscriptionInvoiceAccount | Gets SubscriptionInvoiceAccountController | -| subscriptionNotes | Gets SubscriptionNotesController | -| subscriptionProducts | Gets SubscriptionProductsController | -| subscriptionStatus | Gets SubscriptionStatusController | -| webhooks | Gets WebhooksController | - +client := advancedbilling.NewClient(config) +``` + +## Maxio Advanced Billing Client + +The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK. + +## Controllers + +| Name | Description | +| --- | --- | +| aPIExports | Gets APIExportsController | +| advanceInvoice | Gets AdvanceInvoiceController | +| billingPortal | Gets BillingPortalController | +| coupons | Gets CouponsController | +| components | Gets ComponentsController | +| customers | Gets CustomersController | +| customFields | Gets CustomFieldsController | +| events | Gets EventsController | +| eventsBasedBillingSegments | Gets EventsBasedBillingSegmentsController | +| insights | Gets InsightsController | +| invoices | Gets InvoicesController | +| offers | Gets OffersController | +| paymentProfiles | Gets PaymentProfilesController | +| productFamilies | Gets ProductFamiliesController | +| products | Gets ProductsController | +| productPricePoints | Gets ProductPricePointsController | +| proformaInvoices | Gets ProformaInvoicesController | +| reasonCodes | Gets ReasonCodesController | +| referralCodes | Gets ReferralCodesController | +| salesCommissions | Gets SalesCommissionsController | +| sites | Gets SitesController | +| subscriptions | Gets SubscriptionsController | +| subscriptionComponents | Gets SubscriptionComponentsController | +| subscriptionGroups | Gets SubscriptionGroupsController | +| subscriptionGroupInvoiceAccount | Gets SubscriptionGroupInvoiceAccountController | +| subscriptionGroupStatus | Gets SubscriptionGroupStatusController | +| subscriptionInvoiceAccount | Gets SubscriptionInvoiceAccountController | +| subscriptionNotes | Gets SubscriptionNotesController | +| subscriptionProducts | Gets SubscriptionProductsController | +| subscriptionStatus | Gets SubscriptionStatusController | +| webhooks | Gets WebhooksController | + diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 0a77c098..3d5f7632 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -1,50 +1,50 @@ -# Advance Invoice - -```go -advanceInvoiceController := client.AdvanceInvoiceController() -``` - -## Class Name - -`AdvanceInvoiceController` - -## Methods - +# Advance Invoice + +```go +advanceInvoiceController := client.AdvanceInvoiceController() +``` + +## Class Name + +`AdvanceInvoiceController` + +## Methods + * [Issue Advance Invoice](../../doc/controllers/advance-invoice.md#issue-advance-invoice) * [Read Advance Invoice](../../doc/controllers/advance-invoice.md#read-advance-invoice) -* [Void Advance Invoice](../../doc/controllers/advance-invoice.md#void-advance-invoice) - - -# Issue Advance Invoice - +* [Void Advance Invoice](../../doc/controllers/advance-invoice.md#void-advance-invoice) + + +# Issue Advance Invoice + Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice) for more information on advance invoices, including eligibility on 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. - -```go -IssueAdvanceInvoice( - ctx context.Context, - subscriptionId int, +We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. + +```go +IssueAdvanceInvoice( + ctx context.Context, + subscriptionId int, body *models.IssueAdvanceInvoiceRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.IssueAdvanceInvoiceRequest`](../../doc/models/issue-advance-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.IssueAdvanceInvoiceRequest`](../../doc/models/issue-advance-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -59,42 +59,42 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Advance Invoice - -Once an advance invoice has been generated for a subscription's upcoming renewal, it can be viewed through this endpoint. There can only be one advance invoice per subscription per billing cycle. - -```go -ReadAdvanceInvoice( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read Advance Invoice + +Once an advance invoice has been generated for a subscription's upcoming renewal, it can be viewed through this endpoint. There can only be one advance invoice per subscription per billing cycle. + +```go +ReadAdvanceInvoice( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -105,44 +105,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Void Advance Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Void Advance Invoice + Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, please [see our help docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice). - -```go -VoidAdvanceInvoice( - ctx context.Context, - subscriptionId int, +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, please [see our help docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice). + +```go +VoidAdvanceInvoice( + ctx context.Context, + subscriptionId int, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -153,12 +153,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 383abfbe..b29bda86 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -1,15 +1,15 @@ -# API Exports - -```go -APIExportsController := client.APIExportsController() -``` - -## Class Name - -`APIExportsController` - -## Methods - +# API Exports + +```go +APIExportsController := client.APIExportsController() +``` + +## Class Name + +`APIExportsController` + +## Methods + * [List Exported Proforma Invoices](../../doc/controllers/api-exports.md#list-exported-proforma-invoices) * [List Exported Invoices](../../doc/controllers/api-exports.md#list-exported-invoices) * [List Exported Subscriptions](../../doc/controllers/api-exports.md#list-exported-subscriptions) @@ -18,37 +18,37 @@ APIExportsController := client.APIExportsController() * [Export Subscriptions](../../doc/controllers/api-exports.md#export-subscriptions) * [Read Proforma Invoices Export](../../doc/controllers/api-exports.md#read-proforma-invoices-export) * [Read Invoices Export](../../doc/controllers/api-exports.md#read-invoices-export) -* [Read Subscriptions Export](../../doc/controllers/api-exports.md#read-subscriptions-export) - - -# List Exported Proforma Invoices - +* [Read Subscriptions Export](../../doc/controllers/api-exports.md#read-subscriptions-export) + + +# List Exported Proforma Invoices + This API returns an array of exported proforma invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. -Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`. - -```go -ListExportedProformaInvoices( +Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`. + +```go +ListExportedProformaInvoices( ctx context.Context,input ListExportedProformaInvoicesInput) ( models.ApiResponse[[]models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | -| `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`. | - -## Response Type - -[`[]models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | +| `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`. | + +## Response Type + +[`[]models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" perPage := 100 @@ -61,44 +61,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# List Exported Invoices - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# List Exported Invoices + This API returns an array of exported invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. -Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`. - -```go -ListExportedInvoices( +Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`. + +```go +ListExportedInvoices( ctx context.Context,input ListExportedInvoicesInput) ( models.ApiResponse[[]models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | -| `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`. | - -## Response Type - -[`[]models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | +| `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`. | + +## Response Type + +[`[]models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" perPage := 100 @@ -111,44 +111,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# List Exported Subscriptions - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# List Exported Subscriptions + This API returns an array of exported subscriptions for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. -Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`. - -```go -ListExportedSubscriptions( +Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`. + +```go +ListExportedSubscriptions( ctx context.Context,input ListExportedSubscriptionsInput) ( models.ApiResponse[[]models.Subscription], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | -| `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`. | - -## Response Type - -[`[]models.Subscription`](../../doc/models/subscription.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000. | +| `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`. | + +## Response Type + +[`[]models.Subscription`](../../doc/models/subscription.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" perPage := 100 @@ -161,36 +161,36 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Export Proforma Invoices - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Export Proforma Invoices + This API creates a proforma invoices export and returns a batchjob object. -It is only available for Relationship Invoicing architecture. - -```go -ExportProformaInvoices( +It is only available for Relationship Invoicing architecture. + +```go +ExportProformaInvoices( ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := APIExportsController.ExportProformaInvoices(ctx) if err != nil { @@ -199,35 +199,35 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# Export Invoices - -This API creates an invoices export and returns a batchjob object. - -```go -ExportInvoices( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Export Invoices + +This API creates an invoices export and returns a batchjob object. + +```go +ExportInvoices( ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := APIExportsController.ExportInvoices(ctx) if err != nil { @@ -236,35 +236,35 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# Export Subscriptions - -This API creates a subscriptions export and returns a batchjob object. - -```go -ExportSubscriptions( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Export Subscriptions + +This API creates a subscriptions export and returns a batchjob object. + +```go +ExportSubscriptions( ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := APIExportsController.ExportSubscriptions(ctx) if err != nil { @@ -273,41 +273,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# Read Proforma Invoices Export - -This API returns a batchjob object for proforma invoices export. - -```go -ReadProformaInvoicesExport( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 409 | Conflict | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Read Proforma Invoices Export + +This API returns a batchjob object for proforma invoices export. + +```go +ReadProformaInvoicesExport( + ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" @@ -318,41 +318,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Read Invoices Export - -This API returns a batchjob object for invoices export. - -```go -ReadInvoicesExport( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Read Invoices Export + +This API returns a batchjob object for invoices export. + +```go +ReadInvoicesExport( + ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" @@ -363,41 +363,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Read Subscriptions Export - -This API returns a batchjob object for subscriptions export. - -```go -ReadSubscriptionsExport( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Read Subscriptions Export + +This API returns a batchjob object for subscriptions export. + +```go +ReadSubscriptionsExport( + ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `batchId` | `string` | Template, Required | Id of a Batch Job. | - -## Response Type - -[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchId` | `string` | Template, Required | Id of a Batch Job. | + +## Response Type + +[`models.BatchJobResponse`](../../doc/models/batch-job-response.md) + +## Example Usage + +```go ctx := context.Background() batchId := "batch_id8" @@ -408,12 +408,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 724461eb..9f800504 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -1,23 +1,23 @@ -# Billing Portal - -```go -billingPortalController := client.BillingPortalController() -``` - -## Class Name - -`BillingPortalController` - -## Methods - +# Billing Portal + +```go +billingPortalController := client.BillingPortalController() +``` + +## Class Name + +`BillingPortalController` + +## Methods + * [Enable Billing Portal for Customer](../../doc/controllers/billing-portal.md#enable-billing-portal-for-customer) * [Read Billing Portal Link](../../doc/controllers/billing-portal.md#read-billing-portal-link) * [Resend Billing Portal Invitation](../../doc/controllers/billing-portal.md#resend-billing-portal-invitation) -* [Revoke Billing Portal Access](../../doc/controllers/billing-portal.md#revoke-billing-portal-access) - - -# Enable Billing Portal for Customer - +* [Revoke Billing Portal Access](../../doc/controllers/billing-portal.md#revoke-billing-portal-access) + + +# Enable Billing Portal for Customer + ## Billing Portal Documentation Full documentation on how the Billing Portal operates within the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407648972443). @@ -32,31 +32,31 @@ If your customer has been invited to the Billing Portal, then they will receive 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 Chargify. -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), please **do not** make an API request to Chargify every time. - -```go -EnableBillingPortalForCustomer( - ctx context.Context, - customerId int, +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), please **do not** make an API request to Chargify every time. + +```go +EnableBillingPortalForCustomer( + ctx context.Context, + customerId int, autoInvite *models.AutoInvite) ( models.ApiResponse[models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `int` | Template, Required | The Chargify id of the customer | -| `autoInvite` | [`*models.AutoInvite`](../../doc/models/auto-invite.md) | Query, Optional | When set to 1, an Invitation email will be sent to the Customer.
When set to 0, or not sent, an email will not be sent.
Use in query: `auto_invite=1`. | - -## Response Type - -[`models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `int` | Template, Required | The Chargify id of the customer | +| `autoInvite` | [`*models.AutoInvite`](../../doc/models/auto-invite.md) | Query, Optional | When set to 1, an Invitation email will be sent to the Customer.
When set to 0, or not sent, an email will not be sent.
Use in query: `auto_invite=1`. | + +## Response Type + +[`models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() customerId := 150 @@ -67,18 +67,18 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Billing Portal Link - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read Billing Portal Link + This method will provide to the API user the exact URL required for a subscriber to access the Billing Portal. ## Rules for Management Link API @@ -87,29 +87,29 @@ This method will provide to the API user the exact URL required for a subscriber + 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`) - -```go -ReadBillingPortalLink( - ctx context.Context, ++ 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`) + +```go +ReadBillingPortalLink( + ctx context.Context, customerId int) ( models.ApiResponse[models.PortalManagementLink], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -[`models.PortalManagementLink`](../../doc/models/portal-management-link.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +[`models.PortalManagementLink`](../../doc/models/portal-management-link.md) + +## Example Usage + +```go ctx := context.Background() customerId := 150 @@ -120,32 +120,32 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "url": "https://www.billingportal.com/manage/19804639/1517596469/bd16498719a7d3e6", - "fetch_count": 1, - "created_at": "2018-02-02T18:34:29Z", - "new_link_available_at": "2018-02-17T18:34:29Z", - "expires_at": "2018-04-08T17:34:29Z", - "last_invite_sent_at": "2018-02-02T18:34:29Z" -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | -| 429 | Too Many Requests | [`TooManyManagementLinkRequestsErrorException`](../../doc/models/too-many-management-link-requests-error-exception.md) | - - -# Resend Billing Portal Invitation - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "url": "https://www.billingportal.com/manage/19804639/1517596469/bd16498719a7d3e6", + "fetch_count": 1, + "created_at": "2018-02-02T18:34:29Z", + "new_link_available_at": "2018-02-17T18:34:29Z", + "expires_at": "2018-04-08T17:34:29Z", + "last_invite_sent_at": "2018-02-02T18:34:29Z" +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 429 | Too Many Requests | [`TooManyManagementLinkRequestsErrorException`](../../doc/models/too-many-management-link-requests-error-exception.md) | + + +# Resend Billing Portal Invitation + You can resend a customer's Billing Portal invitation. If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with `error` message in the body. @@ -158,29 +158,29 @@ If you attempt to resend an invitation when the Customer does not exist a Custom ## Limitations -This endpoint will only return a JSON response. - -```go -ResendBillingPortalInvitation( - ctx context.Context, +This endpoint will only return a JSON response. + +```go +ResendBillingPortalInvitation( + ctx context.Context, customerId int) ( models.ApiResponse[models.ResentInvitation], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -[`models.ResentInvitation`](../../doc/models/resent-invitation.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +[`models.ResentInvitation`](../../doc/models/resent-invitation.md) + +## Example Usage + +```go ctx := context.Background() customerId := 150 @@ -191,59 +191,59 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "last_sent_at": "enim Duis esse dolore", - "last_accepted_at": "adipisicing magna do in irure", - "send_invite_link_text": "veniam sit", - "uninvited_count": 66254678 -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Revoke Billing Portal Access - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "last_sent_at": "enim Duis esse dolore", + "last_accepted_at": "adipisicing magna do in irure", + "send_invite_link_text": "veniam sit", + "uninvited_count": 66254678 +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Revoke Billing Portal Access + You can revoke a customer's Billing Portal invitation. If you attempt to revoke an invitation when the Billing Portal is already disabled for a Customer, you will receive a 422 error response. ## Limitations -This endpoint will only return a JSON response. - -```go -RevokeBillingPortalAccess( - ctx context.Context, +This endpoint will only return a JSON response. + +```go +RevokeBillingPortalAccess( + ctx context.Context, customerId int) ( models.ApiResponse[models.RevokedInvitation], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -[`models.RevokedInvitation`](../../doc/models/revoked-invitation.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +[`models.RevokedInvitation`](../../doc/models/revoked-invitation.md) + +## Example Usage + +```go ctx := context.Background() customerId := 150 @@ -254,16 +254,16 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "last_sent_at": "Not Invited", - "last_accepted_at": "Invite Revoked", - "uninvited_count": 8 -} -``` - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "last_sent_at": "Not Invited", + "last_accepted_at": "Invite Revoked", + "uninvited_count": 8 +} +``` + diff --git a/doc/controllers/components.md b/doc/controllers/components.md index d92f7dda..1b48dc06 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -1,72 +1,72 @@ -# Components - -```go -componentsController := client.ComponentsController() -``` - -## Class Name - -`ComponentsController` - -## Methods - +# Components + +```go +componentsController := client.ComponentsController() +``` + +## Class Name + +`ComponentsController` + +## Methods + * [Create Metered Component](../../doc/controllers/components.md#create-metered-component) * [Create Quantity Based Component](../../doc/controllers/components.md#create-quantity-based-component) * [Create on Off Component](../../doc/controllers/components.md#create-on-off-component) * [Create Prepaid Usage Component](../../doc/controllers/components.md#create-prepaid-usage-component) * [Create Event Based Component](../../doc/controllers/components.md#create-event-based-component) -* [Read Component by Handle](../../doc/controllers/components.md#read-component-by-handle) -* [Read Component by Id](../../doc/controllers/components.md#read-component-by-id) +* [Find Component](../../doc/controllers/components.md#find-component) +* [Read Component](../../doc/controllers/components.md#read-component) * [Update Product Family Component](../../doc/controllers/components.md#update-product-family-component) * [Archive Component](../../doc/controllers/components.md#archive-component) * [List Components](../../doc/controllers/components.md#list-components) * [Update Component](../../doc/controllers/components.md#update-component) -* [Update Default Price Point for Component](../../doc/controllers/components.md#update-default-price-point-for-component) +* [Promote Component Price Point to Default](../../doc/controllers/components.md#promote-component-price-point-to-default) * [List Components for Product Family](../../doc/controllers/components.md#list-components-for-product-family) * [Create Component Price Point](../../doc/controllers/components.md#create-component-price-point) * [List Component Price Points](../../doc/controllers/components.md#list-component-price-points) -* [Create Component Price Points](../../doc/controllers/components.md#create-component-price-points) +* [Bulk Create Component Price Points](../../doc/controllers/components.md#bulk-create-component-price-points) * [Update Component Price Point](../../doc/controllers/components.md#update-component-price-point) * [Archive Component Price Point](../../doc/controllers/components.md#archive-component-price-point) * [Unarchive Component Price Point](../../doc/controllers/components.md#unarchive-component-price-point) * [Create Currency Prices](../../doc/controllers/components.md#create-currency-prices) * [Update Currency Prices](../../doc/controllers/components.md#update-currency-prices) -* [List All Component Price Points](../../doc/controllers/components.md#list-all-component-price-points) - - -# Create Metered Component - +* [List All Component Price Points](../../doc/controllers/components.md#list-all-component-price-points) + + +# Create Metered Component + This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription. Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. 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. -For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). - -```go -CreateMeteredComponent( - ctx context.Context, - productFamilyId int, +For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). + +```go +CreateMeteredComponent( + ctx context.Context, + productFamilyId int, body *models.CreateMeteredComponent) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `body` | [`*models.CreateMeteredComponent`](../../doc/models/create-metered-component.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `body` | [`*models.CreateMeteredComponent`](../../doc/models/create-metered-component.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -94,69 +94,69 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 292609, - "name": "Text messages", - "handle": "text-messages", - "pricing_scheme": "per_unit", - "unit_name": "unit", - "unit_price": "10.0", - "product_family_id": 528484, - "product_family_name": "Cloud Compute Servers", - "price_per_unit_in_cents": null, - "kind": "metered_component", - "archived": false, - "taxable": false, - "description": null, - "default_price_point_id": 2944263, - "prices": [ - { - "id": 55423, - "component_id": 30002, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "10.0", - "price_point_id": 2944263, - "formatted_unit_price": "$10.00", - "segment_id": null - } - ], - "price_point_count": 1, - "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", - "default_price_point_name": "Original", - "tax_code": null, - "recurring": false, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2024-01-23T06:08:05-05:00", - "updated_at": "2024-01-23T06:08:05-05:00", - "archived_at": null, - "hide_date_range_on_invoice": false, - "allow_fractional_quantities": false, - "use_site_exchange_rate": true, - "item_category": null, - "accounting_code": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Create Quantity Based Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 292609, + "name": "Text messages", + "handle": "text-messages", + "pricing_scheme": "per_unit", + "unit_name": "unit", + "unit_price": "10.0", + "product_family_id": 528484, + "product_family_name": "Cloud Compute Servers", + "price_per_unit_in_cents": null, + "kind": "metered_component", + "archived": false, + "taxable": false, + "description": null, + "default_price_point_id": 2944263, + "prices": [ + { + "id": 55423, + "component_id": 30002, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "10.0", + "price_point_id": 2944263, + "formatted_unit_price": "$10.00", + "segment_id": null + } + ], + "price_point_count": 1, + "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", + "default_price_point_name": "Original", + "tax_code": null, + "recurring": false, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2024-01-23T06:08:05-05:00", + "updated_at": "2024-01-23T06:08:05-05:00", + "archived_at": null, + "hide_date_range_on_invoice": false, + "allow_fractional_quantities": false, + "use_site_exchange_rate": true, + "item_category": null, + "accounting_code": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create Quantity Based Component + This request will create a component definition of kind **quantity_based_component** under the specified product family. Quantity Based component can then be added and “allocated” for a subscription. When defining Quantity Based component, You can choose one of 2 types: @@ -171,31 +171,31 @@ 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 on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). - -```go -CreateQuantityBasedComponent( - ctx context.Context, - productFamilyId int, +For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). + +```go +CreateQuantityBasedComponent( + ctx context.Context, + productFamilyId int, body *models.CreateQuantityBasedComponent) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `body` | [`*models.CreateQuantityBasedComponent`](../../doc/models/create-quantity-based-component.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `body` | [`*models.CreateQuantityBasedComponent`](../../doc/models/create-quantity-based-component.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -222,98 +222,98 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 292609, - "name": "Text messages", - "handle": "text-messages", - "pricing_scheme": "per_unit", - "unit_name": "unit", - "unit_price": "10.0", - "product_family_id": 528484, - "product_family_name": "Cloud Compute Servers", - "price_per_unit_in_cents": null, - "kind": "quantity_based_component", - "archived": false, - "taxable": false, - "description": null, - "default_price_point_id": 2944263, - "prices": [ - { - "id": 55423, - "component_id": 30002, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "10.0", - "price_point_id": 2944263, - "formatted_unit_price": "$10.00", - "segment_id": null - } - ], - "price_point_count": 1, - "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", - "default_price_point_name": "Original", - "tax_code": null, - "recurring": false, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2024-01-23T06:08:05-05:00", - "updated_at": "2024-01-23T06:08:05-05:00", - "archived_at": null, - "hide_date_range_on_invoice": false, - "allow_fractional_quantities": false, - "use_site_exchange_rate": true, - "item_category": null, - "accounting_code": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Create on Off Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 292609, + "name": "Text messages", + "handle": "text-messages", + "pricing_scheme": "per_unit", + "unit_name": "unit", + "unit_price": "10.0", + "product_family_id": 528484, + "product_family_name": "Cloud Compute Servers", + "price_per_unit_in_cents": null, + "kind": "quantity_based_component", + "archived": false, + "taxable": false, + "description": null, + "default_price_point_id": 2944263, + "prices": [ + { + "id": 55423, + "component_id": 30002, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "10.0", + "price_point_id": 2944263, + "formatted_unit_price": "$10.00", + "segment_id": null + } + ], + "price_point_count": 1, + "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", + "default_price_point_name": "Original", + "tax_code": null, + "recurring": false, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2024-01-23T06:08:05-05:00", + "updated_at": "2024-01-23T06:08:05-05:00", + "archived_at": null, + "hide_date_range_on_invoice": false, + "allow_fractional_quantities": false, + "use_site_exchange_rate": true, + "item_category": null, + "accounting_code": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create on Off Component + This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription. On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). -For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). - -```go -CreateOnOffComponent( - ctx context.Context, - productFamilyId int, +For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). + +```go +CreateOnOffComponent( + ctx context.Context, + productFamilyId int, body *models.CreateOnOffComponent) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `body` | [`*models.CreateOnOffComponent`](../../doc/models/create-on-off-component.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `body` | [`*models.CreateOnOffComponent`](../../doc/models/create-on-off-component.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -343,86 +343,86 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 292609, - "name": "Test On-Off Component 46124", - "handle": "test-on-off-component-4612422802", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "10.0", - "product_family_id": 528484, - "product_family_name": "Cloud Compute Servers", - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": false, - "description": null, - "default_price_point_id": 2944263, - "price_point_count": 1, - "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", - "default_price_point_name": "Original", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2024-01-23T06:08:05-05:00", - "updated_at": "2024-01-23T06:08:05-05:00", - "archived_at": null, - "hide_date_range_on_invoice": false, - "allow_fractional_quantities": false, - "use_site_exchange_rate": true, - "item_category": null, - "accounting_code": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Create Prepaid Usage Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 292609, + "name": "Test On-Off Component 46124", + "handle": "test-on-off-component-4612422802", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "10.0", + "product_family_id": 528484, + "product_family_name": "Cloud Compute Servers", + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": false, + "description": null, + "default_price_point_id": 2944263, + "price_point_count": 1, + "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", + "default_price_point_name": "Original", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2024-01-23T06:08:05-05:00", + "updated_at": "2024-01-23T06:08:05-05:00", + "archived_at": null, + "hide_date_range_on_invoice": false, + "allow_fractional_quantities": false, + "use_site_exchange_rate": true, + "item_category": null, + "accounting_code": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create Prepaid Usage Component + This request will create a component definition of kind **prepaid_usage_component** under the specified product family. 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. -For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). - -```go -CreatePrepaidUsageComponent( - ctx context.Context, - productFamilyId int, +For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). + +```go +CreatePrepaidUsageComponent( + ctx context.Context, + productFamilyId int, body *models.CreatePrepaidComponent) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `body` | [`*models.CreatePrepaidComponent`](../../doc/models/create-prepaid-component.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `body` | [`*models.CreatePrepaidComponent`](../../doc/models/create-prepaid-component.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -466,112 +466,112 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 292609, - "name": "Test Prepaid Component 98505", - "handle": "test-prepaid-component-9850584842", - "pricing_scheme": "per_unit", - "unit_name": "unit", - "unit_price": "10.0", - "product_family_id": 528484, - "product_family_name": "Test Product Family 27791", - "price_per_unit_in_cents": null, - "kind": "prepaid_usage_component", - "archived": false, - "taxable": false, - "description": "Description for: Test Prepaid Component 98505", - "default_price_point_id": 2944263, - "overage_prices": [ - { - "id": 55964, - "component_id": 30427, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 2944756, - "formatted_unit_price": "$1.00", - "segment_id": null - } - ], - "prices": [ - { - "id": 55963, - "component_id": 30427, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 2944756, - "formatted_unit_price": "$1.00", - "segment_id": null - } - ], - "price_point_count": 1, - "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", - "default_price_point_name": "Original", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2024-01-23T06:08:05-05:00", - "updated_at": "2024-01-23T06:08:05-05:00", - "archived_at": null, - "hide_date_range_on_invoice": false, - "allow_fractional_quantities": false, - "use_site_exchange_rate": true, - "item_category": null, - "accounting_code": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Create Event Based Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 292609, + "name": "Test Prepaid Component 98505", + "handle": "test-prepaid-component-9850584842", + "pricing_scheme": "per_unit", + "unit_name": "unit", + "unit_price": "10.0", + "product_family_id": 528484, + "product_family_name": "Test Product Family 27791", + "price_per_unit_in_cents": null, + "kind": "prepaid_usage_component", + "archived": false, + "taxable": false, + "description": "Description for: Test Prepaid Component 98505", + "default_price_point_id": 2944263, + "overage_prices": [ + { + "id": 55964, + "component_id": 30427, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 2944756, + "formatted_unit_price": "$1.00", + "segment_id": null + } + ], + "prices": [ + { + "id": 55963, + "component_id": 30427, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 2944756, + "formatted_unit_price": "$1.00", + "segment_id": null + } + ], + "price_point_count": 1, + "price_points_url": "https://demo-3238403362.chargify.com/components/30002/price_points", + "default_price_point_name": "Original", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2024-01-23T06:08:05-05:00", + "updated_at": "2024-01-23T06:08:05-05:00", + "archived_at": null, + "hide_date_range_on_invoice": false, + "allow_fractional_quantities": false, + "use_site_exchange_rate": true, + "item_category": null, + "accounting_code": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create Event Based Component + This request will create a component definition of kind **event_based_component** under the specified product family. Event-based component can then be added and “allocated” for a subscription. Event-based components are similar to other component types, in that you define the component parameters (such as name and taxability) and the pricing. A key difference for the event-based component is that it must be attached to a metric. This is because the metric provides the component with the actual quantity used in computing what and how much will be billed each 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, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). - -```go -CreateEventBasedComponent( - ctx context.Context, - productFamilyId int, +For more information on components, please see our documentation [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677). + +```go +CreateEventBasedComponent( + ctx context.Context, + productFamilyId int, body *models.CreateEBBComponent) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `body` | [`*models.CreateEBBComponent`](../../doc/models/create-ebb-component.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `body` | [`*models.CreateEBBComponent`](../../doc/models/create-ebb-component.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -603,231 +603,231 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 1489581, - "name": "stripeCharges", - "handle": null, - "pricing_scheme": null, - "unit_name": "charge", - "unit_price": null, - "product_family_id": 1517093, - "product_family_name": "Billing Plans", - "price_per_unit_in_cents": null, - "kind": "event_based_component", - "archived": false, - "taxable": false, - "description": null, - "default_price_point_id": null, - "prices": [], - "price_point_count": 0, - "price_points_url": "https://staging.chargify.com/components/1489581/price_points", - "default_price_point_name": "Original", - "tax_code": null, - "recurring": false, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2021-10-12T07:33:24-05:00", - "updated_at": "2021-10-12T07:33:24-05:00", - "archived_at": null, - "hide_date_range_on_invoice": false, - "allow_fractional_quantities": false, - "use_site_exchange_rate": null, - "item_category": null, - "accounting_code": null, - "event_based_billing_metric_id": 1163 - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Component by Handle - -This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate. - -```go -ReadComponentByHandle( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 1489581, + "name": "stripeCharges", + "handle": null, + "pricing_scheme": null, + "unit_name": "charge", + "unit_price": null, + "product_family_id": 1517093, + "product_family_name": "Billing Plans", + "price_per_unit_in_cents": null, + "kind": "event_based_component", + "archived": false, + "taxable": false, + "description": null, + "default_price_point_id": null, + "prices": [], + "price_point_count": 0, + "price_points_url": "https://staging.chargify.com/components/1489581/price_points", + "default_price_point_name": "Original", + "tax_code": null, + "recurring": false, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2021-10-12T07:33:24-05:00", + "updated_at": "2021-10-12T07:33:24-05:00", + "archived_at": null, + "hide_date_range_on_invoice": false, + "allow_fractional_quantities": false, + "use_site_exchange_rate": null, + "item_category": null, + "accounting_code": null, + "event_based_billing_metric_id": 1163 + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Find Component + +This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate. + +```go +FindComponent( + ctx context.Context, handle string) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `handle` | `string` | Query, Required | The handle of the component to find | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `handle` | `string` | Query, Required | The handle of the component to find | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() handle := "handle6" -apiResponse, err := componentsController.ReadComponentByHandle(ctx, handle) +apiResponse, err := componentsController.FindComponent(ctx, handle) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-02T05:54:53-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify" - } -} -``` - - -# Read Component by Id - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-02T05:54:53-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify" + } +} +``` + + +# Read Component + This request will return information regarding 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:`. - -```go -ReadComponentById( - ctx context.Context, - productFamilyId int, +You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. + +```go +ReadComponent( + ctx context.Context, + productFamilyId int, componentId string) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 componentId := "component_id8" -apiResponse, err := componentsController.ReadComponentById(ctx, productFamilyId, componentId) +apiResponse, err := componentsController.ReadComponent(ctx, productFamilyId, componentId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-02T05:54:53-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify" - } -} -``` - - -# Update Product Family Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-02T05:54:53-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify" + } +} +``` + + +# Update Product Family Component + This request will update 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:`. - -```go -UpdateProductFamilyComponent( - ctx context.Context, - productFamilyId int, - componentId string, +You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. + +```go +UpdateProductFamilyComponent( + ctx context.Context, + productFamilyId int, + componentId string, body *models.UpdateComponentRequest) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | -| `body` | [`*models.UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | +| `body` | [`*models.UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 componentId := "component_id8" @@ -847,73 +847,73 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-02T05:54:53-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Archive Component - -Sending a DELETE request to this endpoint will archive the component. All current subscribers will be unffected; their subscription/purchase will continue to be charged as usual. - -```go -ArchiveComponent( - ctx context.Context, - productFamilyId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-02T05:54:53-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Archive Component + +Sending a DELETE request to this endpoint will archive the component. All current subscribers will be unffected; their subscription/purchase will continue to be charged as usual. + +```go +ArchiveComponent( + ctx context.Context, + productFamilyId int, componentId string) ( models.ApiResponse[models.Component], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | -| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | - -## Response Type - -[`models.Component`](../../doc/models/component.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the component belongs | +| `componentId` | `string` | Template, Required | Either the Chargify id of the component or the handle for the component prefixed with `handle:` | + +## Response Type + +[`models.Component`](../../doc/models/component.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 componentId := "component_id8" @@ -925,75 +925,75 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "id": 25407138, - "name": "cillum aute", - "pricing_scheme": "stairstep", - "unit_name": "nulla in", - "unit_price": "Excepteur veniam", - "product_family_id": -56705047, - "kind": "prepaid_usage_component", - "archived": true, - "taxable": false, - "description": "reprehenderit laborum qui fugiat", - "default_price_point_id": -64328176, - "price_point_count": 15252407, - "price_points_url": "dolor mollit consequat", - "tax_code": "ea nisi", - "recurring": false, - "created_at": "2016-11-08T16:22:26-05:00", - "default_price_point_name": "cupidatat Lorem non aliqua", - "product_family_name": "do elit", - "hide_date_range_on_invoice": false -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Components - -This request will return a list of components for a site. - -```go -ListComponents( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "id": 25407138, + "name": "cillum aute", + "pricing_scheme": "stairstep", + "unit_name": "nulla in", + "unit_price": "Excepteur veniam", + "product_family_id": -56705047, + "kind": "prepaid_usage_component", + "archived": true, + "taxable": false, + "description": "reprehenderit laborum qui fugiat", + "default_price_point_id": -64328176, + "price_point_count": 15252407, + "price_points_url": "dolor mollit consequat", + "tax_code": "ea nisi", + "recurring": false, + "created_at": "2016-11-08T16:22:26-05:00", + "default_price_point_name": "cupidatat Lorem non aliqua", + "product_family_name": "do elit", + "hide_date_range_on_invoice": false +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Components + +This request will return a list of components for a site. + +```go +ListComponents( ctx context.Context,input ListComponentsInput) ( models.ApiResponse[[]models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | -| `includeArchived` | `*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`. | -| `perPage` | `*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`. | -| `filterIds` | `[]string` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | - -## Response Type - -[`[]models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | +| `includeArchived` | `*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`. | +| `perPage` | `*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`. | +| `filterIds` | `[]string` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | + +## Response Type + +[`[]models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() dateField := models.BasicDateField("updated_at") page := 2 @@ -1006,135 +1006,135 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "component": { - "id": 399850, - "name": "$1.00 component", - "pricing_scheme": "per_unit", - "unit_name": "Component", - "unit_price": "1.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "quantity_based_component", - "archived": false, - "taxable": false, - "description": "Component", - "default_price_point_id": 121000, - "prices": [ - { - "id": 630687, - "component_id": 399850, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 121000, - "formatted_unit_price": "$1.00" - } - ], - "price_point_count": 2, - "price_points_url": "https://general-goods.chargify.com/components/399850/price_points", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:38-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - }, - { - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:37-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - }, - { - "component": { - "id": 386937, - "name": "Cancellation fee", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "35.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": false, - "description": "", - "default_price_point_id": 108307, - "price_point_count": 1, - "price_points_url": "https://general-goods.chargify.com/components/386937/price_points", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:38-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - } -] -``` - - -# Update Component - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "component": { + "id": 399850, + "name": "$1.00 component", + "pricing_scheme": "per_unit", + "unit_name": "Component", + "unit_price": "1.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "quantity_based_component", + "archived": false, + "taxable": false, + "description": "Component", + "default_price_point_id": 121000, + "prices": [ + { + "id": 630687, + "component_id": 399850, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 121000, + "formatted_unit_price": "$1.00" + } + ], + "price_point_count": 2, + "price_points_url": "https://general-goods.chargify.com/components/399850/price_points", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:38-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + }, + { + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:37-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + }, + { + "component": { + "id": 386937, + "name": "Cancellation fee", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "35.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": false, + "description": "", + "default_price_point_id": 108307, + "price_point_count": 1, + "price_points_url": "https://general-goods.chargify.com/components/386937/price_points", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:38-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + } +] +``` + + +# Update Component + This request will update 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:`. - -```go -UpdateComponent( - ctx context.Context, - componentId string, +You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. + +```go +UpdateComponent( + ctx context.Context, + componentId string, body *models.UpdateComponentRequest) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | The id or handle of the component | -| `body` | [`*models.UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | The id or handle of the component | +| `body` | [`*models.UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" @@ -1153,159 +1153,159 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-02T05:54:53-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Update Default Price Point for Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-02T05:54:53-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Promote Component Price Point to Default + Sets a new default price point for the component. This new default will apply to all new subscriptions going forward - existing subscriptions will remain on their current price point. See [Price Points Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-points) for more information on price points and moving subscriptions between price points. -Note: Custom price points are not able to be set as the default for a component. - -```go -UpdateDefaultPricePointForComponent( - ctx context.Context, - componentId int, +Note: Custom price points are not able to be set as the default for a component. + +```go +PromoteComponentPricePointToDefault( + ctx context.Context, + componentId int, pricePointId int) ( models.ApiResponse[models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | - -## Response Type - -[`models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | + +## Response Type + +[`models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 pricePointId := 10 -apiResponse, err := componentsController.UpdateDefaultPricePointForComponent(ctx, componentId, pricePointId) +apiResponse, err := componentsController.PromoteComponentPricePointToDefault(ctx, componentId, pricePointId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "id": 292609, - "name": "Text messages", - "pricing_scheme": "stairstep", - "unit_name": "text message", - "unit_price": null, - "product_family_id": 528484, - "price_per_unit_in_cents": null, - "kind": "metered_component", - "archived": false, - "taxable": false, - "description": null, - "created_at": "2019-08-02T05:54:53-04:00", - "prices": [ - { - "id": 47, - "component_id": 292609, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 173, - "formatted_unit_price": "$1.00" - } - ], - "default_price_point_name": "Original" - } -} -``` - - -# List Components for Product Family - -This request will return a list of components for a particular product family. - -```go -ListComponentsForProductFamily( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "id": 292609, + "name": "Text messages", + "pricing_scheme": "stairstep", + "unit_name": "text message", + "unit_price": null, + "product_family_id": 528484, + "price_per_unit_in_cents": null, + "kind": "metered_component", + "archived": false, + "taxable": false, + "description": null, + "created_at": "2019-08-02T05:54:53-04:00", + "prices": [ + { + "id": 47, + "component_id": 292609, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 173, + "formatted_unit_price": "$1.00" + } + ], + "default_price_point_name": "Original" + } +} +``` + + +# List Components for Product Family + +This request will return a list of components for a particular product family. + +```go +ListComponentsForProductFamily( ctx context.Context,input ListComponentsForProductFamilyInput) ( models.ApiResponse[[]models.ComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family | -| `includeArchived` | `*bool` | Query, Optional | Include archived items. | -| `filterIds` | `[]int` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2`. | -| `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`. | -| `perPage` | `*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`. | -| `dateField` | [`*models.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`. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | - -## Response Type - -[`[]models.ComponentResponse`](../../doc/models/component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family | +| `includeArchived` | `*bool` | Query, Optional | Include archived items. | +| `filterIds` | `[]int` | Query, Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2`. | +| `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`. | +| `perPage` | `*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`. | +| `dateField` | [`*models.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`. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | +| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | + +## Response Type + +[`[]models.ComponentResponse`](../../doc/models/component-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140Liquid error: Value cannot be null. (Parameter 'key') page := 2 @@ -1319,133 +1319,133 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "component": { - "id": 399850, - "name": "$1.00 component", - "pricing_scheme": "per_unit", - "unit_name": "Component", - "unit_price": "1.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "quantity_based_component", - "archived": false, - "taxable": false, - "description": "Component", - "default_price_point_id": 121000, - "prices": [ - { - "id": 630687, - "component_id": 399850, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 121000, - "formatted_unit_price": "$1.00" - } - ], - "price_point_count": 2, - "price_points_url": "https://general-goods.chargify.com/components/399850/price_points", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:38-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - }, - { - "component": { - "id": 399853, - "name": "Annual Support Services", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "100.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": true, - "description": "Prepay for support services", - "default_price_point_id": 121003, - "price_point_count": 4, - "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", - "tax_code": "D0000000", - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:37-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - }, - { - "component": { - "id": 386937, - "name": "Cancellation fee", - "pricing_scheme": null, - "unit_name": "on/off", - "unit_price": "35.0", - "product_family_id": 997233, - "price_per_unit_in_cents": null, - "kind": "on_off_component", - "archived": false, - "taxable": false, - "description": "", - "default_price_point_id": 108307, - "price_point_count": 1, - "price_points_url": "https://general-goods.chargify.com/components/386937/price_points", - "tax_code": null, - "recurring": true, - "upgrade_charge": null, - "downgrade_credit": null, - "created_at": "2019-08-01T09:35:38-04:00", - "default_price_point_name": "Original", - "product_family_name": "Chargify", - "use_site_exchange_rate": true - } - } -] -``` - - -# Create Component Price Point - -This endpoint can be used to create a new price point for an existing component. - -```go -CreateComponentPricePoint( - ctx context.Context, - componentId int, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "component": { + "id": 399850, + "name": "$1.00 component", + "pricing_scheme": "per_unit", + "unit_name": "Component", + "unit_price": "1.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "quantity_based_component", + "archived": false, + "taxable": false, + "description": "Component", + "default_price_point_id": 121000, + "prices": [ + { + "id": 630687, + "component_id": 399850, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 121000, + "formatted_unit_price": "$1.00" + } + ], + "price_point_count": 2, + "price_points_url": "https://general-goods.chargify.com/components/399850/price_points", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:38-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + }, + { + "component": { + "id": 399853, + "name": "Annual Support Services", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "100.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": true, + "description": "Prepay for support services", + "default_price_point_id": 121003, + "price_point_count": 4, + "price_points_url": "https://general-goods.chargify.com/components/399853/price_points", + "tax_code": "D0000000", + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:37-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + }, + { + "component": { + "id": 386937, + "name": "Cancellation fee", + "pricing_scheme": null, + "unit_name": "on/off", + "unit_price": "35.0", + "product_family_id": 997233, + "price_per_unit_in_cents": null, + "kind": "on_off_component", + "archived": false, + "taxable": false, + "description": "", + "default_price_point_id": 108307, + "price_point_count": 1, + "price_points_url": "https://general-goods.chargify.com/components/386937/price_points", + "tax_code": null, + "recurring": true, + "upgrade_charge": null, + "downgrade_credit": null, + "created_at": "2019-08-01T09:35:38-04:00", + "default_price_point_name": "Original", + "product_family_name": "Chargify", + "use_site_exchange_rate": true + } + } +] +``` + + +# Create Component Price Point + +This endpoint can be used to create a new price point for an existing component. + +```go +CreateComponentPricePoint( + ctx context.Context, + componentId int, body *models.CreateComponentPricePointRequest) ( models.ApiResponse[models.ComponentPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `body` | [`*models.CreateComponentPricePointRequest`](../../doc/models/create-component-price-point-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `body` | [`*models.CreateComponentPricePointRequest`](../../doc/models/create-component-price-point-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 @@ -1479,44 +1479,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# List Component Price Points - +} +``` + + +# List Component Price Points + Use this endpoint to read current price points that are 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. - -```go -ListComponentPricePoints( +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. + +```go +ListComponentPricePoints( ctx context.Context,input ListComponentPricePointsInput) ( models.ApiResponse[models.ComponentPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `currencyPrices` | `*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`. | -| `perPage` | `*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`. | -| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | - -## Response Type - -[`models.ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `currencyPrices` | `*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`. | +| `perPage` | `*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`. | +| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | + +## Response Type + +[`models.ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 page := 2 @@ -1529,86 +1529,86 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 80, - "default": false, - "name": "Wholesale Two", - "pricing_scheme": "per_unit", - "component_id": 74, - "handle": "wholesale-two", - "archived_at": null, - "created_at": "2017-07-05T13:55:40-04:00", - "updated_at": "2017-07-05T13:55:40-04:00", - "prices": [ - { - "id": 121, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "5.0" - } - ] - }, - { - "id": 81, - "default": false, - "name": "MSRP", - "pricing_scheme": "per_unit", - "component_id": 74, - "handle": "msrp", - "archived_at": null, - "created_at": "2017-07-05T13:55:40-04:00", - "updated_at": "2017-07-05T13:55:40-04:00", - "prices": [ - { - "id": 122, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "4.0" - } - ] - } - ] -} -``` - - -# Create Component Price Points - -Use this endpoint to create multiple component price points in one request. - -```go -CreateComponentPricePoints( - ctx context.Context, - componentId string, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 80, + "default": false, + "name": "Wholesale Two", + "pricing_scheme": "per_unit", + "component_id": 74, + "handle": "wholesale-two", + "archived_at": null, + "created_at": "2017-07-05T13:55:40-04:00", + "updated_at": "2017-07-05T13:55:40-04:00", + "prices": [ + { + "id": 121, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "5.0" + } + ] + }, + { + "id": 81, + "default": false, + "name": "MSRP", + "pricing_scheme": "per_unit", + "component_id": 74, + "handle": "msrp", + "archived_at": null, + "created_at": "2017-07-05T13:55:40-04:00", + "updated_at": "2017-07-05T13:55:40-04:00", + "prices": [ + { + "id": 122, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "4.0" + } + ] + } + ] +} +``` + + +# Bulk Create Component Price Points + +Use this endpoint to create multiple component price points in one request. + +```go +BulkCreateComponentPricePoints( + ctx context.Context, + componentId string, body *models.CreateComponentPricePointsRequest) ( models.ApiResponse[models.ComponentPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | The Chargify id of the component for which you want to fetch price points. | -| `body` | [`*models.CreateComponentPricePointsRequest`](../../doc/models/create-component-price-points-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | The Chargify id of the component for which you want to fetch price points. | +| `body` | [`*models.CreateComponentPricePointsRequest`](../../doc/models/create-component-price-points-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" @@ -1656,101 +1656,101 @@ body := models.CreateComponentPricePointsRequest{ PricePoints: bodyPricePoints, } -apiResponse, err := componentsController.CreateComponentPricePoints(ctx, componentId, &body) +apiResponse, err := componentsController.BulkCreateComponentPricePoints(ctx, componentId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 80, - "default": false, - "name": "Wholesale Two", - "pricing_scheme": "per_unit", - "component_id": 74, - "handle": "wholesale-two", - "archived_at": null, - "created_at": "2017-07-05T13:55:40-04:00", - "updated_at": "2017-07-05T13:55:40-04:00", - "prices": [ - { - "id": 121, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "5.0" - } - ] - }, - { - "id": 81, - "default": false, - "name": "MSRP", - "pricing_scheme": "per_unit", - "component_id": 74, - "handle": "msrp", - "archived_at": null, - "created_at": "2017-07-05T13:55:40-04:00", - "updated_at": "2017-07-05T13:55:40-04:00", - "prices": [ - { - "id": 122, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": null, - "unit_price": "4.0" - } - ] - } - ] -} -``` - - -# Update Component Price Point - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 80, + "default": false, + "name": "Wholesale Two", + "pricing_scheme": "per_unit", + "component_id": 74, + "handle": "wholesale-two", + "archived_at": null, + "created_at": "2017-07-05T13:55:40-04:00", + "updated_at": "2017-07-05T13:55:40-04:00", + "prices": [ + { + "id": 121, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "5.0" + } + ] + }, + { + "id": 81, + "default": false, + "name": "MSRP", + "pricing_scheme": "per_unit", + "component_id": 74, + "handle": "msrp", + "archived_at": null, + "created_at": "2017-07-05T13:55:40-04:00", + "updated_at": "2017-07-05T13:55:40-04:00", + "prices": [ + { + "id": 122, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": null, + "unit_price": "4.0" + } + ] + } + ] +} +``` + + +# Update Component Price Point + When updating a price point, it's prices can be updated as well by creating new prices or editing / removing existing ones. Passing in a price bracket without an `id` will attempt to create a new price. Including an `id` will update the corresponding price, and including the `_destroy` flag set to true along with the `id` will remove that price. -Note: Custom price points cannot be updated directly. They must be edited through the Subscription. - -```go -UpdateComponentPricePoint( - ctx context.Context, - componentId int, - pricePointId int, +Note: Custom price points cannot be updated directly. They must be edited through the Subscription. + +```go +UpdateComponentPricePoint( + ctx context.Context, + componentId int, + pricePointId int, body *models.UpdateComponentPricePointRequest) ( models.ApiResponse[models.ComponentPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | -| `body` | [`*models.UpdateComponentPricePointRequest`](../../doc/models/update-component-price-point-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | +| `body` | [`*models.UpdateComponentPricePointRequest`](../../doc/models/update-component-price-point-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 pricePointId := 10 @@ -1788,43 +1788,43 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# Archive Component Price Point - -A price point can be archived at any time. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point. - -```go -ArchiveComponentPricePoint( - ctx context.Context, - componentId int, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Archive Component Price Point + +A price point can be archived at any time. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point. + +```go +ArchiveComponentPricePoint( + ctx context.Context, + componentId int, pricePointId int) ( models.ApiResponse[models.ComponentPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | - -## Response Type - -[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | + +## Response Type + +[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 pricePointId := 10 @@ -1836,77 +1836,77 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 79, - "default": false, - "name": "Wholesale", - "pricing_scheme": "stairstep", - "component_id": 74, - "handle": "wholesale-handle", - "archived_at": "2017-07-06T15:04:00-04:00", - "created_at": "2017-07-05T13:44:30-04:00", - "updated_at": "2017-07-05T13:44:30-04:00", - "prices": [ - { - "id": 119, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": 100, - "unit_price": "5.0" - }, - { - "id": 120, - "component_id": 74, - "starting_quantity": 101, - "ending_quantity": null, - "unit_price": "4.0" - } - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Unarchive Component Price Point - -Use this endpoint to unarchive a component price point. - -```go -UnarchiveComponentPricePoint( - ctx context.Context, - componentId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 79, + "default": false, + "name": "Wholesale", + "pricing_scheme": "stairstep", + "component_id": 74, + "handle": "wholesale-handle", + "archived_at": "2017-07-06T15:04:00-04:00", + "created_at": "2017-07-05T13:44:30-04:00", + "updated_at": "2017-07-05T13:44:30-04:00", + "prices": [ + { + "id": 119, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": 100, + "unit_price": "5.0" + }, + { + "id": 120, + "component_id": 74, + "starting_quantity": 101, + "ending_quantity": null, + "unit_price": "4.0" + } + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Unarchive Component Price Point + +Use this endpoint to unarchive a component price point. + +```go +UnarchiveComponentPricePoint( + ctx context.Context, + componentId int, pricePointId int) ( models.ApiResponse[models.ComponentPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | - -## Response Type - -[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `int` | Template, Required | The Chargify id of the component to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | + +## Response Type + +[`models.ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := 222 pricePointId := 10 @@ -1918,75 +1918,75 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 79, - "default": false, - "name": "Wholesale", - "pricing_scheme": "stairstep", - "component_id": 74, - "handle": "wholesale-handle", - "archived_at": null, - "created_at": "2017-07-05T13:44:30-04:00", - "updated_at": "2017-07-05T13:44:30-04:00", - "prices": [ - { - "id": 119, - "component_id": 74, - "starting_quantity": 1, - "ending_quantity": 100, - "unit_price": "5.0" - }, - { - "id": 120, - "component_id": 74, - "starting_quantity": 101, - "ending_quantity": null, - "unit_price": "4.0" - } - ] - } -} -``` - - -# Create Currency Prices - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 79, + "default": false, + "name": "Wholesale", + "pricing_scheme": "stairstep", + "component_id": 74, + "handle": "wholesale-handle", + "archived_at": null, + "created_at": "2017-07-05T13:44:30-04:00", + "updated_at": "2017-07-05T13:44:30-04:00", + "prices": [ + { + "id": 119, + "component_id": 74, + "starting_quantity": 1, + "ending_quantity": 100, + "unit_price": "5.0" + }, + { + "id": 120, + "component_id": 74, + "starting_quantity": 101, + "ending_quantity": null, + "unit_price": "4.0" + } + ] + } +} +``` + + +# Create Currency Prices + This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. When creating currency prices, they need to mirror the structure of your primary pricing. For each price level defined on the component price point, there should be a matching price level created in the given currency. -Note: Currency Prices are not able to be created for custom price points. - -```go -CreateCurrencyPrices( - ctx context.Context, - pricePointId int, +Note: Currency Prices are not able to be created for custom price points. + +```go +CreateCurrencyPrices( + ctx context.Context, + pricePointId int, body *models.CreateCurrencyPricesRequest) ( models.ApiResponse[models.ComponentCurrencyPricesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | -| `body` | [`*models.CreateCurrencyPricesRequest`](../../doc/models/create-currency-prices-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | +| `body` | [`*models.CreateCurrencyPricesRequest`](../../doc/models/create-currency-prices-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) + +## Example Usage + +```go ctx := context.Background() pricePointId := 10 @@ -2014,62 +2014,62 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "currency_prices": [ - { - "id": 100, - "currency": "EUR", - "price": "123", - "formatted_price": "€123,00", - "price_id": 32669, - "price_point_id": 25554 - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# Update Currency Prices - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "currency_prices": [ + { + "id": 100, + "currency": "EUR", + "price": "123", + "formatted_price": "€123,00", + "price_id": 32669, + "price_point_id": 25554 + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Update Currency Prices + This endpoint allows you to update currency prices for a given currency that has been defined on the site level in your settings. -Note: Currency Prices are not able to be updated for custom price points. - -```go -UpdateCurrencyPrices( - ctx context.Context, - pricePointId int, +Note: Currency Prices are not able to be updated for custom price points. + +```go +UpdateCurrencyPrices( + ctx context.Context, + pricePointId int, body *models.UpdateCurrencyPricesRequest) ( models.ApiResponse[models.ComponentCurrencyPricesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | -| `body` | [`*models.UpdateCurrencyPricesRequest`](../../doc/models/update-currency-prices-request.md) | Body, Optional | - | - -## Response Type - -[`models.ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `pricePointId` | `int` | Template, Required | The Chargify id of the price point | +| `body` | [`*models.UpdateCurrencyPricesRequest`](../../doc/models/update-currency-prices-request.md) | Body, Optional | - | + +## Response Type + +[`models.ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) + +## Example Usage + +```go ctx := context.Background() pricePointId := 10 @@ -2095,68 +2095,68 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "currency_prices": [ - { - "id": 100, - "currency": "EUR", - "price": "123", - "formatted_price": "€123,00", - "price_id": 32669, - "price_point_id": 25554 - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# List All Component Price Points - -This method allows to retrieve a list of Components Price Points belonging to a Site. - -```go -ListAllComponentPricePoints( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "currency_prices": [ + { + "id": 100, + "currency": "EUR", + "price": "123", + "formatted_price": "€123,00", + "price_id": 32669, + "price_point_id": 25554 + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# List All Component Price Points + +This method allows to retrieve a list of Components Price Points belonging to a Site. + +```go +ListAllComponentPricePoints( ctx context.Context,input ListAllComponentPricePointsInput) ( models.ApiResponse[models.ListComponentsPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query: `filter[date_field]=created_at`. | -| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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` | [`*models.ListComponentsPricePointsInclude`](../../doc/models/list-components-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `*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`. | -| `perPage` | `*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`. | -| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | -| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `filterIds` | `[]int` | Query, Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | -| `filterArchivedAt` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | - -## Response Type - -[`models.ListComponentsPricePointsResponse`](../../doc/models/list-components-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query: `filter[date_field]=created_at`. | +| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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` | [`*models.ListComponentsPricePointsInclude`](../../doc/models/list-components-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | +| `page` | `*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`. | +| `perPage` | `*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`. | +| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | +| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | +| `filterIds` | `[]int` | Query, Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | +| `filterArchivedAt` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | + +## Response Type + +[`models.ListComponentsPricePointsResponse`](../../doc/models/list-components-price-points-response.md) + +## Example Usage + +```go ctx := context.Background()Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key') include := models.ListComponentsPricePointsInclude("currency_prices") page := 2 @@ -2169,45 +2169,45 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 1, - "name": "Auto-created", - "type": "default", - "pricing_scheme": "per_unit", - "component_id": 2, - "handle": "auto-created", - "archived_at": null, - "created_at": "2021-02-21T11:05:57-05:00", - "updated_at": "2021-02-21T11:05:57-05:00", - "prices": [ - { - "id": 3, - "component_id": 2, - "starting_quantity": 0, - "ending_quantity": null, - "unit_price": "1.0", - "price_point_id": 1, - "formatted_unit_price": "$1.00", - "segment_id": null - } - ], - "tax_included": false - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 1, + "name": "Auto-created", + "type": "default", + "pricing_scheme": "per_unit", + "component_id": 2, + "handle": "auto-created", + "archived_at": null, + "created_at": "2021-02-21T11:05:57-05:00", + "updated_at": "2021-02-21T11:05:57-05:00", + "prices": [ + { + "id": 3, + "component_id": 2, + "starting_quantity": 0, + "ending_quantity": null, + "unit_price": "1.0", + "price_point_id": 1, + "formatted_unit_price": "$1.00", + "segment_id": null + } + ], + "tax_included": false + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 65faaf98..3296f090 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -1,33 +1,33 @@ -# Coupons - -```go -couponsController := client.CouponsController() -``` - -## Class Name - -`CouponsController` - -## Methods - +# Coupons + +```go +couponsController := client.CouponsController() +``` + +## Class Name + +`CouponsController` + +## Methods + * [Create Coupon](../../doc/controllers/coupons.md#create-coupon) * [List Coupons for Product Family](../../doc/controllers/coupons.md#list-coupons-for-product-family) -* [Read Coupon by Code](../../doc/controllers/coupons.md#read-coupon-by-code) +* [Find Coupon](../../doc/controllers/coupons.md#find-coupon) * [Read Coupon](../../doc/controllers/coupons.md#read-coupon) * [Update Coupon](../../doc/controllers/coupons.md#update-coupon) * [Archive Coupon](../../doc/controllers/coupons.md#archive-coupon) * [List Coupons](../../doc/controllers/coupons.md#list-coupons) * [Read Coupon Usage](../../doc/controllers/coupons.md#read-coupon-usage) * [Validate Coupon](../../doc/controllers/coupons.md#validate-coupon) -* [Update Coupon Currency Prices](../../doc/controllers/coupons.md#update-coupon-currency-prices) +* [Create or Update Coupon Currency Prices](../../doc/controllers/coupons.md#create-or-update-coupon-currency-prices) * [Create Coupon Subcodes](../../doc/controllers/coupons.md#create-coupon-subcodes) * [List Coupon Subcodes](../../doc/controllers/coupons.md#list-coupon-subcodes) * [Update Coupon Subcodes](../../doc/controllers/coupons.md#update-coupon-subcodes) -* [Delete Coupon Subcode](../../doc/controllers/coupons.md#delete-coupon-subcode) - - -# Create Coupon - +* [Delete Coupon Subcode](../../doc/controllers/coupons.md#delete-coupon-subcode) + + +# Create Coupon + ## Coupons Documentation Coupons can be administered in the Chargify application or created via API. Please view our section on [creating coupons](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404742830733) for more information. @@ -41,31 +41,31 @@ This request will create a coupon, based on the provided information. When creating a coupon, you must specify a product family using the `product_family_id`. If no `product_family_id` is passed, the first product family available is used. You will also need to formulate your URL to cite the Product Family ID in your request. 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 }` - -```go -CreateCoupon( - ctx context.Context, - productFamilyId int, +`{ "": boolean_value }` + +```go +CreateCoupon( + ctx context.Context, + productFamilyId int, body *models.CreateOrUpdateCoupon) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `body` | [`*models.CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `body` | [`*models.CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -87,53 +87,53 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Coupons for Product Family - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Coupons for Product Family + List coupons for a specific Product Family in a Site. -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. - -```go -ListCouponsForProductFamily( +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. + +```go +ListCouponsForProductFamily( ctx context.Context,input ListCouponsForProductFamilyInput) ( models.ApiResponse[[]models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `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`. | -| `perPage` | `*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`. | -| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `filter[date_field]=created_at`. | -| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[date_field]=2011-12-15`. | -| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `?filter[end_datetime]=2011-12-1T10:15:30+01:00`. | -| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons 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-17`. | -| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | -| `filterIds` | `[]int` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | -| `filterCodes` | `[]string` | Query, Optional | Allows fetching coupons with matching codes based on provided values. Use in query `filter[codes]=free,free_trial`. | -| `currencyPrices` | `*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`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | - -## Response Type - -[`[]models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `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`. | +| `perPage` | `*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`. | +| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `filter[date_field]=created_at`. | +| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[date_field]=2011-12-15`. | +| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `?filter[end_datetime]=2011-12-1T10:15:30+01:00`. | +| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons 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-17`. | +| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | +| `filterIds` | `[]int` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | +| `filterCodes` | `[]string` | Query, Optional | Allows fetching coupons with matching codes based on provided values. Use in query `filter[codes]=free,free_trial`. | +| `currencyPrices` | `*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`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | + +## Response Type + +[`[]models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 page := 2 @@ -147,177 +147,177 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "coupon": { - "id": 999999, - "name": "50% coupon", - "code": "50PERCENT", - "description": "50 PERCENT OFF", - "amount_in_cents": null, - "product_family_id": 527890, - "created_at": "2016-10-21T17:02:08-04:00", - "updated_at": "2016-10-21T17:06:11-04:00", - "start_date": "2016-10-21T17:02:08-04:00", - "end_date": null, - "percentage": "50", - "recurring": true, - "duration_period_count": null, - "duration_interval": 1, - "duration_interval_unit": "day", - "allow_negative_balance": true, - "archived_at": null, - "conversion_limit": "100", - "stackable": false, - "compounding_strategy": "compound", - "coupon_restrictions": [], - "use_site_exchange_rate": true - } - }, - { - "coupon": { - "id": 123456, - "name": "100% coupon", - "code": "100PERCENT", - "description": "100 PERCENT OFF", - "amount_in_cents": null, - "product_family_id": 527890, - "created_at": "2016-10-21T17:02:08-04:00", - "updated_at": "2016-10-21T17:06:11-04:00", - "start_date": "2016-10-21T17:02:08-04:00", - "end_date": null, - "percentage": "50", - "recurring": true, - "duration_period_count": null, - "duration_interval": 1, - "duration_interval_unit": "day", - "allow_negative_balance": true, - "archived_at": null, - "conversion_limit": "100", - "stackable": false, - "compounding_strategy": "compound", - "coupon_restrictions": [], - "use_site_exchange_rate": true - } - }, - { - "coupon": { - "id": 888888, - "name": "25% coupon", - "code": "25PERCENT", - "description": "25 PERCENT OFF", - "amount_in_cents": null, - "product_family_id": 527890, - "created_at": "2016-10-21T17:02:08-04:00", - "updated_at": "2016-10-21T17:06:11-04:00", - "start_date": "2016-10-21T17:02:08-04:00", - "end_date": null, - "percentage": "25", - "recurring": true, - "duration_period_count": null, - "duration_interval": 1, - "duration_interval_unit": "day", - "allow_negative_balance": true, - "archived_at": null, - "conversion_limit": "100", - "stackable": false, - "compounding_strategy": "compound", - "coupon_restrictions": [ - { - "id": 37, - "item_type": "Component", - "item_id": 519, - "name": "test", - "handle": null - } - ], - "use_site_exchange_rate": true - } - } -] -``` - - -# Read Coupon by Code - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "coupon": { + "id": 999999, + "name": "50% coupon", + "code": "50PERCENT", + "description": "50 PERCENT OFF", + "amount_in_cents": null, + "product_family_id": 527890, + "created_at": "2016-10-21T17:02:08-04:00", + "updated_at": "2016-10-21T17:06:11-04:00", + "start_date": "2016-10-21T17:02:08-04:00", + "end_date": null, + "percentage": "50", + "recurring": true, + "duration_period_count": null, + "duration_interval": 1, + "duration_interval_unit": "day", + "allow_negative_balance": true, + "archived_at": null, + "conversion_limit": "100", + "stackable": false, + "compounding_strategy": "compound", + "coupon_restrictions": [], + "use_site_exchange_rate": true + } + }, + { + "coupon": { + "id": 123456, + "name": "100% coupon", + "code": "100PERCENT", + "description": "100 PERCENT OFF", + "amount_in_cents": null, + "product_family_id": 527890, + "created_at": "2016-10-21T17:02:08-04:00", + "updated_at": "2016-10-21T17:06:11-04:00", + "start_date": "2016-10-21T17:02:08-04:00", + "end_date": null, + "percentage": "50", + "recurring": true, + "duration_period_count": null, + "duration_interval": 1, + "duration_interval_unit": "day", + "allow_negative_balance": true, + "archived_at": null, + "conversion_limit": "100", + "stackable": false, + "compounding_strategy": "compound", + "coupon_restrictions": [], + "use_site_exchange_rate": true + } + }, + { + "coupon": { + "id": 888888, + "name": "25% coupon", + "code": "25PERCENT", + "description": "25 PERCENT OFF", + "amount_in_cents": null, + "product_family_id": 527890, + "created_at": "2016-10-21T17:02:08-04:00", + "updated_at": "2016-10-21T17:06:11-04:00", + "start_date": "2016-10-21T17:02:08-04:00", + "end_date": null, + "percentage": "25", + "recurring": true, + "duration_period_count": null, + "duration_interval": 1, + "duration_interval_unit": "day", + "allow_negative_balance": true, + "archived_at": null, + "conversion_limit": "100", + "stackable": false, + "compounding_strategy": "compound", + "coupon_restrictions": [ + { + "id": 37, + "item_type": "Component", + "item_id": 519, + "name": "test", + "handle": null + } + ], + "use_site_exchange_rate": true + } + } +] +``` + + +# Find Coupon + You can search for a coupon via the API with the find method. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If no coupon is found, a 404 is returned. -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. - -```go -ReadCouponByCode( - ctx context.Context, - productFamilyId *int, +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. + +```go +FindCoupon( + ctx context.Context, + productFamilyId *int, code *string) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `*int` | Query, Optional | The Chargify id of the product family to which the coupon belongs | -| `code` | `*string` | Query, Optional | The code of the coupon | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `*int` | Query, Optional | The Chargify id of the product family to which the coupon belongs | +| `code` | `*string` | Query, Optional | The code of the coupon | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() -apiResponse, err := couponsController.ReadCouponByCode(ctx, nil, nil) +apiResponse, err := couponsController.FindCoupon(ctx, nil, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Read Coupon - +} +``` + + +# Read Coupon + You can retrieve the Coupon via the API with the Show method. You must identify the Coupon in this call by the ID parameter that Chargify 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. - -```go -ReadCoupon( - ctx context.Context, - productFamilyId int, +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. + +```go +ReadCoupon( + ctx context.Context, + productFamilyId int, couponId int) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 couponId := 162 @@ -329,74 +329,74 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "coupon": { - "id": 67, - "name": "Foo Bar", - "code": "YEPPER99934", - "description": "my cool coupon", - "amount_in_cents": null, - "product_family_id": 4, - "product_family_name": "Billing Plans", - "created_at": "2017-11-08T10:01:15-05:00", - "updated_at": "2017-11-08T10:01:15-05:00", - "start_date": "2017-11-08T10:01:15-05:00", - "end_date": null, - "percentage": "33.3333", - "duration_period_count": null, - "duration_interval": null, - "duration_interval_unit": null, - "allow_negative_balance": false, - "archived_at": null, - "conversion_limit": null, - "stackable": true, - "compounding_strategy": "compound", - "coupon_restrictions": [] - } -} -``` - - -# Update Coupon - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "coupon": { + "id": 67, + "name": "Foo Bar", + "code": "YEPPER99934", + "description": "my cool coupon", + "amount_in_cents": null, + "product_family_id": 4, + "product_family_name": "Billing Plans", + "created_at": "2017-11-08T10:01:15-05:00", + "updated_at": "2017-11-08T10:01:15-05:00", + "start_date": "2017-11-08T10:01:15-05:00", + "end_date": null, + "percentage": "33.3333", + "duration_period_count": null, + "duration_interval": null, + "duration_interval_unit": null, + "allow_negative_balance": false, + "archived_at": null, + "conversion_limit": null, + "stackable": true, + "compounding_strategy": "compound", + "coupon_restrictions": [] + } +} +``` + + +# Update Coupon + ## Update Coupon You can update a Coupon via the API with a PUT request to the resource endpoint. 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 }` - -```go -UpdateCoupon( - ctx context.Context, - productFamilyId int, - couponId int, +`{ "": boolean_value }` + +```go +UpdateCoupon( + ctx context.Context, + productFamilyId int, + couponId int, body *models.CreateOrUpdateCoupon) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | -| `body` | [`*models.CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | +| `body` | [`*models.CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 couponId := 162 @@ -419,69 +419,69 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "coupon": { - "id": 67, - "name": "Foo Bar", - "code": "YEPPER99934", - "description": "my cool coupon", - "amount_in_cents": 10000, - "product_family_id": 4, - "created_at": "2017-11-08T10:01:15-05:00", - "updated_at": "2017-11-08T10:01:15-05:00", - "start_date": "2017-11-08T10:01:15-05:00", - "end_date": null, - "percentage": null, - "recurring": false, - "duration_period_count": null, - "duration_interval": null, - "duration_interval_unit": null, - "allow_negative_balance": false, - "archived_at": null, - "conversion_limit": null, - "stackable": true, - "compounding_strategy": "compound", - "coupon_restrictions": [] - } -} -``` - - -# Archive Coupon - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "coupon": { + "id": 67, + "name": "Foo Bar", + "code": "YEPPER99934", + "description": "my cool coupon", + "amount_in_cents": 10000, + "product_family_id": 4, + "created_at": "2017-11-08T10:01:15-05:00", + "updated_at": "2017-11-08T10:01:15-05:00", + "start_date": "2017-11-08T10:01:15-05:00", + "end_date": null, + "percentage": null, + "recurring": false, + "duration_period_count": null, + "duration_interval": null, + "duration_interval_unit": null, + "allow_negative_balance": false, + "archived_at": null, + "conversion_limit": null, + "stackable": true, + "compounding_strategy": "compound", + "coupon_restrictions": [] + } +} +``` + + +# Archive Coupon + You can archive a Coupon via the API with the archive method. 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. - -```go -ArchiveCoupon( - ctx context.Context, - productFamilyId int, +The `archived_at` date and time will be assigned. + +```go +ArchiveCoupon( + ctx context.Context, + productFamilyId int, couponId int) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 couponId := 162 @@ -493,81 +493,81 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "coupon": { - "id": 67, - "name": "Foo Bar", - "code": "YEPPER99934", - "description": "my cool coupon", - "amount_in_cents": 10000, - "product_family_id": 4, - "created_at": "2017-11-08T10:01:15-05:00", - "updated_at": "2017-11-08T10:01:15-05:00", - "start_date": "2017-11-08T10:01:15-05:00", - "end_date": null, - "percentage": null, - "recurring": false, - "duration_period_count": null, - "duration_interval": null, - "duration_interval_unit": null, - "allow_negative_balance": false, - "archived_at": "2016-12-02T13:09:33-05:00", - "conversion_limit": null, - "stackable": true, - "compounding_strategy": "compound", - "coupon_restrictions": [] - } -} -``` - - -# List Coupons - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "coupon": { + "id": 67, + "name": "Foo Bar", + "code": "YEPPER99934", + "description": "my cool coupon", + "amount_in_cents": 10000, + "product_family_id": 4, + "created_at": "2017-11-08T10:01:15-05:00", + "updated_at": "2017-11-08T10:01:15-05:00", + "start_date": "2017-11-08T10:01:15-05:00", + "end_date": null, + "percentage": null, + "recurring": false, + "duration_period_count": null, + "duration_interval": null, + "duration_interval_unit": null, + "allow_negative_balance": false, + "archived_at": "2016-12-02T13:09:33-05:00", + "conversion_limit": null, + "stackable": true, + "compounding_strategy": "compound", + "coupon_restrictions": [] + } +} +``` + + +# List Coupons + You can retrieve a list of coupons. -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. - -```go -ListCoupons( +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. + +```go +ListCoupons( ctx context.Context,input ListCouponsInput) ( models.ApiResponse[[]models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[date_field] instead to achieve the same result. The type of filter you would like to apply to your search. | -| `startDate` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_date] instead to achieve the same result. The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_date] instead to achieve the same result. The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `startDatetime` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_datetime] instead to achieve the same result. The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `endDatetime` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_datetime] instead to achieve the same result. The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | -| `filterIds` | `[]int` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | -| `filterCodes` | `[]string` | Query, Optional | Allows fetching coupons with matching code based on provided values. Use in query `filter[ids]=1,2,3`. | -| `currencyPrices` | `*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`. | -| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-17`. | -| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-19T10:15:30+01:00`. | -| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons 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-19`. | -| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | -| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `filter[date_field]=updated_at`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | - -## Response Type - -[`[]models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[date_field] instead to achieve the same result. The type of filter you would like to apply to your search. | +| `startDate` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_date] instead to achieve the same result. The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_date] instead to achieve the same result. The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `startDatetime` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[start_datetime] instead to achieve the same result. The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | +| `endDatetime` | `*time.Time` | Query, Optional | The field was deprecated: on January 20, 2022. We recommend using filter[end_datetime] instead to achieve the same result. The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | +| `filterIds` | `[]int` | Query, Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`. | +| `filterCodes` | `[]string` | Query, Optional | Allows fetching coupons with matching code based on provided values. Use in query `filter[ids]=1,2,3`. | +| `currencyPrices` | `*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`. | +| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-17`. | +| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-19T10:15:30+01:00`. | +| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons 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-19`. | +| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | +| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `filter[date_field]=updated_at`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | + +## Response Type + +[`[]models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -593,85 +593,85 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "coupon": { - "id": 0, - "name": "string", - "code": "string", - "description": "string", - "amount": 0, - "amount_in_cents": 0, - "product_family_id": 0, - "product_family_name": "string", - "start_date": "string", - "end_date": "string", - "percentage": "10", - "recurring": true, - "recurring_scheme": "do_not_recur", - "duration_period_count": 0, - "duration_interval": 0, - "duration_interval_unit": "string", - "duration_interval_span": "string", - "allow_negative_balance": true, - "archived_at": "string", - "conversion_limit": "string", - "stackable": true, - "compounding_strategy": "compound", - "use_site_exchange_rate": true, - "created_at": "string", - "updated_at": "string", - "discount_type": "amount", - "exclude_mid_period_allocations": true, - "apply_on_cancel_at_end_of_period": true, - "coupon_restrictions": [ - { - "id": 0, - "item_type": "Component", - "item_id": 0, - "name": "string", - "handle": "string" - } - ] - } - } -] -``` - - -# Read Coupon Usage - -This request will provide details about the coupon usage as an array of data hashes, one per product. - -```go -ReadCouponUsage( - ctx context.Context, - productFamilyId int, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "coupon": { + "id": 0, + "name": "string", + "code": "string", + "description": "string", + "amount": 0, + "amount_in_cents": 0, + "product_family_id": 0, + "product_family_name": "string", + "start_date": "string", + "end_date": "string", + "percentage": "10", + "recurring": true, + "recurring_scheme": "do_not_recur", + "duration_period_count": 0, + "duration_interval": 0, + "duration_interval_unit": "string", + "duration_interval_span": "string", + "allow_negative_balance": true, + "archived_at": "string", + "conversion_limit": "string", + "stackable": true, + "compounding_strategy": "compound", + "use_site_exchange_rate": true, + "created_at": "string", + "updated_at": "string", + "discount_type": "amount", + "exclude_mid_period_allocations": true, + "apply_on_cancel_at_end_of_period": true, + "coupon_restrictions": [ + { + "id": 0, + "item_type": "Component", + "item_id": 0, + "name": "string", + "handle": "string" + } + ] + } + } +] +``` + + +# Read Coupon Usage + +This request will provide details about the coupon usage as an array of data hashes, one per product. + +```go +ReadCouponUsage( + ctx context.Context, + productFamilyId int, couponId int) ( models.ApiResponse[[]models.CouponUsage], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | - -## Response Type - -[`[]models.CouponUsage`](../../doc/models/coupon-usage.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the coupon belongs | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | + +## Response Type + +[`[]models.CouponUsage`](../../doc/models/coupon-usage.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 couponId := 162 @@ -683,46 +683,46 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "name": "No cost product", - "id": 3903594, - "signups": 0, - "savings": 0, - "savings_in_cents": 0, - "revenue": 0, - "revenue_in_cents": 0 - }, - { - "name": "Product that expires", - "id": 3853680, - "signups": 0, - "savings": 0, - "savings_in_cents": 0, - "revenue": 0, - "revenue_in_cents": 0 - }, - { - "name": "Trial Product", - "id": 3861800, - "signups": 1, - "savings": 30, - "savings_in_cents": 3000, - "revenue": 20, - "revenue_in_cents": 2000 - } -] -``` - - -# Validate Coupon - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "name": "No cost product", + "id": 3903594, + "signups": 0, + "savings": 0, + "savings_in_cents": 0, + "revenue": 0, + "revenue_in_cents": 0 + }, + { + "name": "Product that expires", + "id": 3853680, + "signups": 0, + "savings": 0, + "savings_in_cents": 0, + "revenue": 0, + "revenue_in_cents": 0 + }, + { + "name": "Trial Product", + "id": 3861800, + "signups": 1, + "savings": 30, + "savings_in_cents": 3000, + "revenue": 20, + "revenue_in_cents": 2000 + } +] +``` + + +# Validate Coupon + You can verify if a specific coupon code is valid using the `validate` method. 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: @@ -743,31 +743,31 @@ Or: ``` https://.chargify.com/coupons/validate.?code=&product_family_id= -``` - -```go -ValidateCoupon( - ctx context.Context, - code string, +``` + +```go +ValidateCoupon( + ctx context.Context, + code string, productFamilyId *int) ( models.ApiResponse[models.CouponResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `code` | `string` | Query, Required | The code of the coupon | -| `productFamilyId` | `*int` | Query, Optional | The Chargify id of the product family to which the coupon belongs | - -## Response Type - -[`models.CouponResponse`](../../doc/models/coupon-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `code` | `string` | Query, Required | The code of the coupon | +| `productFamilyId` | `*int` | Query, Optional | The Chargify id of the product family to which the coupon belongs | + +## Response Type + +[`models.CouponResponse`](../../doc/models/coupon-response.md) + +## Example Usage + +```go ctx := context.Background() code := "code8" @@ -778,75 +778,75 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "coupon": { - "id": 66, - "name": "Foo Bar", - "code": "YEPPER9993", - "description": "my cool coupon", - "amount_in_cents": 10000, - "product_family_id": 4, - "created_at": "2017-11-07T14:51:52-05:00", - "updated_at": "2017-11-07T15:14:24-05:00", - "start_date": "2017-11-07T14:51:52-05:00", - "end_date": null, - "percentage": null, - "recurring": false, - "duration_period_count": null, - "duration_interval": null, - "duration_interval_unit": null, - "allow_negative_balance": false, - "archived_at": null, - "conversion_limit": null, - "stackable": true, - "compounding_strategy": "full-price", - "coupon_restrictions": [] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | - - -# Update Coupon Currency Prices - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "coupon": { + "id": 66, + "name": "Foo Bar", + "code": "YEPPER9993", + "description": "my cool coupon", + "amount_in_cents": 10000, + "product_family_id": 4, + "created_at": "2017-11-07T14:51:52-05:00", + "updated_at": "2017-11-07T15:14:24-05:00", + "start_date": "2017-11-07T14:51:52-05:00", + "end_date": null, + "percentage": null, + "recurring": false, + "duration_period_count": null, + "duration_interval": null, + "duration_interval_unit": null, + "allow_negative_balance": false, + "archived_at": null, + "conversion_limit": null, + "stackable": true, + "compounding_strategy": "full-price", + "coupon_restrictions": [] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | + + +# Create or Update Coupon Currency Prices + This endpoint allows you to create and/or update 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 an amount-based coupon, not percentage. -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. - -```go -UpdateCouponCurrencyPrices( - ctx context.Context, - couponId int, +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. + +```go +CreateOrUpdateCouponCurrencyPrices( + ctx context.Context, + couponId int, body *models.CouponCurrencyRequest) ( models.ApiResponse[models.CouponCurrencyResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | -| `body` | [`*models.CouponCurrencyRequest`](../../doc/models/coupon-currency-request.md) | Body, Optional | - | - -## Response Type - -[`models.CouponCurrencyResponse`](../../doc/models/coupon-currency-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | +| `body` | [`*models.CouponCurrencyRequest`](../../doc/models/coupon-currency-request.md) | Body, Optional | - | + +## Response Type + +[`models.CouponCurrencyResponse`](../../doc/models/coupon-currency-response.md) + +## Example Usage + +```go ctx := context.Background() couponId := 162 @@ -865,19 +865,19 @@ body := models.CouponCurrencyRequest{ CurrencyPrices: bodyCurrencyPrices, } -apiResponse, err := couponsController.UpdateCouponCurrencyPrices(ctx, couponId, &body) +apiResponse, err := couponsController.CreateOrUpdateCouponCurrencyPrices(ctx, couponId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Create Coupon Subcodes - +} +``` + + +# Create Coupon Subcodes + ## Coupon Subcodes Intro Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. @@ -917,31 +917,31 @@ 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.` - -```go -CreateCouponSubcodes( - ctx context.Context, - couponId int, +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.` + +```go +CreateCouponSubcodes( + ctx context.Context, + couponId int, body *models.CouponSubcodes) ( models.ApiResponse[models.CouponSubcodesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | -| `body` | [`*models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) | Body, Optional | - | - -## Response Type - -[`models.CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | +| `body` | [`*models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) | Body, Optional | - | + +## Response Type + +[`models.CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) + +## Example Usage + +```go ctx := context.Background() couponId := 162 @@ -956,50 +956,50 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "created_codes": [ - "BALTIMOREFALL", - "ORLANDOFALL", - "DETROITFALL" - ], - "duplicate_codes": [], - "invalid_codes": [] -} -``` - - -# List Coupon Subcodes - -This request allows you to request the subcodes that are attached to a coupon. - -```go -ListCouponSubcodes( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "created_codes": [ + "BALTIMOREFALL", + "ORLANDOFALL", + "DETROITFALL" + ], + "duplicate_codes": [], + "invalid_codes": [] +} +``` + + +# List Coupon Subcodes + +This request allows you to request the subcodes that are attached to a coupon. + +```go +ListCouponSubcodes( ctx context.Context,input ListCouponSubcodesInput) ( models.ApiResponse[models.CouponSubcodes], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | -| `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | +| `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) + +## Example Usage + +```go ctx := context.Background() couponId := 162 page := 2 @@ -1012,41 +1012,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "codes": [ - "3JU6PR", - "9RO6MP", - "8OG1VV", - "5FL7VV", - "2SV8XK", - "4LW8LH", - "3VL4GZ", - "9UI9XO", - "0LZ0CC", - "8XI9JV", - "9UV5YE", - "3UI4GX", - "6SL5ST", - "9WC8IJ", - "2KA3PZ", - "7WR1VR", - "3VY7MN", - "6KC3KB", - "7DF7YT", - "9FH1ED" - ] -} -``` - - -# Update Coupon Subcodes - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "codes": [ + "3JU6PR", + "9RO6MP", + "8OG1VV", + "5FL7VV", + "2SV8XK", + "4LW8LH", + "3VL4GZ", + "9UI9XO", + "0LZ0CC", + "8XI9JV", + "9UV5YE", + "3UI4GX", + "6SL5ST", + "9WC8IJ", + "2KA3PZ", + "7WR1VR", + "3VY7MN", + "6KC3KB", + "7DF7YT", + "9FH1ED" + ] +} +``` + + +# Update Coupon Subcodes + You can update the subcodes for the given Coupon via the API with a PUT request to the resource endpoint. Send an array of new coupon subcodes. @@ -1057,31 +1057,31 @@ The response will contain: + Subcodes that were not created because they already exist, -+ Any subcodes not created because they are invalid. - -```go -UpdateCouponSubcodes( - ctx context.Context, - couponId int, ++ Any subcodes not created because they are invalid. + +```go +UpdateCouponSubcodes( + ctx context.Context, + couponId int, body *models.CouponSubcodes) ( models.ApiResponse[models.CouponSubcodesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon | -| `body` | [`*models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) | Body, Optional | - | - -## Response Type - -[`models.CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon | +| `body` | [`*models.CouponSubcodes`](../../doc/models/coupon-subcodes.md) | Body, Optional | - | + +## Response Type + +[`models.CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) + +## Example Usage + +```go ctx := context.Background() couponId := 162 @@ -1096,12 +1096,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Delete Coupon Subcode - +} +``` + + +# Delete Coupon Subcode + ## Example Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to `DELETE` this coupon subcode would be: @@ -1123,31 +1123,31 @@ 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. - -```go -DeleteCouponSubcode( - ctx context.Context, - couponId int, +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. + +```go +DeleteCouponSubcode( + ctx context.Context, + couponId int, subcode string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `couponId` | `int` | Template, Required | The Chargify id of the coupon to which the subcode belongs | -| `subcode` | `string` | Template, Required | The subcode of the coupon | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `couponId` | `int` | Template, Required | The Chargify id of the coupon to which the subcode belongs | +| `subcode` | `string` | Template, Required | The subcode of the coupon | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() couponId := 162 subcode := "subcode4" @@ -1157,12 +1157,12 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 46734643..489c65b6 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -1,15 +1,15 @@ -# Custom Fields - -```go -customFieldsController := client.CustomFieldsController() -``` - -## Class Name - -`CustomFieldsController` - -## Methods - +# Custom Fields + +```go +customFieldsController := client.CustomFieldsController() +``` + +## Class Name + +`CustomFieldsController` + +## Methods + * [Create Metafields](../../doc/controllers/custom-fields.md#create-metafields) * [List Metafields](../../doc/controllers/custom-fields.md#list-metafields) * [Update Metafield](../../doc/controllers/custom-fields.md#update-metafield) @@ -18,11 +18,11 @@ customFieldsController := client.CustomFieldsController() * [List Metadata](../../doc/controllers/custom-fields.md#list-metadata) * [Update Metadata](../../doc/controllers/custom-fields.md#update-metadata) * [Delete Metadata](../../doc/controllers/custom-fields.md#delete-metadata) -* [List Metadata for Resource Type](../../doc/controllers/custom-fields.md#list-metadata-for-resource-type) - - -# Create Metafields - +* [List Metadata for Resource Type](../../doc/controllers/custom-fields.md#list-metadata-for-resource-type) + + +# Create Metafields + ## Custom Fields: Metafield Intro **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. @@ -46,31 +46,31 @@ It is possible to create Metafields “on the fly” when you create your Metada ### Metafield Scope Warning -If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields with the scope attribute – **if a partial update is sent it will overwrite the current configuration**. - -```go -CreateMetafields( - ctx context.Context, - resourceType models.ResourceType, +If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields with the scope attribute – **if a partial update is sent it will overwrite the current configuration**. + +```go +CreateMetafields( + ctx context.Context, + resourceType models.ResourceType, body *models.CreateMetafieldsRequest) ( models.ApiResponse[[]models.Metafield], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `body` | [`*models.CreateMetafieldsRequest`](../../doc/models/create-metafields-request.md) | Body, Optional | - | - -## Response Type - -[`[]models.Metafield`](../../doc/models/metafield.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `body` | [`*models.CreateMetafieldsRequest`](../../doc/models/create-metafields-request.md) | Body, Optional | - | + +## Response Type + +[`[]models.Metafield`](../../doc/models/metafield.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") @@ -85,77 +85,77 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "name": "Color", - "scope": { - "hosted": [], - "csv": "0", - "statements": "0", - "invoices": "0", - "portal": "0" - }, - "data_count": 0, - "input_type": "text", - "enum": null - }, - { - "name": "Brand", - "scope": { - "hosted": [], - "csv": "0", - "statements": "0", - "invoices": "0", - "portal": "0" - }, - "data_count": 0, - "input_type": "text", - "enum": null - } -] -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# List Metafields - -This endpoint lists metafields associated with a site. The metafield description and usage is contained in the response. - -```go -ListMetafields( +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "name": "Color", + "scope": { + "hosted": [], + "csv": "0", + "statements": "0", + "invoices": "0", + "portal": "0" + }, + "data_count": 0, + "input_type": "text", + "enum": null + }, + { + "name": "Brand", + "scope": { + "hosted": [], + "csv": "0", + "statements": "0", + "invoices": "0", + "portal": "0" + }, + "data_count": 0, + "input_type": "text", + "enum": null + } +] +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# List Metafields + +This endpoint lists metafields associated with a site. The metafield description and usage is contained in the response. + +```go +ListMetafields( ctx context.Context,input ListMetafieldsInput) ( models.ApiResponse[models.ListMetafieldsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `name` | `*string` | Query, Optional | filter by the name of the metafield | -| `page` | `*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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | - -## Response Type - -[`models.ListMetafieldsResponse`](../../doc/models/list-metafields-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `name` | `*string` | Query, Optional | filter by the name of the metafield | +| `page` | `*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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | + +## Response Type + +[`models.ListMetafieldsResponse`](../../doc/models/list-metafields-response.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") page := 2 @@ -168,65 +168,65 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "total_count": 0, - "current_page": 0, - "total_pages": 0, - "per_page": 0, - "metafields": [ - { - "id": 0, - "name": "string", - "scope": { - "csv": "0", - "statements": "0", - "invoices": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "data_count": 0, - "input_type": "string", - "enum": null - } - ] -} -``` - - -# Update Metafield - -Use the following method to update metafields for your Site. Metafields can be populated with metadata after the fact. - -```go -UpdateMetafield( - ctx context.Context, - resourceType models.ResourceType, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "total_count": 0, + "current_page": 0, + "total_pages": 0, + "per_page": 0, + "metafields": [ + { + "id": 0, + "name": "string", + "scope": { + "csv": "0", + "statements": "0", + "invoices": "0", + "portal": "0", + "public_show": "0", + "public_edit": "0" + }, + "data_count": 0, + "input_type": "text", + "enum": null + } + ] +} +``` + + +# Update Metafield + +Use the following method to update metafields for your Site. Metafields can be populated with metadata after the fact. + +```go +UpdateMetafield( + ctx context.Context, + resourceType models.ResourceType, body *models.UpdateMetafieldsRequest) ( models.ApiResponse[[]models.Metafield], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `body` | [`*models.UpdateMetafieldsRequest`](../../doc/models/update-metafields-request.md) | Body, Optional | - | - -## Response Type - -[`[]models.Metafield`](../../doc/models/metafield.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `body` | [`*models.UpdateMetafieldsRequest`](../../doc/models/update-metafields-request.md) | Body, Optional | - | + +## Response Type + +[`[]models.Metafield`](../../doc/models/metafield.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") @@ -237,39 +237,45 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Delete Metafield - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Delete Metafield + Use the following method to delete a metafield. This will remove the metafield from the Site. -Additionally, this will remove the metafield and associated metadata with all Subscriptions on the Site. - -```go -DeleteMetafield( - ctx context.Context, - resourceType models.ResourceType, +Additionally, this will remove the metafield and associated metadata with all Subscriptions on the Site. + +```go +DeleteMetafield( + ctx context.Context, + resourceType models.ResourceType, name *string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `name` | `*string` | Query, Optional | The name of the metafield to be deleted | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `name` | `*string` | Query, Optional | The name of the metafield to be deleted | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") @@ -278,18 +284,18 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Create Metadata - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Create Metadata + ## Custom Fields: Metadata Intro **Chargify refers to Custom Fields in the API documentation as metafields and metadata.** Within the Chargify UI, metadata and metafields are grouped together under the umbrella of "Custom Fields." All of our UI-based documentation that references custom fields will not cite the terminology metafields or metadata. @@ -311,36 +317,36 @@ This method will create a metafield for the site on the fly if it does not alrea ### Subscription or Customer Resource -Please pay special attention to the resource you use when creating metadata. - -```go -CreateMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, +Please pay special attention to the resource you use when creating metadata. + +```go +CreateMetadata( + ctx context.Context, + resourceType models.ResourceType, + resourceId int, body *models.CreateMetadataRequest) ( models.ApiResponse[[]models.Metadata], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `resourceId` | `string` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `body` | [`*models.CreateMetadataRequest`](../../doc/models/create-metadata-request.md) | Body, Optional | - | - -## Response Type - -[`[]models.Metadata`](../../doc/models/metadata.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceId` | `int` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | +| `body` | [`*models.CreateMetadataRequest`](../../doc/models/create-metadata-request.md) | Body, Optional | - | + +## Response Type + +[`[]models.Metadata`](../../doc/models/metadata.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") -resourceId := "resource_id4" +resourceId := 60 bodyMetadata0 := models.CreateMetadata{ Name: models.ToPointer("Color"), @@ -364,50 +370,50 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# List Metadata - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# List Metadata + This request will list all of the metadata belonging to a particular resource (ie. subscription, customer) that is specified. ## Metadata Data -This endpoint will also display the current stats of your metadata to use as a tool for pagination. - -```go -ListMetadata( +This endpoint will also display the current stats of your metadata to use as a tool for pagination. + +```go +ListMetadata( ctx context.Context,input ListMetadataInput) ( models.ApiResponse[models.PaginatedMetadata], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `resourceId` | `string` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`models.PaginatedMetadata`](../../doc/models/paginated-metadata.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceId` | `int` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | +| `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`models.PaginatedMetadata`](../../doc/models/paginated-metadata.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") -resourceId := "resource_id4" +resourceId := 60 page := 2 perPage := 50 @@ -418,42 +424,42 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Update Metadata - -This method allows you to update the existing metadata associated with a subscription or customer. - -```go -UpdateMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, +} +``` + + +# Update Metadata + +This method allows you to update the existing metadata associated with a subscription or customer. + +```go +UpdateMetadata( + ctx context.Context, + resourceType models.ResourceType, + resourceId int, body *models.UpdateMetadataRequest) ( models.ApiResponse[[]models.Metadata], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `resourceId` | `string` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `body` | [`*models.UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Optional | - | - -## Response Type - -[`[]models.Metadata`](../../doc/models/metadata.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceId` | `int` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | +| `body` | [`*models.UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Optional | - | + +## Response Type + +[`[]models.Metadata`](../../doc/models/metadata.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") -resourceId := "resource_id4" +resourceId := 60 apiResponse, err := customFieldsController.UpdateMetadata(ctx, resourceType, resourceId, nil) if err != nil { @@ -462,12 +468,18 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Delete Metadata - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Delete Metadata + This method removes the metadata from the subscriber/customer cited. ## Query String Usage @@ -490,56 +502,56 @@ For a success, there will be a code `200` and the plain text response `true`. ## Unsuccessful Response -When a failed response is encountered, you will receive a `404` response and the plain text response of `true`. - -```go -DeleteMetadata( - ctx context.Context, - resourceType models.ResourceType, - resourceId string, - name *string, +When a failed response is encountered, you will receive a `404` response and the plain text response of `true`. + +```go +DeleteMetadata( + ctx context.Context, + resourceType models.ResourceType, + resourceId int, + name *string, names []string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `resourceId` | `string` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | -| `name` | `*string` | Query, Optional | Name of field to be removed. | -| `names` | `[]string` | Query, Optional | Names of fields to be removed. Use in query: `names[]=field1&names[]=my-field&names[]=another-field`. | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `resourceId` | `int` | Template, Required | The Chargify id of the customer or the subscription for which the metadata applies | +| `name` | `*string` | Query, Optional | Name of field to be removed. | +| `names` | `[]string` | Query, Optional | Names of fields to be removed. Use in query: `names[]=field1&names[]=my-field&names[]=another-field`. | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") -resourceId := "resource_id4"Liquid error: Value cannot be null. (Parameter 'key') +resourceId := 60Liquid error: Value cannot be null. (Parameter 'key') resp, err := customFieldsController.DeleteMetadata(ctx, resourceType, resourceId, nil, Liquid error: Value cannot be null. (Parameter 'key')) if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# List Metadata for Resource Type - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# List Metadata for Resource Type + This method will provide you information on usage of metadata across your selected resource (ie. subscriptions, customers) ## Metadata Data @@ -552,38 +564,38 @@ This endpoint will also display the current stats of your metadata to use as a t ## Read Metadata for a Site -This endpoint will list the number of pages of metadata information that are contained within a site. - -```go -ListMetadataForResourceType( +This endpoint will list the number of pages of metadata information that are contained within a site. + +```go +ListMetadataForResourceType( ctx context.Context,input ListMetadataForResourceTypeInput) ( models.ApiResponse[models.PaginatedMetadata], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `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`. | -| `perPage` | `*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`. | -| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | -| `withDeleted` | `*bool` | Query, Optional | Allow to fetch deleted metadata. | -| `resourceIds` | `[]int` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | - -## Response Type - -[`models.PaginatedMetadata`](../../doc/models/paginated-metadata.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `resourceType` | [`models.ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | +| `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`. | +| `perPage` | `*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`. | +| `dateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | +| `startDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `startDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | +| `endDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | +| `withDeleted` | `*bool` | Query, Optional | Allow to fetch deleted metadata. | +| `resourceIds` | `[]int` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | + +## Response Type + +[`models.PaginatedMetadata`](../../doc/models/paginated-metadata.md) + +## Example Usage + +```go ctx := context.Background() resourceType := models.ResourceType("subscriptions") page := 2 @@ -597,6 +609,6 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - +} +``` + diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 4e5b3646..75c67e11 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -1,26 +1,26 @@ -# Customers - -```go -customersController := client.CustomersController() -``` - -## Class Name - -`CustomersController` - -## Methods - +# Customers + +```go +customersController := client.CustomersController() +``` + +## Class Name + +`CustomersController` + +## Methods + * [Create Customer](../../doc/controllers/customers.md#create-customer) * [List Customers](../../doc/controllers/customers.md#list-customers) * [Read Customer](../../doc/controllers/customers.md#read-customer) * [Update Customer](../../doc/controllers/customers.md#update-customer) * [Delete Customer](../../doc/controllers/customers.md#delete-customer) * [Read Customer by Reference](../../doc/controllers/customers.md#read-customer-by-reference) -* [List Customer Subscriptions](../../doc/controllers/customers.md#list-customer-subscriptions) - - -# Create Customer - +* [List Customer Subscriptions](../../doc/controllers/customers.md#list-customer-subscriptions) + + +# Create Customer + You may create a new Customer at any time, or you may create a Customer at the same time you create a Subscription. The only validation restriction is that you may 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 Chargify’s unique ID for the customer, which is in the `id` attribute. @@ -44,29 +44,29 @@ Chargify requires that you use the ISO Standard State codes when formatting stat ## Locale Chargify allows you to attribute a language/region to your customer to deliver invoices in any required language. -For more: [Customer Locale](https://chargify.zendesk.com/hc/en-us/articles/4407870384283#customer-locale) - -```go -CreateCustomer( - ctx context.Context, +For more: [Customer Locale](https://chargify.zendesk.com/hc/en-us/articles/4407870384283#customer-locale) + +```go +CreateCustomer( + ctx context.Context, body *models.CreateCustomerRequest) ( models.ApiResponse[models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateCustomerRequest`](../../doc/models/create-customer-request.md) | Body, Optional | - | - -## Response Type - -[`models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateCustomerRequest`](../../doc/models/create-customer-request.md) | Body, Optional | - | + +## Response Type + +[`models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() bodyCustomer := models.CreateCustomer{ @@ -97,53 +97,53 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "customer": { - "first_name": "Cathryn", - "last_name": "Parisian", - "email": "Stella.McLaughlin6@example.net", - "cc_emails": null, - "organization": "Greenholt - Oberbrunner", - "reference": null, - "id": 76, - "created_at": "2021-03-29T07:47:00-04:00", - "updated_at": "2021-03-29T07:47:00-04:00", - "address": "739 Stephon Bypass", - "address_2": "Apt. 386", - "city": "Sedrickchester", - "state": "KY", - "state_name": "Kentucky", - "zip": "46979-7719", - "country": "US", - "country_name": "United States", - "phone": "230-934-3685", - "verified": false, - "portal_customer_created_at": null, - "portal_invite_last_sent_at": null, - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "vat_number": null, - "parent_id": null, - "locale": "en-US" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`CustomerErrorResponseException`](../../doc/models/customer-error-response-exception.md) | - - -# List Customers - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "customer": { + "first_name": "Cathryn", + "last_name": "Parisian", + "email": "Stella.McLaughlin6@example.net", + "cc_emails": null, + "organization": "Greenholt - Oberbrunner", + "reference": null, + "id": 76, + "created_at": "2021-03-29T07:47:00-04:00", + "updated_at": "2021-03-29T07:47:00-04:00", + "address": "739 Stephon Bypass", + "address_2": "Apt. 386", + "city": "Sedrickchester", + "state": "KY", + "state_name": "Kentucky", + "zip": "46979-7719", + "country": "US", + "country_name": "United States", + "phone": "230-934-3685", + "verified": false, + "portal_customer_created_at": null, + "portal_invite_last_sent_at": null, + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "vat_number": null, + "parent_id": null, + "locale": "en-US" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`CustomerErrorResponseException`](../../doc/models/customer-error-response-exception.md) | + + +# List Customers + This request will by default list all customers associated with your Site. ## Find Customer @@ -158,36 +158,36 @@ Common use cases are: + Search by a reference value from your application + Search by a first or last name -To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). - -```go -ListCustomers( +To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). + +```go +ListCustomers( ctx context.Context,input ListCustomersInput) ( models.ApiResponse[[]models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Direction to sort customers by time of creation | -| `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`. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | -| `dateField` | [`*models.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`. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | 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. | -| `endDatetime` | `*string` | 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. | -| `q` | `*string` | Query, Optional | A search query by which to filter customers (can be an email, an ID, a reference, organization) | - -## Response Type - -[`[]models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Direction to sort customers by time of creation | +| `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`. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`. | +| `dateField` | [`*models.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`. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `startDatetime` | `*string` | 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. | +| `endDatetime` | `*string` | 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. | +| `q` | `*string` | Query, Optional | A search query by which to filter customers (can be an email, an ID, a reference, organization) | + +## Response Type + +[`[]models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 30 @@ -200,119 +200,119 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "customer": { - "first_name": "Kayla", - "last_name": "Test", - "email": "kayla@example.com", - "cc_emails": "john@example.com, sue@example.com", - "organization": "", - "reference": null, - "id": 14126091, - "created_at": "2016-10-04T15:22:27-04:00", - "updated_at": "2016-10-04T15:22:30-04:00", - "address": "", - "address_2": "", - "city": "", - "state": "", - "zip": "", - "country": "", - "phone": "", - "verified": null, - "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 - } - }, - { - "customer": { - "first_name": "Nick ", - "last_name": "Test", - "email": "nick@example.com", - "cc_emails": "john@example.com, sue@example.com", - "organization": "", - "reference": null, - "id": 14254093, - "created_at": "2016-10-13T16:52:51-04:00", - "updated_at": "2016-10-13T16:52:54-04:00", - "address": "", - "address_2": "", - "city": "", - "state": "", - "zip": "", - "country": "", - "phone": "", - "verified": null, - "portal_customer_created_at": "2016-10-13T16:52:54-04:00", - "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "parent_id": 123 - } - }, - { - "customer": { - "first_name": "Don", - "last_name": "Test", - "email": "don@example.com", - "cc_emails": "john@example.com, sue@example.com", - "organization": "", - "reference": null, - "id": 14332342, - "created_at": "2016-10-19T10:49:13-04:00", - "updated_at": "2016-10-19T10:49:19-04:00", - "address": "1737 15th St", - "address_2": "", - "city": "Boulder", - "state": "CO", - "zip": "80302", - "country": "US", - "phone": "", - "verified": null, - "portal_customer_created_at": "2016-10-19T10:49:19-04:00", - "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "parent_id": null - } - } -] -``` - - -# Read Customer - -This method allows to retrieve the Customer properties by Chargify-generated Customer ID. - -```go -ReadCustomer( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "customer": { + "first_name": "Kayla", + "last_name": "Test", + "email": "kayla@example.com", + "cc_emails": "john@example.com, sue@example.com", + "organization": "", + "reference": null, + "id": 14126091, + "created_at": "2016-10-04T15:22:27-04:00", + "updated_at": "2016-10-04T15:22:30-04:00", + "address": "", + "address_2": "", + "city": "", + "state": "", + "zip": "", + "country": "", + "phone": "", + "verified": null, + "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 + } + }, + { + "customer": { + "first_name": "Nick ", + "last_name": "Test", + "email": "nick@example.com", + "cc_emails": "john@example.com, sue@example.com", + "organization": "", + "reference": null, + "id": 14254093, + "created_at": "2016-10-13T16:52:51-04:00", + "updated_at": "2016-10-13T16:52:54-04:00", + "address": "", + "address_2": "", + "city": "", + "state": "", + "zip": "", + "country": "", + "phone": "", + "verified": null, + "portal_customer_created_at": "2016-10-13T16:52:54-04:00", + "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "parent_id": 123 + } + }, + { + "customer": { + "first_name": "Don", + "last_name": "Test", + "email": "don@example.com", + "cc_emails": "john@example.com, sue@example.com", + "organization": "", + "reference": null, + "id": 14332342, + "created_at": "2016-10-19T10:49:13-04:00", + "updated_at": "2016-10-19T10:49:19-04:00", + "address": "1737 15th St", + "address_2": "", + "city": "Boulder", + "state": "CO", + "zip": "80302", + "country": "US", + "phone": "", + "verified": null, + "portal_customer_created_at": "2016-10-19T10:49:19-04:00", + "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "parent_id": null + } + } +] +``` + + +# Read Customer + +This method allows to retrieve the Customer properties by Chargify-generated Customer ID. + +```go +ReadCustomer( + ctx context.Context, id int) ( models.ApiResponse[models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -[`models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +[`models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() id := 112 @@ -323,37 +323,37 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Update Customer - -This method allows to update the Customer. - -```go -UpdateCustomer( - ctx context.Context, - id int, +} +``` + + +# Update Customer + +This method allows to update the Customer. + +```go +UpdateCustomer( + ctx context.Context, + id int, body *models.UpdateCustomerRequest) ( models.ApiResponse[models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `int` | Template, Required | The Chargify id of the customer | -| `body` | [`*models.UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Optional | - | - -## Response Type - -[`models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Template, Required | The Chargify id of the customer | +| `body` | [`*models.UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Optional | - | + +## Response Type + +[`models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() id := 112 @@ -374,73 +374,73 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "customer": { - "first_name": "Martha", - "last_name": "Washington", - "email": "martha.washington@example.com", - "cc_emails": "george.washington@example.com", - "organization": null, - "reference": null, - "id": 14967442, - "created_at": "2016-12-05T10:33:07-05:00", - "updated_at": "2016-12-05T10:38:00-05:00", - "address": null, - "address_2": null, - "city": null, - "state": null, - "zip": null, - "country": null, - "phone": null, - "verified": false, - "portal_customer_created_at": null, - "portal_invite_last_sent_at": null, - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "vat_number": "012345678" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`CustomerErrorResponseException`](../../doc/models/customer-error-response-exception.md) | - - -# Delete Customer - -This method allows you to delete the Customer. - -```go -DeleteCustomer( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "customer": { + "first_name": "Martha", + "last_name": "Washington", + "email": "martha.washington@example.com", + "cc_emails": "george.washington@example.com", + "organization": null, + "reference": null, + "id": 14967442, + "created_at": "2016-12-05T10:33:07-05:00", + "updated_at": "2016-12-05T10:38:00-05:00", + "address": null, + "address_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "verified": false, + "portal_customer_created_at": null, + "portal_invite_last_sent_at": null, + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "vat_number": "012345678" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`CustomerErrorResponseException`](../../doc/models/customer-error-response-exception.md) | + + +# Delete Customer + +This method allows you to delete the Customer. + +```go +DeleteCustomer( + ctx context.Context, id int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() id := 112 @@ -449,35 +449,35 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Read Customer by Reference - -Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. - -```go -ReadCustomerByReference( - ctx context.Context, +} +``` + + +# Read Customer by Reference + +Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. + +```go +ReadCustomerByReference( + ctx context.Context, reference string) ( models.ApiResponse[models.CustomerResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reference` | `string` | Query, Required | Customer reference | - -## Response Type - -[`models.CustomerResponse`](../../doc/models/customer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `reference` | `string` | Query, Required | Customer reference | + +## Response Type + +[`models.CustomerResponse`](../../doc/models/customer-response.md) + +## Example Usage + +```go ctx := context.Background() reference := "reference4" @@ -488,35 +488,35 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# List Customer Subscriptions - -This method lists all subscriptions that belong to a customer. - -```go -ListCustomerSubscriptions( - ctx context.Context, +} +``` + + +# List Customer Subscriptions + +This method lists all subscriptions that belong to a customer. + +```go +ListCustomerSubscriptions( + ctx context.Context, customerId int) ( models.ApiResponse[[]models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `int` | Template, Required | The Chargify id of the customer | - -## Response Type - -[`[]models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `int` | Template, Required | The Chargify id of the customer | + +## Response Type + +[`[]models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() customerId := 150 @@ -527,6 +527,6 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - +} +``` + diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 2faef1cb..788d307e 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -1,54 +1,54 @@ -# Events-Based Billing Segments - -```go -eventsBasedBillingSegmentsController := client.EventsBasedBillingSegmentsController() -``` - -## Class Name - -`EventsBasedBillingSegmentsController` - -## Methods - +# Events-Based Billing Segments + +```go +eventsBasedBillingSegmentsController := client.EventsBasedBillingSegmentsController() +``` + +## Class Name + +`EventsBasedBillingSegmentsController` + +## Methods + * [Create Segment](../../doc/controllers/events-based-billing-segments.md#create-segment) * [List Segments for Price Point](../../doc/controllers/events-based-billing-segments.md#list-segments-for-price-point) * [Update Segment](../../doc/controllers/events-based-billing-segments.md#update-segment) * [Delete Segment](../../doc/controllers/events-based-billing-segments.md#delete-segment) -* [Create Segments](../../doc/controllers/events-based-billing-segments.md#create-segments) -* [Update Segments](../../doc/controllers/events-based-billing-segments.md#update-segments) - - -# Create Segment - +* [Bulk Create Segments](../../doc/controllers/events-based-billing-segments.md#bulk-create-segments) +* [Bulk Update Segments](../../doc/controllers/events-based-billing-segments.md#bulk-update-segments) + + +# Create Segment + This endpoint creates a new Segment for a Component with segmented Metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. - -```go -CreateSegment( - ctx context.Context, - componentId string, - pricePointId string, +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +CreateSegment( + ctx context.Context, + componentId string, + pricePointId string, body *models.CreateSegmentRequest) ( models.ApiResponse[models.SegmentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle for the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `body` | [`*models.CreateSegmentRequest`](../../doc/models/create-segment-request.md) | Body, Optional | - | - -## Response Type - -[`models.SegmentResponse`](../../doc/models/segment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle for the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | +| `body` | [`*models.CreateSegmentRequest`](../../doc/models/create-segment-request.md) | Body, Optional | - | + +## Response Type + +[`models.SegmentResponse`](../../doc/models/segment-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" @@ -83,52 +83,52 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentErrorsException`](../../doc/models/event-based-billing-segment-errors-exception.md) | - - -# List Segments for Price Point - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentErrorsException`](../../doc/models/event-based-billing-segment-errors-exception.md) | + + +# List Segments for Price Point + This endpoint allows you to fetch Segments created for a given Price Point. They will be returned in the order of creation. You can pass `page` and `per_page` parameters in order to access all of the segments. By default it will return `30` records. You can set `per_page` to `200` at most. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. - -```go -ListSegmentsForPricePoint( +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +ListSegmentsForPricePoint( ctx context.Context,input ListSegmentsForPricePointInput) ( models.ApiResponse[models.ListSegmentsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle for the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `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`. | -| `perPage` | `*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`. | -| `filterSegmentProperty1Value` | `*string` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_1` on attached Metric. If empty string is passed, this filter would be rejected. Use in query `filter[segment_property_1_value]=EU`. | -| `filterSegmentProperty2Value` | `*string` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_2` on attached Metric. If empty string is passed, this filter would be rejected. | -| `filterSegmentProperty3Value` | `*string` | Query, 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. | -| `filterSegmentProperty4Value` | `*string` | Query, 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. | - -## Response Type - -[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle for the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | +| `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`. | +| `perPage` | `*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`. | +| `filterSegmentProperty1Value` | `*string` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_1` on attached Metric. If empty string is passed, this filter would be rejected. Use in query `filter[segment_property_1_value]=EU`. | +| `filterSegmentProperty2Value` | `*string` | Query, Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_2` on attached Metric. If empty string is passed, this filter would be rejected. | +| `filterSegmentProperty3Value` | `*string` | Query, 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. | +| `filterSegmentProperty4Value` | `*string` | Query, 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. | + +## Response Type + +[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" @@ -142,50 +142,50 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingListSegmentsErrorsException`](../../doc/models/event-based-billing-list-segments-errors-exception.md) | - - -# Update Segment - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingListSegmentsErrorsException`](../../doc/models/event-based-billing-list-segments-errors-exception.md) | + + +# Update Segment + This endpoint 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 or the `handle:gold` syntax. - -```go -UpdateSegment( - ctx context.Context, - componentId string, - pricePointId string, - id float64, +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +UpdateSegment( + ctx context.Context, + componentId string, + pricePointId string, + id float64, body *models.UpdateSegmentRequest) ( models.ApiResponse[models.SegmentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle of the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle of the Price Point belonging to the Component | -| `id` | `float64` | Template, Required | The ID of the Segment | -| `body` | [`*models.UpdateSegmentRequest`](../../doc/models/update-segment-request.md) | Body, Optional | - | - -## Response Type - -[`models.SegmentResponse`](../../doc/models/segment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle of the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle of the Price Point belonging to the Component | +| `id` | `float64` | Template, Required | The ID of the Segment | +| `body` | [`*models.UpdateSegmentRequest`](../../doc/models/update-segment-request.md) | Body, Optional | - | + +## Response Type + +[`models.SegmentResponse`](../../doc/models/segment-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" @@ -198,48 +198,48 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentErrorsException`](../../doc/models/event-based-billing-segment-errors-exception.md) | - - -# Delete Segment - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentErrorsException`](../../doc/models/event-based-billing-segment-errors-exception.md) | + + +# Delete Segment + This endpoint allows you to delete a Segment with specified ID. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. - -```go -DeleteSegment( - ctx context.Context, - componentId string, - pricePointId string, +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +DeleteSegment( + ctx context.Context, + componentId string, + pricePointId string, id float64) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle of the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle of the Price Point belonging to the Component | -| `id` | `float64` | Template, Required | The ID of the Segment | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle of the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle of the Price Point belonging to the Component | +| `id` | `float64` | Template, Required | The ID of the Segment | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" @@ -250,123 +250,123 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | `ApiError` | - - -# Create Segments - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | `ApiError` | + + +# Bulk Create Segments + This endpoint allows you to create multiple segments in one request. The array of segments can contain up to `2000` records. If any of the records contain an error the whole request would fail and none of the requested segments get created. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. - -```go -CreateSegments( - ctx context.Context, - componentId string, - pricePointId string, +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +BulkCreateSegments( + ctx context.Context, + componentId string, + pricePointId string, body *models.BulkCreateSegments) ( models.ApiResponse[models.ListSegmentsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle for the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `body` | [`*models.BulkCreateSegments`](../../doc/models/bulk-create-segments.md) | Body, Optional | - | - -## Response Type - -[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle for the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | +| `body` | [`*models.BulkCreateSegments`](../../doc/models/bulk-create-segments.md) | Body, Optional | - | + +## Response Type + +[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" -apiResponse, err := eventsBasedBillingSegmentsController.CreateSegments(ctx, componentId, pricePointId, nil) +apiResponse, err := eventsBasedBillingSegmentsController.BulkCreateSegments(ctx, componentId, pricePointId, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentException`](../../doc/models/event-based-billing-segment-exception.md) | - - -# Update Segments - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentException`](../../doc/models/event-based-billing-segment-exception.md) | + + +# Bulk Update Segments + This endpoint allows you to update multiple segments in one request. The array of segments can contain up to `1000` records. If any of the records contain an error the whole request would fail and none of the requested segments get updated. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. - -```go -UpdateSegments( - ctx context.Context, - componentId string, - pricePointId string, +You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. + +```go +BulkUpdateSegments( + ctx context.Context, + componentId string, + pricePointId string, body *models.BulkUpdateSegments) ( models.ApiResponse[models.ListSegmentsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `componentId` | `string` | Template, Required | ID or Handle for the Component | -| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `body` | [`*models.BulkUpdateSegments`](../../doc/models/bulk-update-segments.md) | Body, Optional | - | - -## Response Type - -[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `componentId` | `string` | Template, Required | ID or Handle for the Component | +| `pricePointId` | `string` | Template, Required | ID or Handle for the Price Point belonging to the Component | +| `body` | [`*models.BulkUpdateSegments`](../../doc/models/bulk-update-segments.md) | Body, Optional | - | + +## Response Type + +[`models.ListSegmentsResponse`](../../doc/models/list-segments-response.md) + +## Example Usage + +```go ctx := context.Background() componentId := "component_id8" pricePointId := "price_point_id8" -apiResponse, err := eventsBasedBillingSegmentsController.UpdateSegments(ctx, componentId, pricePointId, nil) +apiResponse, err := eventsBasedBillingSegmentsController.BulkUpdateSegments(ctx, componentId, pricePointId, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentException`](../../doc/models/event-based-billing-segment-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentException`](../../doc/models/event-based-billing-segment-exception.md) | + diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 7903869a..e7e57a07 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -1,22 +1,22 @@ -# Events - -```go -eventsController := client.EventsController() -``` - -## Class Name - -`EventsController` - -## Methods - +# Events + +```go +eventsController := client.EventsController() +``` + +## Class Name + +`EventsController` + +## Methods + * [List Events](../../doc/controllers/events.md#list-events) * [List Subscription Events](../../doc/controllers/events.md#list-subscription-events) -* [Read Events Count](../../doc/controllers/events.md#read-events-count) - - -# List Events - +* [Read Events Count](../../doc/controllers/events.md#read-events-count) + + +# List Events + ## Events Intro Chargify 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. @@ -78,38 +78,38 @@ Here’s an example event for the `subscription_state_change` event: "created_at": "2012-01-30T10:43:33-05:00" } } -``` - -```go -ListEvents( +``` + +```go +ListEvents( ctx context.Context,input ListEventsInput) ( models.ApiResponse[[]models.EventResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | -| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | -| `dateField` | [`*models.ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | - -## Response Type - -[`[]models.EventResponse`](../../doc/models/event-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | +| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `dateField` | [`*models.ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | + +## Response Type + +[`[]models.EventResponse`](../../doc/models/event-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -124,104 +124,104 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "event": { - "id": 343087780, - "key": "subscription_state_change", - "message": "State changed on Test subscription to Monthly Product from active to past_due", - "subscription_id": 14950962, - "customer_id": 12345678, - "created_at": "2016-10-27T16:42:22-04:00", - "event_specific_data": { - "previous_subscription_state": "active", - "new_subscription_state": "past_due" - } - } - }, - { - "event": { - "id": 343087742, - "key": "billing_date_change", - "message": "Billing date changed on Test's subscription to Monthly Product from 11/27/2016 to 10/27/2016", - "subscription_id": 14950962, - "customer_id": 12345678, - "created_at": "2016-10-27T16:42:19-04:00", - "event_specific_data": null - } - }, - { - "event": { - "id": 343085267, - "key": "statement_closed", - "message": "Statement 79401838 closed (but not settled) for Test's subscription to ANNUAL product", - "subscription_id": 14950975, - "customer_id": 87654321, - "created_at": "2016-10-27T16:40:40-04:00", - "event_specific_data": null - } - }, - { - "event": { - "id": 4481, - "key": "custom_field_value_change", - "message": "Custom field (Extra support included) changed for Subscription 117 from 'Yes' to 'No'.", - "subscription_id": 117, - "customer_id": 22334455, - "created_at": "2022-03-24T07:55:06-04:00", - "event_specific_data": { - "event_type": "updated", - "metafield_name": "Extra support included", - "metafield_id": 2, - "old_value": "Yes", - "new_value": "No", - "resource_type": "Subscription", - "resource_id": 117 - } - } - } -] -``` - - -# List Subscription Events - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "event": { + "id": 343087780, + "key": "subscription_state_change", + "message": "State changed on Test subscription to Monthly Product from active to past_due", + "subscription_id": 14950962, + "customer_id": 12345678, + "created_at": "2016-10-27T16:42:22-04:00", + "event_specific_data": { + "previous_subscription_state": "active", + "new_subscription_state": "past_due" + } + } + }, + { + "event": { + "id": 343087742, + "key": "billing_date_change", + "message": "Billing date changed on Test's subscription to Monthly Product from 11/27/2016 to 10/27/2016", + "subscription_id": 14950962, + "customer_id": 12345678, + "created_at": "2016-10-27T16:42:19-04:00", + "event_specific_data": null + } + }, + { + "event": { + "id": 343085267, + "key": "statement_closed", + "message": "Statement 79401838 closed (but not settled) for Test's subscription to ANNUAL product", + "subscription_id": 14950975, + "customer_id": 87654321, + "created_at": "2016-10-27T16:40:40-04:00", + "event_specific_data": null + } + }, + { + "event": { + "id": 4481, + "key": "custom_field_value_change", + "message": "Custom field (Extra support included) changed for Subscription 117 from 'Yes' to 'No'.", + "subscription_id": 117, + "customer_id": 22334455, + "created_at": "2022-03-24T07:55:06-04:00", + "event_specific_data": { + "event_type": "updated", + "metafield_name": "Extra support included", + "metafield_id": 2, + "old_value": "Yes", + "new_value": "No", + "resource_type": "Subscription", + "resource_id": 117 + } + } + } +] +``` + + +# List Subscription Events + The following request will return a list of events for a subscription. -Each event type has its own `event_specific_data` specified. - -```go -ListSubscriptionEvents( +Each event type has its own `event_specific_data` specified. + +```go +ListSubscriptionEvents( ctx context.Context,input ListSubscriptionEventsInput) ( models.ApiResponse[[]models.EventResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `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`. | -| `perPage` | `*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`. | -| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | -| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | - -## Response Type - -[`[]models.EventResponse`](../../doc/models/event-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `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`. | +| `perPage` | `*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`. | +| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | +| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | + +## Response Type + +[`[]models.EventResponse`](../../doc/models/event-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 page := 2 @@ -236,82 +236,82 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "event": { - "id": 344799837, - "key": "statement_settled", - "message": "Statement 79702531 settled successfully for Amelia Example's subscription to Basic Plan", - "subscription_id": 14900541, - "customer_id": 77223344, - "created_at": "2016-11-01T12:41:29-04:00", - "event_specific_data": null - } - }, - { - "event": { - "id": 344799815, - "key": "renewal_success", - "message": "Successful renewal for Amelia Example's subscription to Basic Plan", - "subscription_id": 14900541, - "customer_id": 77223344, - "created_at": "2016-11-01T12:41:28-04:00", - "event_specific_data": { - "product_id": 3792003, - "account_transaction_id": 7590246 - } - } - }, - { - "event": { - "id": 344799705, - "key": "billing_date_change", - "message": "Billing date changed on Amelia Example's subscription to Basic Plan from 11/26/2016 to 11/01/2016", - "subscription_id": 14900541, - "customer_id": 77223344, - "created_at": "2016-11-01T12:41:25-04:00", - "event_specific_data": null - } - } -] -``` - - -# Read Events Count - -Get a count of all the events for a given site by using this method. - -```go -ReadEventsCount( +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "event": { + "id": 344799837, + "key": "statement_settled", + "message": "Statement 79702531 settled successfully for Amelia Example's subscription to Basic Plan", + "subscription_id": 14900541, + "customer_id": 77223344, + "created_at": "2016-11-01T12:41:29-04:00", + "event_specific_data": null + } + }, + { + "event": { + "id": 344799815, + "key": "renewal_success", + "message": "Successful renewal for Amelia Example's subscription to Basic Plan", + "subscription_id": 14900541, + "customer_id": 77223344, + "created_at": "2016-11-01T12:41:28-04:00", + "event_specific_data": { + "product_id": 3792003, + "account_transaction_id": 7590246 + } + } + }, + { + "event": { + "id": 344799705, + "key": "billing_date_change", + "message": "Billing date changed on Amelia Example's subscription to Basic Plan from 11/26/2016 to 11/01/2016", + "subscription_id": 14900541, + "customer_id": 77223344, + "created_at": "2016-11-01T12:41:25-04:00", + "event_specific_data": null + } + } +] +``` + + +# Read Events Count + +Get a count of all the events for a given site by using this method. + +```go +ReadEventsCount( ctx context.Context,input ReadEventsCountInput) ( models.ApiResponse[models.CountResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | -| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | - -## Response Type - -[`models.CountResponse`](../../doc/models/count-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `sinceId` | `*int` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `*int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | +| `filter` | [`[]models.EventType`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | + +## Response Type + +[`models.CountResponse`](../../doc/models/count-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -325,14 +325,14 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "count": 144 -} -``` - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "count": 144 +} +``` + diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 405bc2c6..739f6751 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -1,23 +1,23 @@ -# Insights - -```go -insightsController := client.InsightsController() -``` - -## Class Name - -`InsightsController` - -## Methods - +# Insights + +```go +insightsController := client.InsightsController() +``` + +## Class Name + +`InsightsController` + +## Methods + * [Read Site Stats](../../doc/controllers/insights.md#read-site-stats) * [Read Mrr](../../doc/controllers/insights.md#read-mrr) -* [Read Mrr Movements](../../doc/controllers/insights.md#read-mrr-movements) -* [List Mrr Per Subscription](../../doc/controllers/insights.md#list-mrr-per-subscription) - - -# Read Site Stats - +* [List Mrr Movements](../../doc/controllers/insights.md#list-mrr-movements) +* [List Mrr Per Subscription](../../doc/controllers/insights.md#list-mrr-per-subscription) + + +# Read Site Stats + The Stats API is a very basic view of some Site-level stats. This API call only answers with JSON responses. An XML version is not provided. ## Stats Documentation @@ -26,22 +26,22 @@ There currently is not a complimentary matching set of documentation that compli ``` https://subdomain.chargify.com/dashboard -``` - -```go -ReadSiteStats( +``` + +```go +ReadSiteStats( ctx context.Context) ( models.ApiResponse[models.SiteSummary], - error) -``` - -## Response Type - -[`models.SiteSummary`](../../doc/models/site-summary.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`models.SiteSummary`](../../doc/models/site-summary.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := insightsController.ReadSiteStats(ctx) if err != nil { @@ -50,58 +50,58 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "seller_name": "Acme, Inc.", - "site_name": "Production", - "site_id": 12345, - "site_currency": "USD", - "stats": { - "total_subscriptions": 120, - "subscriptions_today": 4, - "total_revenue": "$45,978.81", - "revenue_today": "$1,405.12", - "revenue_this_month": "$10,000.00", - "revenue_this_year": "$27,935.24" - } -} -``` - - -# Read Mrr - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "seller_name": "Acme, Inc.", + "site_name": "Production", + "site_id": 12345, + "site_currency": "USD", + "stats": { + "total_subscriptions": 120, + "subscriptions_today": 4, + "total_revenue": "$45,978.81", + "revenue_today": "$1,405.12", + "revenue_this_month": "$10,000.00", + "revenue_this_year": "$27,935.24" + } +} +``` + + +# Read Mrr + **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts. - -```go -ReadMrr( - ctx context.Context, - atTime *time.Time, +This endpoint returns your site's current MRR, including plan and usage breakouts. + +```go +ReadMrr( + ctx context.Context, + atTime *time.Time, subscriptionId *int) ( models.ApiResponse[models.MRRResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `atTime` | `*time.Time` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | -| `subscriptionId` | `*int` | Query, Optional | submit the id of a subscription in order to limit results | - -## Response Type - -[`models.MRRResponse`](../../doc/models/mrr-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `atTime` | `*time.Time` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | +| `subscriptionId` | `*int` | Query, Optional | submit the id of a subscription in order to limit results | + +## Response Type + +[`models.MRRResponse`](../../doc/models/mrr-response.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := insightsController.ReadMrr(ctx, nil, nil) @@ -111,32 +111,32 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "mrr": { - "amount_in_cents": 9915593, - "amount_formatted": "$99,155.93", - "currency": "USD", - "currency_symbol": "$", - "at_time": "2021-02-03T14:23:17-05:00", - "breakouts": { - "plan_amount_in_cents": 9913593, - "plan_amount_formatted": "$99,135.93", - "usage_amount_in_cents": 2000, - "usage_amount_formatted": "$20.00" - } - } -} -``` - - -# Read Mrr Movements - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "mrr": { + "amount_in_cents": 9915593, + "amount_formatted": "$99,155.93", + "currency": "USD", + "currency_symbol": "$", + "at_time": "2021-02-03T14:23:17-05:00", + "breakouts": { + "plan_amount_in_cents": 9913593, + "plan_amount_formatted": "$99,135.93", + "usage_amount_in_cents": 2000, + "usage_amount_formatted": "$20.00" + } + } +} +``` + + +# List Mrr Movements + **This endpoint is deprecated.** This endpoint returns your site's MRR movements. @@ -162,128 +162,128 @@ Plan includes revenue from: Usage includes revenue from: * Metered Components -* Prepaid Usage Components - -```go -ReadMrrMovements( - ctx context.Context,input ReadMrrMovementsInput) ( +* Prepaid Usage Components + +```go +ListMrrMovements( + ctx context.Context,input ListMrrMovementsInput) ( models.ApiResponse[models.ListMRRResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `*int` | Query, Optional | optionally 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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | - -## Response Type - -[`models.ListMRRResponse`](../../doc/models/list-mrr-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `*int` | Query, Optional | optionally 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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | + +## Response Type + +[`models.ListMRRResponse`](../../doc/models/list-mrr-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 20 -apiResponse, err := insightsController.ReadMrrMovements(ctx, nil, &page, &perPage, nil) +apiResponse, err := insightsController.ListMrrMovements(ctx, nil, &page, &perPage, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "mrr": { - "page": 0, - "per_page": 10, - "total_pages": 80, - "total_entries": 791, - "currency": "USD", - "currency_symbol": "$", - "movements": [ - { - "timestamp": "2014-12-03T13:59:46-05:00", - "amount_in_cents": 2173, - "amount_formatted": "$21.73", - "description": "Awesome Company signed up for Super Product ($21.73/mo)", - "category": "new_business", - "breakouts": { - "plan_amount_in_cents": 2173, - "plan_amount_formatted": "$21.73", - "usage_amount_in_cents": 0, - "usage_amount_formatted": "$0.00" - }, - "line_items": [ - { - "product_id": 306386, - "component_id": 0, - "price_point_id": 3856987, - "name": "Cached Queries", - "mrr": 2173, - "mrr_movements": [ - { - "amount": 2173, - "category": "new_business", - "subscriber_delta": 0, - "lead_delta": 0 - } - ], - "quantity": 1, - "prev_quantity": 0, - "recurring": true - } - ], - "subscription_id": 12355, - "subscriber_name": "Amy Smith" - } - ] - } -} -``` - - -# List Mrr Per Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "mrr": { + "page": 0, + "per_page": 10, + "total_pages": 80, + "total_entries": 791, + "currency": "USD", + "currency_symbol": "$", + "movements": [ + { + "timestamp": "2014-12-03T13:59:46-05:00", + "amount_in_cents": 2173, + "amount_formatted": "$21.73", + "description": "Awesome Company signed up for Super Product ($21.73/mo)", + "category": "new_business", + "breakouts": { + "plan_amount_in_cents": 2173, + "plan_amount_formatted": "$21.73", + "usage_amount_in_cents": 0, + "usage_amount_formatted": "$0.00" + }, + "line_items": [ + { + "product_id": 306386, + "component_id": 0, + "price_point_id": 3856987, + "name": "Cached Queries", + "mrr": 2173, + "mrr_movements": [ + { + "amount": 2173, + "category": "new_business", + "subscriber_delta": 0, + "lead_delta": 0 + } + ], + "quantity": 1, + "prev_quantity": 0, + "recurring": true + } + ], + "subscription_id": 12355, + "subscriber_name": "Amy Smith" + } + ] + } +} +``` + + +# List Mrr Per Subscription + **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. - -```go -ListMrrPerSubscription( +This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. + +```go +ListMrrPerSubscription( ctx context.Context,input ListMrrPerSubscriptionInput) ( models.ApiResponse[models.SubscriptionMRRResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `filterSubscriptionIds` | `[]int` | Query, Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`. | -| `atTime` | `*string` | Query, Optional | Submit a timestamp in ISO8601 format to request MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. | -| `page` | `*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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`. | - -## Response Type - -[`models.SubscriptionMRRResponse`](../../doc/models/subscription-mrr-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `filterSubscriptionIds` | `[]int` | Query, Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`. | +| `atTime` | `*string` | Query, Optional | Submit a timestamp in ISO8601 format to request MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. | +| `page` | `*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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`. | + +## Response Type + +[`models.SubscriptionMRRResponse`](../../doc/models/subscription-mrr-response.md) + +## Example Usage + +```go ctx := context.Background()Liquid error: Value cannot be null. (Parameter 'key') atTime := "at_time=2022-01-10T10:00:00-05:00" page := 2 @@ -297,12 +297,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Bad Request | [`SubscriptionsMrrErrorResponseException`](../../doc/models/subscriptions-mrr-error-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`SubscriptionsMrrErrorResponseException`](../../doc/models/subscriptions-mrr-error-response-exception.md) | + diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 0a9f631d..03afe0fc 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -1,67 +1,67 @@ -# Invoices - -```go -invoicesController := client.InvoicesController() -``` - -## Class Name - -`InvoicesController` - -## Methods - +# Invoices + +```go +invoicesController := client.InvoicesController() +``` + +## Class Name + +`InvoicesController` + +## Methods + * [Refund Invoice](../../doc/controllers/invoices.md#refund-invoice) * [List Invoices](../../doc/controllers/invoices.md#list-invoices) * [Read Invoice](../../doc/controllers/invoices.md#read-invoice) * [List Invoice Events](../../doc/controllers/invoices.md#list-invoice-events) * [Record Payment for Invoice](../../doc/controllers/invoices.md#record-payment-for-invoice) -* [Record External Payment for Invoices](../../doc/controllers/invoices.md#record-external-payment-for-invoices) +* [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices) * [List Credit Notes](../../doc/controllers/invoices.md#list-credit-notes) * [Read Credit Note](../../doc/controllers/invoices.md#read-credit-note) * [Record Payment for Subscription](../../doc/controllers/invoices.md#record-payment-for-subscription) * [Reopen Invoice](../../doc/controllers/invoices.md#reopen-invoice) * [Void Invoice](../../doc/controllers/invoices.md#void-invoice) -* [List Invoice Segments](../../doc/controllers/invoices.md#list-invoice-segments) +* [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments) * [Create Invoice](../../doc/controllers/invoices.md#create-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) -* [Issue Invoice](../../doc/controllers/invoices.md#issue-invoice) - - -# Refund Invoice - +* [Issue Invoice](../../doc/controllers/invoices.md#issue-invoice) + + +# Refund Invoice + Refund 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. -A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00 respectively). - -```go -RefundInvoice( - ctx context.Context, - uid string, +A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00 respectively). + +```go +RefundInvoice( + ctx context.Context, + uid string, body *models.RefundInvoiceRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | -| `body` | [`*models.RefundInvoiceRequest`](../../doc/models/refund-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`*models.RefundInvoiceRequest`](../../doc/models/refund-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -83,61 +83,61 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# 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`. - -```go -ListInvoices( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# 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`. + +```go +ListInvoices( ctx context.Context,input ListInvoicesInput) ( models.ApiResponse[models.ListInvoicesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns invoices with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns invoices with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | -| `subscriptionId` | `*int` | Query, Optional | The subscription's ID. | -| `subscriptionGroupUid` | `*string` | Query, Optional | The UID of the subscription group you want to fetch consolidated invoices for. This will return a paginated list of consolidated invoices for the specified group. | -| `page` | `*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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | -| `lineItems` | `*bool` | Query, Optional | Include line items data | -| `discounts` | `*bool` | Query, Optional | Include discounts data | -| `taxes` | `*bool` | Query, Optional | Include taxes data | -| `credits` | `*bool` | Query, Optional | Include credits data | -| `payments` | `*bool` | Query, Optional | Include payments data | -| `customFields` | `*bool` | Query, Optional | Include custom fields data | -| `refunds` | `*bool` | Query, Optional | Include refunds data | -| `dateField` | [`*models.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`. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | -| `customerIds` | `[]int` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | -| `number` | `[]string` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | -| `productIds` | `[]int` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | -| `sort` | [`*models.InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`. | - -## Response Type - -[`models.ListInvoicesResponse`](../../doc/models/list-invoices-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns invoices with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns invoices with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | +| `subscriptionId` | `*int` | Query, Optional | The subscription's ID. | +| `subscriptionGroupUid` | `*string` | Query, Optional | The UID of the subscription group you want to fetch consolidated invoices for. This will return a paginated list of consolidated invoices for the specified group. | +| `page` | `*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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | +| `lineItems` | `*bool` | Query, Optional | Include line items data | +| `discounts` | `*bool` | Query, Optional | Include discounts data | +| `taxes` | `*bool` | Query, Optional | Include taxes data | +| `credits` | `*bool` | Query, Optional | Include credits data | +| `payments` | `*bool` | Query, Optional | Include payments data | +| `customFields` | `*bool` | Query, Optional | Include custom fields data | +| `refunds` | `*bool` | Query, Optional | Include refunds data | +| `dateField` | [`*models.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`. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | +| `customerIds` | `[]int` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | +| `number` | `[]string` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | +| `productIds` | `[]int` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | +| `sort` | [`*models.InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`. | + +## Response Type + +[`models.ListInvoicesResponse`](../../doc/models/list-invoices-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -162,308 +162,308 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "invoices": [ - { - "uid": "inv_8htcd29wcq3q6", - "site_id": 51288, - "customer_id": 20153415, - "subscription_id": 23277588, - "number": "125", - "sequence_number": 125, - "issue_date": "2018-09-20", - "due_date": "2018-09-20", - "paid_date": "2018-09-20", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "parent", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": 23277588, - "product_name": "Trial and setup fee", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 20153415, - "first_name": "Meg", - "last_name": "Example", - "organization": "", - "email": "meg@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "shipping_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "credit_amount": "0.0", - "paid_amount": "100.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8htcd29wcq3q6?token=n9fr5fxff5v74c7h9srg3cwd" - }, - { - "uid": "inv_8hr3546xp4h8n", - "site_id": 51288, - "customer_id": 21687686, - "subscription_id": 22007644, - "number": "124", - "sequence_number": 124, - "issue_date": "2018-09-18", - "due_date": "2018-09-18", - "paid_date": null, - "status": "open", - "collection_method": "remittance", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Trial and setup fee", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 21687686, - "first_name": "Charlene", - "last_name": "Tester", - "organization": "", - "email": "food@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "", - "line2": "", - "city": "", - "state": "", - "zip": "", - "country": "" - }, - "shipping_address": { - "street": "", - "line2": "", - "city": "", - "state": "", - "zip": "", - "country": "" - }, - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "100.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546xp4h8n?token=n9fr5fxff5v74c7h9srg3cwd" - }, - { - "uid": "inv_8hr3546wdwxkr", - "site_id": 51288, - "customer_id": 21687670, - "subscription_id": 22007627, - "number": "123", - "sequence_number": 123, - "issue_date": "2018-09-18", - "due_date": "2018-09-18", - "paid_date": "2018-09-18", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Trial End - Free", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 21687670, - "first_name": "Hello", - "last_name": "World", - "organization": "123", - "email": "example@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 Anywhere Street", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "shipping_address": { - "street": "", - "line2": "", - "city": "Boston", - "state": "AL", - "zip": "02120", - "country": "US" - }, - "subtotal_amount": "0.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "0.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546wdwxkr?token=n9fr5fxff5v74c7h9srg3cwd" - }, - { - "uid": "inv_8hjtk8bz56bbp", - "site_id": 51288, - "customer_id": 20137757, - "subscription_id": 20541100, - "number": "122", - "sequence_number": 122, - "issue_date": "2018-09-10", - "due_date": "2018-09-10", - "paid_date": "2018-09-10", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "$0 Product", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 20137757, - "first_name": "Sasha", - "last_name": "Example", - "organization": "", - "email": "example@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Catville", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "shipping_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Catville", - "state": "AL", - "zip": "90210", - "country": "US" - }, - "subtotal_amount": "0.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "0.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8hjtk8bz56bbp?token=fb6kpjz5rcr2vttyjs4rcv6y" - } - ] -} -``` - - -# Read Invoice - -Use this endpoint to retrieve the details for an invoice. - -```go -ReadInvoice( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "invoices": [ + { + "uid": "inv_8htcd29wcq3q6", + "site_id": 51288, + "customer_id": 20153415, + "subscription_id": 23277588, + "number": "125", + "sequence_number": 125, + "issue_date": "2018-09-20", + "due_date": "2018-09-20", + "paid_date": "2018-09-20", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "parent", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": 23277588, + "product_name": "Trial and setup fee", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 20153415, + "first_name": "Meg", + "last_name": "Example", + "organization": "", + "email": "meg@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "shipping_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "credit_amount": "0.0", + "paid_amount": "100.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8htcd29wcq3q6?token=n9fr5fxff5v74c7h9srg3cwd" + }, + { + "uid": "inv_8hr3546xp4h8n", + "site_id": 51288, + "customer_id": 21687686, + "subscription_id": 22007644, + "number": "124", + "sequence_number": 124, + "issue_date": "2018-09-18", + "due_date": "2018-09-18", + "paid_date": null, + "status": "open", + "collection_method": "remittance", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Trial and setup fee", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 21687686, + "first_name": "Charlene", + "last_name": "Tester", + "organization": "", + "email": "food@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "", + "line2": "", + "city": "", + "state": "", + "zip": "", + "country": "" + }, + "shipping_address": { + "street": "", + "line2": "", + "city": "", + "state": "", + "zip": "", + "country": "" + }, + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "100.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546xp4h8n?token=n9fr5fxff5v74c7h9srg3cwd" + }, + { + "uid": "inv_8hr3546wdwxkr", + "site_id": 51288, + "customer_id": 21687670, + "subscription_id": 22007627, + "number": "123", + "sequence_number": 123, + "issue_date": "2018-09-18", + "due_date": "2018-09-18", + "paid_date": "2018-09-18", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Trial End - Free", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 21687670, + "first_name": "Hello", + "last_name": "World", + "organization": "123", + "email": "example@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 Anywhere Street", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "shipping_address": { + "street": "", + "line2": "", + "city": "Boston", + "state": "AL", + "zip": "02120", + "country": "US" + }, + "subtotal_amount": "0.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "0.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546wdwxkr?token=n9fr5fxff5v74c7h9srg3cwd" + }, + { + "uid": "inv_8hjtk8bz56bbp", + "site_id": 51288, + "customer_id": 20137757, + "subscription_id": 20541100, + "number": "122", + "sequence_number": 122, + "issue_date": "2018-09-10", + "due_date": "2018-09-10", + "paid_date": "2018-09-10", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "$0 Product", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 20137757, + "first_name": "Sasha", + "last_name": "Example", + "organization": "", + "email": "example@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Catville", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "shipping_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Catville", + "state": "AL", + "zip": "90210", + "country": "US" + }, + "subtotal_amount": "0.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "0.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8hjtk8bz56bbp?token=fb6kpjz5rcr2vttyjs4rcv6y" + } + ] +} +``` + + +# Read Invoice + +Use this endpoint to retrieve the details for an invoice. + +```go +ReadInvoice( + ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -474,125 +474,125 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "inv_8gd8tdhtd3hgr", - "site_id": 51288, - "customer_id": 20194505, - "subscription_id": 20597774, - "number": "117", - "sequence_number": 117, - "issue_date": "2018-07-26", - "due_date": "2018-07-26", - "paid_date": "2018-07-26", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Monthly Product", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 20194505, - "first_name": "Joe", - "last_name": "Example", - "organization": null, - "email": "joe@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "shipping_address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "credit_amount": "0.0", - "paid_amount": "100.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "line_items": [ - { - "uid": "li_8gd8tdhhgk55k", - "title": "Monthly Product", - "description": "Jul 26, 2018 - Aug 26, 2018", - "quantity": "1.0", - "unit_price": "100.0", - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "tiered_unit_price": false, - "period_range_start": "2018-07-26", - "period_range_end": "2018-08-26", - "product_id": 4607632, - "product_version": 1, - "component_id": null, - "price_point_id": null - } - ], - "discounts": [], - "taxes": [], - "credits": [], - "payments": [ - { - "transaction_time": "2018-07-26T15:22:02Z", - "memo": "Joe Example - Monthly Product: Renewal payment", - "original_amount": "100.0", - "applied_amount": "100.0", - "payment_method": { - "card_brand": "bogus", - "card_expiration": "10/2020", - "last_four": null, - "masked_card_number": "XXXX-XXXX-XXXX-1", - "type": "credit_card" - }, - "transaction_id": 253028955, - "prepayment": false - } - ], - "refunds": [], - "custom_fields": [], - "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" -} -``` - - -# List Invoice Events - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "inv_8gd8tdhtd3hgr", + "site_id": 51288, + "customer_id": 20194505, + "subscription_id": 20597774, + "number": "117", + "sequence_number": 117, + "issue_date": "2018-07-26", + "due_date": "2018-07-26", + "paid_date": "2018-07-26", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Monthly Product", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 20194505, + "first_name": "Joe", + "last_name": "Example", + "organization": null, + "email": "joe@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "shipping_address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "credit_amount": "0.0", + "paid_amount": "100.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "line_items": [ + { + "uid": "li_8gd8tdhhgk55k", + "title": "Monthly Product", + "description": "Jul 26, 2018 - Aug 26, 2018", + "quantity": "1.0", + "unit_price": "100.0", + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "tiered_unit_price": false, + "period_range_start": "2018-07-26", + "period_range_end": "2018-08-26", + "product_id": 4607632, + "product_version": 1, + "component_id": null, + "price_point_id": null + } + ], + "discounts": [], + "taxes": [], + "credits": [], + "payments": [ + { + "transaction_time": "2018-07-26T15:22:02Z", + "memo": "Joe Example - Monthly Product: Renewal payment", + "original_amount": "100.0", + "applied_amount": "100.0", + "payment_method": { + "card_brand": "bogus", + "card_expiration": "10/2020", + "last_four": null, + "masked_card_number": "XXXX-XXXX-XXXX-1", + "type": "credit_card" + }, + "transaction_id": 253028955, + "prepayment": false + } + ], + "refunds": [], + "custom_fields": [], + "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" +} +``` + + +# 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. Exposed event types are: @@ -616,34 +616,34 @@ Invoice events are returned in ascending order. If both a `since_date` and `since_id` are provided in request parameters, the `since_date` will be used. -Note - invoice events that occurred prior to 09/05/2018 __will not__ contain an `invoice` snapshot. - -```go -ListInvoiceEvents( +Note - invoice events that occurred prior to 09/05/2018 __will not__ contain an `invoice` snapshot. + +```go +ListInvoiceEvents( ctx context.Context,input ListInvoiceEventsInput) ( models.ApiResponse[models.ListInvoiceEventsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sinceDate` | `*string` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | -| `sinceId` | `*int` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | -| `page` | `*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`. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. | -| `invoiceUid` | `*string` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | -| `withChangeInvoiceStatus` | `*string` | Query, Optional | Use this parameter if you want to fetch also invoice events with change_invoice_status type. | -| `eventTypes` | [`[]models.InvoiceEventType`](../../doc/models/invoice-event-type.md) | Query, Optional | Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`. | - -## Response Type - -[`models.ListInvoiceEventsResponse`](../../doc/models/list-invoice-events-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `sinceDate` | `*string` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | +| `sinceId` | `*int` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | +| `page` | `*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`. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. | +| `invoiceUid` | `*string` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | +| `withChangeInvoiceStatus` | `*string` | Query, Optional | Use this parameter if you want to fetch also invoice events with change_invoice_status type. | +| `eventTypes` | [`[]models.InvoiceEventType`](../../doc/models/invoice-event-type.md) | Query, Optional | Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`. | + +## Response Type + +[`models.ListInvoiceEventsResponse`](../../doc/models/list-invoice-events-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 100 @@ -655,386 +655,386 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "events": [ - { - "id": 83, - "event_type": "apply_payment", - "event_data": { - "memo": "Non-Resumable Canceled On Purpose - Standard Plan: Renewal payment", - "original_amount": "168.61", - "applied_amount": "168.61", - "transaction_time": "2018-08-01T16:00:00Z", - "payment_method": { - "card_brand": "visa", - "card_expiration": "12/2022", - "last_four": null, - "masked_card_number": "XXXX-XXXX-XXXX-1111", - "type": "credit_card" - }, - "consolidation_level": "none" - }, - "timestamp": "2018-08-01T16:00:00Z", - "invoice": { - "id": 614942008934401500, - "uid": "inv_8gk5bwkct3gqt", - "site_id": 20, - "customer_id": 6, - "subscription_id": 10, - "number": "25", - "sequence_number": 25, - "transaction_time": "2018-08-01T16:00:00Z", - "created_at": "2018-08-01T16:00:00Z", - "updated_at": "2018-08-01T16:00:00Z", - "issue_date": "2018-08-01", - "due_date": "2018-08-01", - "paid_date": "2018-08-01", - "status": "paid", - "role": "renewal", - "collection_method": "automatic", - "payment_instructions": "Please make checks payable to \"Acme, Inc.\"", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_id": null, - "subscription_group_id": null, - "parent_invoice_number": null, - "product_name": "Standard Plan", - "product_family_name": "Cloud Compute Servers", - "seller": { - "name": "Acme, Inc.", - "address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "phone": "555-555-1234 x137", - "logo_url": null - }, - "customer": { - "chargify_id": 6, - "first_name": "Non-Resumable", - "last_name": "Canceled On Purpose", - "organization": null, - "email": "evan4@example.com" - }, - "payer": { - "chargify_id": 6, - "first_name": "Non-Resumable", - "last_name": "Canceled On Purpose", - "organization": null, - "email": "evan4@example.com" - }, - "recipient_emails": [], - "net_terms": 0, - "memo": "Thanks for your business! If you have any questions, please contact your account manager.", - "billing_address": { - "street": "200 Billing Rd.", - "line2": "Suite 100", - "city": "Needham", - "state": "MA", - "zip": "02494", - "country": "US" - }, - "shipping_address": { - "street": "100 Shipping St.", - "line2": "Apt 200", - "city": "Pleasantville", - "state": "NC", - "zip": "12345", - "country": "US" - }, - "line_items": [ - { - "uid": "li_8gk5bwkct3gqk", - "title": "Standard Plan", - "description": "08/01/2018 - 09/01/2018", - "quantity": "1.0", - "unit_price": "99.0", - "subtotal_amount": "99.0", - "discount_amount": "9.9", - "tax_amount": "6.01425", - "total_amount": "95.11425", - "tiered_unit_price": false, - "period_range_start": "2018-08-01", - "period_range_end": "2018-09-01", - "transaction_id": 120, - "product_id": 84, - "product_version": 1, - "component_id": null, - "price_point_id": null, - "hide": false - }, - { - "uid": "li_8gk5bwkct3gqm", - "title": "Small Instance (Hourly)", - "description": "07/22/2018 - 08/01/2018", - "quantity": "162.0", - "unit_price": "0.09567901", - "subtotal_amount": "15.5", - "discount_amount": "1.55", - "tax_amount": "0.941625", - "total_amount": "14.891625", - "tiered_unit_price": true, - "period_range_start": "2018-07-22", - "period_range_end": "2018-08-01", - "transaction_id": 121, - "product_id": 84, - "product_version": 1, - "component_id": 76, - "price_point_id": null, - "hide": false, - "component_cost_data": { - "rates": [ - { - "component_code_id": null, - "price_point_id": 160, - "product_id": 84, - "quantity": "162.0", - "amount": "15.5", - "pricing_scheme": "tiered", - "tiers": [ - { - "starting_quantity": 1, - "ending_quantity": 100, - "quantity": "100.0", - "unit_price": "0.0", - "amount": "0.0" - }, - { - "starting_quantity": 101, - "ending_quantity": null, - "quantity": "62.0", - "unit_price": "0.25", - "amount": "15.5" - } - ] - } - ] - } - }, - { - "uid": "li_8gk5bwkct3gqn", - "title": "Large Instance (Hourly)", - "description": "07/22/2018 - 08/01/2018", - "quantity": "194.0", - "unit_price": "0.24226804", - "subtotal_amount": "47.0", - "discount_amount": "4.7", - "tax_amount": "2.85525", - "total_amount": "45.15525", - "tiered_unit_price": true, - "period_range_start": "2018-07-22", - "period_range_end": "2018-08-01", - "transaction_id": 122, - "product_id": 84, - "product_version": 1, - "component_id": 77, - "price_point_id": null, - "hide": false, - "component_cost_data": { - "rates": [ - { - "component_code_id": null, - "price_point_id": 161, - "product_id": 84, - "quantity": "194.0", - "amount": "47.0", - "pricing_scheme": "tiered", - "tiers": [ - { - "starting_quantity": 1, - "ending_quantity": 100, - "quantity": "100.0", - "unit_price": "0.0", - "amount": "0.0" - }, - { - "starting_quantity": 101, - "ending_quantity": null, - "quantity": "94.0", - "unit_price": "0.5", - "amount": "47.0" - } - ] - } - ] - } - }, - { - "uid": "li_8gk5bwkct3gqp", - "title": "IP Addresses", - "description": "08/01/2018 - 09/01/2018", - "quantity": "7.0", - "unit_price": "2.0", - "subtotal_amount": "14.0", - "discount_amount": "1.4", - "tax_amount": "0.8505", - "total_amount": "13.4505", - "tiered_unit_price": false, - "period_range_start": "2018-08-01", - "period_range_end": "2018-09-01", - "transaction_id": 123, - "product_id": 84, - "product_version": 1, - "component_id": 79, - "price_point_id": 163, - "hide": false, - "component_cost_data": { - "rates": [ - { - "component_code_id": null, - "price_point_id": 163, - "product_id": 84, - "quantity": "7.0", - "amount": "14.0", - "pricing_scheme": "per_unit", - "tiers": [ - { - "starting_quantity": 1, - "ending_quantity": null, - "quantity": "7.0", - "unit_price": "2.0", - "amount": "14.0" - } - ] - } - ] - } - } - ], - "subtotal_amount": "175.5", - "discount_amount": "17.55", - "discounts": [ - { - "uid": "dli_8gk5bwkct3gqq", - "title": "Multi-service discount (10%)", - "description": null, - "code": "MULTI3", - "source_type": "Coupon", - "source_id": 40, - "discount_type": "percentage", - "percentage": "10.0", - "eligible_amount": "175.5", - "discount_amount": "17.55", - "transaction_id": 124, - "line_item_breakouts": [ - { - "uid": "li_8gk5bwkct3gqk", - "eligible_amount": "99.0", - "discount_amount": "9.9" - }, - { - "uid": "li_8gk5bwkct3gqm", - "eligible_amount": "15.5", - "discount_amount": "1.55" - }, - { - "uid": "li_8gk5bwkct3gqn", - "eligible_amount": "47.0", - "discount_amount": "4.7" - }, - { - "uid": "li_8gk5bwkct3gqp", - "eligible_amount": "14.0", - "discount_amount": "1.4" - } - ] - } - ], - "tax_amount": "10.66", - "taxes": [ - { - "uid": "tli_8gk5bwkct3gqr", - "title": "NC Sales Tax", - "description": null, - "source_type": "Tax", - "source_id": 1, - "percentage": "6.75", - "taxable_amount": "157.95", - "tax_amount": "10.66", - "transaction_id": 125, - "line_item_breakouts": [ - { - "uid": "li_8gk5bwkct3gqk", - "taxable_amount": "89.1", - "tax_amount": "6.01425" - }, - { - "uid": "li_8gk5bwkct3gqm", - "taxable_amount": "13.95", - "tax_amount": "0.941625" - }, - { - "uid": "li_8gk5bwkct3gqn", - "taxable_amount": "42.3", - "tax_amount": "2.85525" - }, - { - "uid": "li_8gk5bwkct3gqp", - "taxable_amount": "12.6", - "tax_amount": "0.8505" - } - ], - "tax_component_breakouts": [ - { - "tax_rule_id": 1, - "percentage": "6.75", - "country_code": "US", - "subdivision_code": "NC" - } - ] - } - ], - "credit_amount": "0.0", - "refund_amount": "0.0", - "total_amount": "168.61", - "paid_amount": "168.61", - "due_amount": "0.0", - "credits": [], - "refunds": [], - "payments": [ - { - "memo": "Non-Resumable Canceled On Purpose - Standard Plan: Renewal payment", - "original_amount": "168.61", - "applied_amount": "168.61", - "transaction_time": "2018-08-01T16:00:00Z", - "payment_method": { - "card_brand": "visa", - "card_expiration": "12/2022", - "last_four": null, - "masked_card_number": "XXXX-XXXX-XXXX-1111", - "type": "credit_card" - }, - "transaction_id": 126, - "prepayment": false - } - ], - "custom_fields": [], - "display_settings": { - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false - } - } - } - ], - "page": 48, - "per_page": 1, - "total_pages": 102 -} -``` - - -# Record Payment for Invoice - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "events": [ + { + "id": 83, + "event_type": "apply_payment", + "event_data": { + "memo": "Non-Resumable Canceled On Purpose - Standard Plan: Renewal payment", + "original_amount": "168.61", + "applied_amount": "168.61", + "transaction_time": "2018-08-01T16:00:00Z", + "payment_method": { + "card_brand": "visa", + "card_expiration": "12/2022", + "last_four": null, + "masked_card_number": "XXXX-XXXX-XXXX-1111", + "type": "credit_card" + }, + "consolidation_level": "none" + }, + "timestamp": "2018-08-01T16:00:00Z", + "invoice": { + "id": 614942008934401500, + "uid": "inv_8gk5bwkct3gqt", + "site_id": 20, + "customer_id": 6, + "subscription_id": 10, + "number": "25", + "sequence_number": 25, + "transaction_time": "2018-08-01T16:00:00Z", + "created_at": "2018-08-01T16:00:00Z", + "updated_at": "2018-08-01T16:00:00Z", + "issue_date": "2018-08-01", + "due_date": "2018-08-01", + "paid_date": "2018-08-01", + "status": "paid", + "role": "renewal", + "collection_method": "automatic", + "payment_instructions": "Please make checks payable to \"Acme, Inc.\"", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_id": null, + "subscription_group_id": null, + "parent_invoice_number": null, + "product_name": "Standard Plan", + "product_family_name": "Cloud Compute Servers", + "seller": { + "name": "Acme, Inc.", + "address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "phone": "555-555-1234 x137", + "logo_url": null + }, + "customer": { + "chargify_id": 6, + "first_name": "Non-Resumable", + "last_name": "Canceled On Purpose", + "organization": null, + "email": "evan4@example.com" + }, + "payer": { + "chargify_id": 6, + "first_name": "Non-Resumable", + "last_name": "Canceled On Purpose", + "organization": null, + "email": "evan4@example.com" + }, + "recipient_emails": [], + "net_terms": 0, + "memo": "Thanks for your business! If you have any questions, please contact your account manager.", + "billing_address": { + "street": "200 Billing Rd.", + "line2": "Suite 100", + "city": "Needham", + "state": "MA", + "zip": "02494", + "country": "US" + }, + "shipping_address": { + "street": "100 Shipping St.", + "line2": "Apt 200", + "city": "Pleasantville", + "state": "NC", + "zip": "12345", + "country": "US" + }, + "line_items": [ + { + "uid": "li_8gk5bwkct3gqk", + "title": "Standard Plan", + "description": "08/01/2018 - 09/01/2018", + "quantity": "1.0", + "unit_price": "99.0", + "subtotal_amount": "99.0", + "discount_amount": "9.9", + "tax_amount": "6.01425", + "total_amount": "95.11425", + "tiered_unit_price": false, + "period_range_start": "2018-08-01", + "period_range_end": "2018-09-01", + "transaction_id": 120, + "product_id": 84, + "product_version": 1, + "component_id": null, + "price_point_id": null, + "hide": false + }, + { + "uid": "li_8gk5bwkct3gqm", + "title": "Small Instance (Hourly)", + "description": "07/22/2018 - 08/01/2018", + "quantity": "162.0", + "unit_price": "0.09567901", + "subtotal_amount": "15.5", + "discount_amount": "1.55", + "tax_amount": "0.941625", + "total_amount": "14.891625", + "tiered_unit_price": true, + "period_range_start": "2018-07-22", + "period_range_end": "2018-08-01", + "transaction_id": 121, + "product_id": 84, + "product_version": 1, + "component_id": 76, + "price_point_id": null, + "hide": false, + "component_cost_data": { + "rates": [ + { + "component_code_id": null, + "price_point_id": 160, + "product_id": 84, + "quantity": "162.0", + "amount": "15.5", + "pricing_scheme": "tiered", + "tiers": [ + { + "starting_quantity": 1, + "ending_quantity": 100, + "quantity": "100.0", + "unit_price": "0.0", + "amount": "0.0" + }, + { + "starting_quantity": 101, + "ending_quantity": null, + "quantity": "62.0", + "unit_price": "0.25", + "amount": "15.5" + } + ] + } + ] + } + }, + { + "uid": "li_8gk5bwkct3gqn", + "title": "Large Instance (Hourly)", + "description": "07/22/2018 - 08/01/2018", + "quantity": "194.0", + "unit_price": "0.24226804", + "subtotal_amount": "47.0", + "discount_amount": "4.7", + "tax_amount": "2.85525", + "total_amount": "45.15525", + "tiered_unit_price": true, + "period_range_start": "2018-07-22", + "period_range_end": "2018-08-01", + "transaction_id": 122, + "product_id": 84, + "product_version": 1, + "component_id": 77, + "price_point_id": null, + "hide": false, + "component_cost_data": { + "rates": [ + { + "component_code_id": null, + "price_point_id": 161, + "product_id": 84, + "quantity": "194.0", + "amount": "47.0", + "pricing_scheme": "tiered", + "tiers": [ + { + "starting_quantity": 1, + "ending_quantity": 100, + "quantity": "100.0", + "unit_price": "0.0", + "amount": "0.0" + }, + { + "starting_quantity": 101, + "ending_quantity": null, + "quantity": "94.0", + "unit_price": "0.5", + "amount": "47.0" + } + ] + } + ] + } + }, + { + "uid": "li_8gk5bwkct3gqp", + "title": "IP Addresses", + "description": "08/01/2018 - 09/01/2018", + "quantity": "7.0", + "unit_price": "2.0", + "subtotal_amount": "14.0", + "discount_amount": "1.4", + "tax_amount": "0.8505", + "total_amount": "13.4505", + "tiered_unit_price": false, + "period_range_start": "2018-08-01", + "period_range_end": "2018-09-01", + "transaction_id": 123, + "product_id": 84, + "product_version": 1, + "component_id": 79, + "price_point_id": 163, + "hide": false, + "component_cost_data": { + "rates": [ + { + "component_code_id": null, + "price_point_id": 163, + "product_id": 84, + "quantity": "7.0", + "amount": "14.0", + "pricing_scheme": "per_unit", + "tiers": [ + { + "starting_quantity": 1, + "ending_quantity": null, + "quantity": "7.0", + "unit_price": "2.0", + "amount": "14.0" + } + ] + } + ] + } + } + ], + "subtotal_amount": "175.5", + "discount_amount": "17.55", + "discounts": [ + { + "uid": "dli_8gk5bwkct3gqq", + "title": "Multi-service discount (10%)", + "description": null, + "code": "MULTI3", + "source_type": "Coupon", + "source_id": 40, + "discount_type": "percentage", + "percentage": "10.0", + "eligible_amount": "175.5", + "discount_amount": "17.55", + "transaction_id": 124, + "line_item_breakouts": [ + { + "uid": "li_8gk5bwkct3gqk", + "eligible_amount": "99.0", + "discount_amount": "9.9" + }, + { + "uid": "li_8gk5bwkct3gqm", + "eligible_amount": "15.5", + "discount_amount": "1.55" + }, + { + "uid": "li_8gk5bwkct3gqn", + "eligible_amount": "47.0", + "discount_amount": "4.7" + }, + { + "uid": "li_8gk5bwkct3gqp", + "eligible_amount": "14.0", + "discount_amount": "1.4" + } + ] + } + ], + "tax_amount": "10.66", + "taxes": [ + { + "uid": "tli_8gk5bwkct3gqr", + "title": "NC Sales Tax", + "description": null, + "source_type": "Tax", + "source_id": 1, + "percentage": "6.75", + "taxable_amount": "157.95", + "tax_amount": "10.66", + "transaction_id": 125, + "line_item_breakouts": [ + { + "uid": "li_8gk5bwkct3gqk", + "taxable_amount": "89.1", + "tax_amount": "6.01425" + }, + { + "uid": "li_8gk5bwkct3gqm", + "taxable_amount": "13.95", + "tax_amount": "0.941625" + }, + { + "uid": "li_8gk5bwkct3gqn", + "taxable_amount": "42.3", + "tax_amount": "2.85525" + }, + { + "uid": "li_8gk5bwkct3gqp", + "taxable_amount": "12.6", + "tax_amount": "0.8505" + } + ], + "tax_component_breakouts": [ + { + "tax_rule_id": 1, + "percentage": "6.75", + "country_code": "US", + "subdivision_code": "NC" + } + ] + } + ], + "credit_amount": "0.0", + "refund_amount": "0.0", + "total_amount": "168.61", + "paid_amount": "168.61", + "due_amount": "0.0", + "credits": [], + "refunds": [], + "payments": [ + { + "memo": "Non-Resumable Canceled On Purpose - Standard Plan: Renewal payment", + "original_amount": "168.61", + "applied_amount": "168.61", + "transaction_time": "2018-08-01T16:00:00Z", + "payment_method": { + "card_brand": "visa", + "card_expiration": "12/2022", + "last_four": null, + "masked_card_number": "XXXX-XXXX-XXXX-1111", + "type": "credit_card" + }, + "transaction_id": 126, + "prepayment": false + } + ], + "custom_fields": [], + "display_settings": { + "hide_zero_subtotal_lines": false, + "include_discounts_on_lines": false + } + } + } + ], + "page": 48, + "per_page": 1, + "total_pages": 102 +} +``` + + +# Record Payment for Invoice + This API call should be used when you want to record a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. ## Create a Payment from the existing payment profile @@ -1079,31 +1079,31 @@ In order to apply a service credit to an invoice, specify the `type` as `service } ``` -Note that Chargify will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. - -```go -RecordPaymentForInvoice( - ctx context.Context, - uid string, +Note that Chargify will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. + +```go +RecordPaymentForInvoice( + ctx context.Context, + uid string, body *models.CreateInvoicePaymentRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | -| `body` | [`*models.CreateInvoicePaymentRequest`](../../doc/models/create-invoice-payment-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`*models.CreateInvoicePaymentRequest`](../../doc/models/create-invoice-payment-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -1125,12 +1125,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Record External Payment for Invoices - +} +``` + + +# Record Payment for Multiple Invoices + This API call should be used when you want to record an external payment against multiple invoices. In order apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. @@ -1156,29 +1156,29 @@ In order apply a payment to multiple invoices, at minimum, specify the `amount` } ``` -Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. - -```go -RecordExternalPaymentForInvoices( - ctx context.Context, +Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. + +```go +RecordPaymentForMultipleInvoices( + ctx context.Context, body *models.CreateMultiInvoicePaymentRequest) ( models.ApiResponse[models.MultiInvoicePaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateMultiInvoicePaymentRequest`](../../doc/models/create-multi-invoice-payment-request.md) | Body, Optional | - | - -## Response Type - -[`models.MultiInvoicePaymentResponse`](../../doc/models/multi-invoice-payment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateMultiInvoicePaymentRequest`](../../doc/models/create-multi-invoice-payment-request.md) | Body, Optional | - | + +## Response Type + +[`models.MultiInvoicePaymentResponse`](../../doc/models/multi-invoice-payment-response.md) + +## Example Usage + +```go ctx := context.Background() bodyPaymentApplications0 := models.CreateInvoicePaymentApplication{ @@ -1204,80 +1204,80 @@ body := models.CreateMultiInvoicePaymentRequest{ Payment: bodyPayment, } -apiResponse, err := invoicesController.RecordExternalPaymentForInvoices(ctx, &body) +apiResponse, err := invoicesController.RecordPaymentForMultipleInvoices(ctx, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment": { - "transaction_id": 1, - "total_amount": "100.00", - "currency_code": "USD", - "applications": [ - { - "invoice_uid": "inv_8gk5bwkct3gqt", - "application_uid": "pmt_1tr0hgsct3ybx", - "applied_amount": "50.00" - }, - { - "invoice_uid": "inv_7bc6bwkct3lyt", - "application_uid": "pmt_2", - "applied_amount": "50.00" - } - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Credit Notes - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment": { + "transaction_id": 1, + "total_amount": "100.00", + "currency_code": "USD", + "applications": [ + { + "invoice_uid": "inv_8gk5bwkct3gqt", + "application_uid": "pmt_1tr0hgsct3ybx", + "applied_amount": "50.00" + }, + { + "invoice_uid": "inv_7bc6bwkct3lyt", + "application_uid": "pmt_2", + "applied_amount": "50.00" + } + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Credit Notes + 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`. - -```go -ListCreditNotes( +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`. + +```go +ListCreditNotes( ctx context.Context,input ListCreditNotesInput) ( models.ApiResponse[models.ListCreditNotesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `*int` | Query, Optional | The subscription's Chargify 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`. | -| `perPage` | `*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`. | -| `lineItems` | `*bool` | Query, Optional | Include line items data | -| `discounts` | `*bool` | Query, Optional | Include discounts data | -| `taxes` | `*bool` | Query, Optional | Include taxes data | -| `refunds` | `*bool` | Query, Optional | Include refunds data | -| `applications` | `*bool` | Query, Optional | Include applications data | - -## Response Type - -[`models.ListCreditNotesResponse`](../../doc/models/list-credit-notes-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `*int` | Query, Optional | The subscription's Chargify 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`. | +| `perPage` | `*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`. | +| `lineItems` | `*bool` | Query, Optional | Include line items data | +| `discounts` | `*bool` | Query, Optional | Include discounts data | +| `taxes` | `*bool` | Query, Optional | Include taxes data | +| `refunds` | `*bool` | Query, Optional | Include refunds data | +| `applications` | `*bool` | Query, Optional | Include applications data | + +## Response Type + +[`models.ListCreditNotesResponse`](../../doc/models/list-credit-notes-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -1294,315 +1294,315 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "credit_notes": [ - { - "uid": "cn_8m9vbd5kkv7kr", - "site_id": 20, - "customer_id": 3, - "subscription_id": 2, - "number": "77", - "sequence_number": 78, - "issue_date": "2018-12-31", - "applied_date": "2018-12-31", - "status": "applied", - "currency": "USD", - "memo": "Refund for overpayment", - "seller": { - "name": "Acme, Inc.", - "address": { - "street": "122 E Houston St", - "line2": "Suite 105", - "city": "San Antonio", - "state": "TX", - "zip": "78205", - "country": "US" - }, - "phone": "555-555-1234 x137" - }, - "customer": { - "chargify_id": 3, - "first_name": "Marty", - "last_name": "McFly", - "organization": "Time Travellers, Inc.", - "email": "timetraveller1985@example.com", - "reference": null - }, - "billing_address": { - "street": "200 Billing Rd.", - "line2": "Suite 100", - "city": "Needham", - "state": "MA", - "zip": "02494", - "country": "US" - }, - "shipping_address": { - "street": "100 Shipping St.", - "line2": "Apt 200", - "city": "Pleasantville", - "state": "NC", - "zip": "12345", - "country": "US" - }, - "subtotal_amount": "208.69341779", - "discount_amount": "20.87125167", - "tax_amount": "12.67783387", - "total_amount": "200.5", - "applied_amount": "200.5", - "remaining_amount": "0.0", - "line_items": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "title": "IP Addresses: 5 to 10 addresses", - "description": "38.2% credit", - "quantity": "0.9855", - "unit_price": "2.0", - "subtotal_amount": "1.971004", - "discount_amount": "0.19862831", - "tax_amount": "0.11963536", - "total_amount": "1.89201105", - "tiered_unit_price": false, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 81, - "price_point_id": 165 - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "title": "Professional Plan", - "description": "38.2% credit", - "quantity": "0.382", - "unit_price": "299.0", - "subtotal_amount": "114.21127834", - "discount_amount": "11.42112783", - "tax_amount": "6.93833516", - "total_amount": "109.72848567", - "tiered_unit_price": false, - "period_range_start": "2018-12-30", - "period_range_end": "2018-12-30", - "product_id": 85, - "product_version": 1, - "component_id": null, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjknzhx7", - "title": "Small Instance (Hourly)", - "description": "38.2% credit", - "quantity": "74.8676", - "unit_price": "0.12244898", - "subtotal_amount": "9.16746047", - "discount_amount": "0.91674605", - "tax_amount": "0.55692322", - "total_amount": "8.80763764", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 78, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjnmh25w", - "title": "Large Instance (Hourly)", - "description": "38.2% credit", - "quantity": "183.3492", - "unit_price": "0.39583333", - "subtotal_amount": "72.57572871", - "discount_amount": "7.25757287", - "tax_amount": "4.40897552", - "total_amount": "69.72713136", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 79, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjqn86kc", - "title": "Email Messages", - "description": "38.2% credit", - "quantity": "10076.9489", - "unit_price": "0.00031045", - "subtotal_amount": "3.12839588", - "discount_amount": "0.31322157", - "tax_amount": "0.19002427", - "total_amount": "3.00519858", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 80, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "title": "IP Addresses", - "description": "38.2% credit", - "quantity": "3.8198", - "unit_price": "2.0", - "subtotal_amount": "7.63955039", - "discount_amount": "0.76395504", - "tax_amount": "0.46410269", - "total_amount": "7.33969804", - "tiered_unit_price": false, - "period_range_start": "2018-12-30", - "period_range_end": "2018-12-30", - "product_id": 85, - "product_version": 1, - "component_id": 81, - "price_point_id": 165 - } - ], - "discounts": [ - { - "uid": "cndli_8k5jvdzct4h9y", - "title": "Multi-service discount (10%)", - "code": "MULTI3", - "source_type": "Coupon", - "source_id": 40, - "discount_type": "percentage", - "percentage": "10.0", - "eligible_amount": "208.69341779", - "discount_amount": "20.87125167", - "line_item_breakouts": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "eligible_amount": "1.971004", - "discount_amount": "0.19862831" - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "eligible_amount": "114.21127834", - "discount_amount": "11.42112783" - }, - { - "uid": "cnli_8kjttvjknzhx7", - "eligible_amount": "9.16746047", - "discount_amount": "0.91674605" - }, - { - "uid": "cnli_8kjttvjnmh25w", - "eligible_amount": "72.57572871", - "discount_amount": "7.25757287" - }, - { - "uid": "cnli_8kjttvjqn86kc", - "eligible_amount": "3.12839588", - "discount_amount": "0.31322157" - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "eligible_amount": "7.63955039", - "discount_amount": "0.76395504" - } - ] - } - ], - "taxes": [ - { - "uid": "cntli_8k5jvdzct4h9z", - "title": "NC Sales Tax", - "source_type": "Tax", - "source_id": 1, - "percentage": "6.75", - "taxable_amount": "187.82216613", - "tax_amount": "12.67783387", - "line_item_breakouts": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "taxable_amount": "1.77237569", - "tax_amount": "0.11963536" - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "taxable_amount": "102.7901505", - "tax_amount": "6.93833516" - }, - { - "uid": "cnli_8kjttvjknzhx7", - "taxable_amount": "8.25071442", - "tax_amount": "0.55692322" - }, - { - "uid": "cnli_8kjttvjnmh25w", - "taxable_amount": "65.31815584", - "tax_amount": "4.40897552" - }, - { - "uid": "cnli_8kjttvjqn86kc", - "taxable_amount": "2.81517432", - "tax_amount": "0.19002427" - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "taxable_amount": "6.87559535", - "tax_amount": "0.46410269" - } - ] - } - ], - "applications": [ - { - "uid": "cdt_8m9vbdbdwd28n", - "transaction_time": "2018-12-31T21:19:28Z", - "invoice_uid": "inv_8k5jvdzct4hb2", - "memo": "Refund for overpayment", - "applied_amount": "200.5" - } - ], - "refunds": [ - { - "transaction_id": 329, - "payment_id": 39, - "memo": "Refund for overpayment", - "original_amount": "524.9", - "applied_amount": "200.5" - } - ] - } - ] -} -``` - - -# Read Credit Note - -Use this endpoint to retrieve the details for a credit note. - -```go -ReadCreditNote( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "credit_notes": [ + { + "uid": "cn_8m9vbd5kkv7kr", + "site_id": 20, + "customer_id": 3, + "subscription_id": 2, + "number": "77", + "sequence_number": 78, + "issue_date": "2018-12-31", + "applied_date": "2018-12-31", + "status": "applied", + "currency": "USD", + "memo": "Refund for overpayment", + "seller": { + "name": "Acme, Inc.", + "address": { + "street": "122 E Houston St", + "line2": "Suite 105", + "city": "San Antonio", + "state": "TX", + "zip": "78205", + "country": "US" + }, + "phone": "555-555-1234 x137" + }, + "customer": { + "chargify_id": 3, + "first_name": "Marty", + "last_name": "McFly", + "organization": "Time Travellers, Inc.", + "email": "timetraveller1985@example.com", + "reference": null + }, + "billing_address": { + "street": "200 Billing Rd.", + "line2": "Suite 100", + "city": "Needham", + "state": "MA", + "zip": "02494", + "country": "US" + }, + "shipping_address": { + "street": "100 Shipping St.", + "line2": "Apt 200", + "city": "Pleasantville", + "state": "NC", + "zip": "12345", + "country": "US" + }, + "subtotal_amount": "208.69341779", + "discount_amount": "20.87125167", + "tax_amount": "12.67783387", + "total_amount": "200.5", + "applied_amount": "200.5", + "remaining_amount": "0.0", + "line_items": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "title": "IP Addresses: 5 to 10 addresses", + "description": "38.2% credit", + "quantity": "0.9855", + "unit_price": "2.0", + "subtotal_amount": "1.971004", + "discount_amount": "0.19862831", + "tax_amount": "0.11963536", + "total_amount": "1.89201105", + "tiered_unit_price": false, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 81, + "price_point_id": 165 + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "title": "Professional Plan", + "description": "38.2% credit", + "quantity": "0.382", + "unit_price": "299.0", + "subtotal_amount": "114.21127834", + "discount_amount": "11.42112783", + "tax_amount": "6.93833516", + "total_amount": "109.72848567", + "tiered_unit_price": false, + "period_range_start": "2018-12-30", + "period_range_end": "2018-12-30", + "product_id": 85, + "product_version": 1, + "component_id": null, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjknzhx7", + "title": "Small Instance (Hourly)", + "description": "38.2% credit", + "quantity": "74.8676", + "unit_price": "0.12244898", + "subtotal_amount": "9.16746047", + "discount_amount": "0.91674605", + "tax_amount": "0.55692322", + "total_amount": "8.80763764", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 78, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjnmh25w", + "title": "Large Instance (Hourly)", + "description": "38.2% credit", + "quantity": "183.3492", + "unit_price": "0.39583333", + "subtotal_amount": "72.57572871", + "discount_amount": "7.25757287", + "tax_amount": "4.40897552", + "total_amount": "69.72713136", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 79, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjqn86kc", + "title": "Email Messages", + "description": "38.2% credit", + "quantity": "10076.9489", + "unit_price": "0.00031045", + "subtotal_amount": "3.12839588", + "discount_amount": "0.31322157", + "tax_amount": "0.19002427", + "total_amount": "3.00519858", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 80, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "title": "IP Addresses", + "description": "38.2% credit", + "quantity": "3.8198", + "unit_price": "2.0", + "subtotal_amount": "7.63955039", + "discount_amount": "0.76395504", + "tax_amount": "0.46410269", + "total_amount": "7.33969804", + "tiered_unit_price": false, + "period_range_start": "2018-12-30", + "period_range_end": "2018-12-30", + "product_id": 85, + "product_version": 1, + "component_id": 81, + "price_point_id": 165 + } + ], + "discounts": [ + { + "uid": "cndli_8k5jvdzct4h9y", + "title": "Multi-service discount (10%)", + "code": "MULTI3", + "source_type": "Coupon", + "source_id": 40, + "discount_type": "percentage", + "percentage": "10.0", + "eligible_amount": "208.69341779", + "discount_amount": "20.87125167", + "line_item_breakouts": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "eligible_amount": "1.971004", + "discount_amount": "0.19862831" + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "eligible_amount": "114.21127834", + "discount_amount": "11.42112783" + }, + { + "uid": "cnli_8kjttvjknzhx7", + "eligible_amount": "9.16746047", + "discount_amount": "0.91674605" + }, + { + "uid": "cnli_8kjttvjnmh25w", + "eligible_amount": "72.57572871", + "discount_amount": "7.25757287" + }, + { + "uid": "cnli_8kjttvjqn86kc", + "eligible_amount": "3.12839588", + "discount_amount": "0.31322157" + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "eligible_amount": "7.63955039", + "discount_amount": "0.76395504" + } + ] + } + ], + "taxes": [ + { + "uid": "cntli_8k5jvdzct4h9z", + "title": "NC Sales Tax", + "source_type": "Tax", + "source_id": 1, + "percentage": "6.75", + "taxable_amount": "187.82216613", + "tax_amount": "12.67783387", + "line_item_breakouts": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "taxable_amount": "1.77237569", + "tax_amount": "0.11963536" + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "taxable_amount": "102.7901505", + "tax_amount": "6.93833516" + }, + { + "uid": "cnli_8kjttvjknzhx7", + "taxable_amount": "8.25071442", + "tax_amount": "0.55692322" + }, + { + "uid": "cnli_8kjttvjnmh25w", + "taxable_amount": "65.31815584", + "tax_amount": "4.40897552" + }, + { + "uid": "cnli_8kjttvjqn86kc", + "taxable_amount": "2.81517432", + "tax_amount": "0.19002427" + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "taxable_amount": "6.87559535", + "tax_amount": "0.46410269" + } + ] + } + ], + "applications": [ + { + "uid": "cdt_8m9vbdbdwd28n", + "transaction_time": "2018-12-31T21:19:28Z", + "invoice_uid": "inv_8k5jvdzct4hb2", + "memo": "Refund for overpayment", + "applied_amount": "200.5" + } + ], + "refunds": [ + { + "transaction_id": 329, + "payment_id": 39, + "memo": "Refund for overpayment", + "original_amount": "524.9", + "applied_amount": "200.5" + } + ] + } + ] +} +``` + + +# Read Credit Note + +Use this endpoint to retrieve the details for a credit note. + +```go +ReadCreditNote( + ctx context.Context, uid string) ( models.ApiResponse[models.CreditNote], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier of the credit note | - -## Response Type - -[`models.CreditNote`](../../doc/models/credit-note.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier of the credit note | + +## Response Type + +[`models.CreditNote`](../../doc/models/credit-note.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -1613,319 +1613,319 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "cn_8m9vbd5kkv7kr", - "site_id": 20, - "customer_id": 3, - "subscription_id": 2, - "number": "77", - "sequence_number": 78, - "issue_date": "2018-12-31", - "applied_date": "2018-12-31", - "status": "applied", - "currency": "USD", - "memo": "Refund for overpayment", - "seller": { - "name": "Acme, Inc.", - "address": { - "street": "122 E Houston St", - "line2": "Suite 105", - "city": "San Antonio", - "state": "TX", - "zip": "78205", - "country": "US" - }, - "phone": "555-555-1234 x137" - }, - "customer": { - "chargify_id": 3, - "first_name": "Marty", - "last_name": "McFly", - "organization": "Time Travellers, Inc.", - "email": "timetraveller1985@example.com", - "reference": null - }, - "billing_address": { - "street": "200 Billing Rd.", - "line2": "Suite 100", - "city": "Needham", - "state": "MA", - "zip": "02494", - "country": "US" - }, - "shipping_address": { - "street": "100 Shipping St.", - "line2": "Apt 200", - "city": "Pleasantville", - "state": "NC", - "zip": "12345", - "country": "US" - }, - "subtotal_amount": "208.69341779", - "discount_amount": "20.87125167", - "tax_amount": "12.67783387", - "total_amount": "200.5", - "applied_amount": "200.5", - "remaining_amount": "0.0", - "line_items": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "title": "IP Addresses: 5 to 10 addresses", - "description": "38.2% credit", - "quantity": "0.9855", - "unit_price": "2.0", - "subtotal_amount": "1.971004", - "discount_amount": "0.19862831", - "tax_amount": "0.11963536", - "total_amount": "1.89201105", - "tiered_unit_price": false, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 81, - "price_point_id": 165 - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "title": "Professional Plan", - "description": "38.2% credit", - "quantity": "0.382", - "unit_price": "299.0", - "subtotal_amount": "114.21127834", - "discount_amount": "11.42112783", - "tax_amount": "6.93833516", - "total_amount": "109.72848567", - "tiered_unit_price": false, - "period_range_start": "2018-12-30", - "period_range_end": "2018-12-30", - "product_id": 85, - "product_version": 1, - "component_id": null, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjknzhx7", - "title": "Small Instance (Hourly)", - "description": "38.2% credit", - "quantity": "74.8676", - "unit_price": "0.12244898", - "subtotal_amount": "9.16746047", - "discount_amount": "0.91674605", - "tax_amount": "0.55692322", - "total_amount": "8.80763764", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 78, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjnmh25w", - "title": "Large Instance (Hourly)", - "description": "38.2% credit", - "quantity": "183.3492", - "unit_price": "0.39583333", - "subtotal_amount": "72.57572871", - "discount_amount": "7.25757287", - "tax_amount": "4.40897552", - "total_amount": "69.72713136", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 79, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjqn86kc", - "title": "Email Messages", - "description": "38.2% credit", - "quantity": "10076.9489", - "unit_price": "0.00031045", - "subtotal_amount": "3.12839588", - "discount_amount": "0.31322157", - "tax_amount": "0.19002427", - "total_amount": "3.00519858", - "tiered_unit_price": true, - "period_range_start": "2018-11-30", - "period_range_end": "2018-11-30", - "product_id": 85, - "product_version": 1, - "component_id": 80, - "price_point_id": null - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "title": "IP Addresses", - "description": "38.2% credit", - "quantity": "3.8198", - "unit_price": "2.0", - "subtotal_amount": "7.63955039", - "discount_amount": "0.76395504", - "tax_amount": "0.46410269", - "total_amount": "7.33969804", - "tiered_unit_price": false, - "period_range_start": "2018-12-30", - "period_range_end": "2018-12-30", - "product_id": 85, - "product_version": 1, - "component_id": 81, - "price_point_id": 165 - } - ], - "discounts": [ - { - "uid": "cndli_8k5jvdzct4h9y", - "title": "Multi-service discount (10%)", - "code": "MULTI3", - "source_type": "Coupon", - "source_id": 40, - "discount_type": "percentage", - "percentage": "10.0", - "eligible_amount": "208.69341779", - "discount_amount": "20.87125167", - "line_item_breakouts": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "eligible_amount": "1.971004", - "discount_amount": "0.19862831" - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "eligible_amount": "114.21127834", - "discount_amount": "11.42112783" - }, - { - "uid": "cnli_8kjttvjknzhx7", - "eligible_amount": "9.16746047", - "discount_amount": "0.91674605" - }, - { - "uid": "cnli_8kjttvjnmh25w", - "eligible_amount": "72.57572871", - "discount_amount": "7.25757287" - }, - { - "uid": "cnli_8kjttvjqn86kc", - "eligible_amount": "3.12839588", - "discount_amount": "0.31322157" - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "eligible_amount": "7.63955039", - "discount_amount": "0.76395504" - } - ] - } - ], - "taxes": [ - { - "uid": "cntli_8k5jvdzct4h9z", - "title": "NC Sales Tax", - "source_type": "Tax", - "source_id": 1, - "percentage": "6.75", - "taxable_amount": "187.82216613", - "tax_amount": "12.67783387", - "line_item_breakouts": [ - { - "uid": "cnli_8k5jvdzct4h9x", - "taxable_amount": "1.77237569", - "tax_amount": "0.11963536" - }, - { - "uid": "cnli_8kjttvjcjx8b4", - "taxable_amount": "102.7901505", - "tax_amount": "6.93833516" - }, - { - "uid": "cnli_8kjttvjknzhx7", - "taxable_amount": "8.25071442", - "tax_amount": "0.55692322" - }, - { - "uid": "cnli_8kjttvjnmh25w", - "taxable_amount": "65.31815584", - "tax_amount": "4.40897552" - }, - { - "uid": "cnli_8kjttvjqn86kc", - "taxable_amount": "2.81517432", - "tax_amount": "0.19002427" - }, - { - "uid": "cnli_8kjttvjtxxbdd", - "taxable_amount": "6.87559535", - "tax_amount": "0.46410269" - } - ] - } - ], - "applications": [ - { - "uid": "cdt_8m9vbdbdwd28n", - "transaction_time": "2018-12-31T21:19:28Z", - "invoice_uid": "inv_8k5jvdzct4hb2", - "memo": "Refund for overpayment", - "applied_amount": "200.5" - } - ], - "refunds": [ - { - "transaction_id": 329, - "payment_id": 39, - "memo": "Refund for overpayment", - "original_amount": "524.9", - "applied_amount": "200.5" - } - ] -} -``` - - -# Record Payment for Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "cn_8m9vbd5kkv7kr", + "site_id": 20, + "customer_id": 3, + "subscription_id": 2, + "number": "77", + "sequence_number": 78, + "issue_date": "2018-12-31", + "applied_date": "2018-12-31", + "status": "applied", + "currency": "USD", + "memo": "Refund for overpayment", + "seller": { + "name": "Acme, Inc.", + "address": { + "street": "122 E Houston St", + "line2": "Suite 105", + "city": "San Antonio", + "state": "TX", + "zip": "78205", + "country": "US" + }, + "phone": "555-555-1234 x137" + }, + "customer": { + "chargify_id": 3, + "first_name": "Marty", + "last_name": "McFly", + "organization": "Time Travellers, Inc.", + "email": "timetraveller1985@example.com", + "reference": null + }, + "billing_address": { + "street": "200 Billing Rd.", + "line2": "Suite 100", + "city": "Needham", + "state": "MA", + "zip": "02494", + "country": "US" + }, + "shipping_address": { + "street": "100 Shipping St.", + "line2": "Apt 200", + "city": "Pleasantville", + "state": "NC", + "zip": "12345", + "country": "US" + }, + "subtotal_amount": "208.69341779", + "discount_amount": "20.87125167", + "tax_amount": "12.67783387", + "total_amount": "200.5", + "applied_amount": "200.5", + "remaining_amount": "0.0", + "line_items": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "title": "IP Addresses: 5 to 10 addresses", + "description": "38.2% credit", + "quantity": "0.9855", + "unit_price": "2.0", + "subtotal_amount": "1.971004", + "discount_amount": "0.19862831", + "tax_amount": "0.11963536", + "total_amount": "1.89201105", + "tiered_unit_price": false, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 81, + "price_point_id": 165 + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "title": "Professional Plan", + "description": "38.2% credit", + "quantity": "0.382", + "unit_price": "299.0", + "subtotal_amount": "114.21127834", + "discount_amount": "11.42112783", + "tax_amount": "6.93833516", + "total_amount": "109.72848567", + "tiered_unit_price": false, + "period_range_start": "2018-12-30", + "period_range_end": "2018-12-30", + "product_id": 85, + "product_version": 1, + "component_id": null, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjknzhx7", + "title": "Small Instance (Hourly)", + "description": "38.2% credit", + "quantity": "74.8676", + "unit_price": "0.12244898", + "subtotal_amount": "9.16746047", + "discount_amount": "0.91674605", + "tax_amount": "0.55692322", + "total_amount": "8.80763764", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 78, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjnmh25w", + "title": "Large Instance (Hourly)", + "description": "38.2% credit", + "quantity": "183.3492", + "unit_price": "0.39583333", + "subtotal_amount": "72.57572871", + "discount_amount": "7.25757287", + "tax_amount": "4.40897552", + "total_amount": "69.72713136", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 79, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjqn86kc", + "title": "Email Messages", + "description": "38.2% credit", + "quantity": "10076.9489", + "unit_price": "0.00031045", + "subtotal_amount": "3.12839588", + "discount_amount": "0.31322157", + "tax_amount": "0.19002427", + "total_amount": "3.00519858", + "tiered_unit_price": true, + "period_range_start": "2018-11-30", + "period_range_end": "2018-11-30", + "product_id": 85, + "product_version": 1, + "component_id": 80, + "price_point_id": null + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "title": "IP Addresses", + "description": "38.2% credit", + "quantity": "3.8198", + "unit_price": "2.0", + "subtotal_amount": "7.63955039", + "discount_amount": "0.76395504", + "tax_amount": "0.46410269", + "total_amount": "7.33969804", + "tiered_unit_price": false, + "period_range_start": "2018-12-30", + "period_range_end": "2018-12-30", + "product_id": 85, + "product_version": 1, + "component_id": 81, + "price_point_id": 165 + } + ], + "discounts": [ + { + "uid": "cndli_8k5jvdzct4h9y", + "title": "Multi-service discount (10%)", + "code": "MULTI3", + "source_type": "Coupon", + "source_id": 40, + "discount_type": "percentage", + "percentage": "10.0", + "eligible_amount": "208.69341779", + "discount_amount": "20.87125167", + "line_item_breakouts": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "eligible_amount": "1.971004", + "discount_amount": "0.19862831" + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "eligible_amount": "114.21127834", + "discount_amount": "11.42112783" + }, + { + "uid": "cnli_8kjttvjknzhx7", + "eligible_amount": "9.16746047", + "discount_amount": "0.91674605" + }, + { + "uid": "cnli_8kjttvjnmh25w", + "eligible_amount": "72.57572871", + "discount_amount": "7.25757287" + }, + { + "uid": "cnli_8kjttvjqn86kc", + "eligible_amount": "3.12839588", + "discount_amount": "0.31322157" + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "eligible_amount": "7.63955039", + "discount_amount": "0.76395504" + } + ] + } + ], + "taxes": [ + { + "uid": "cntli_8k5jvdzct4h9z", + "title": "NC Sales Tax", + "source_type": "Tax", + "source_id": 1, + "percentage": "6.75", + "taxable_amount": "187.82216613", + "tax_amount": "12.67783387", + "line_item_breakouts": [ + { + "uid": "cnli_8k5jvdzct4h9x", + "taxable_amount": "1.77237569", + "tax_amount": "0.11963536" + }, + { + "uid": "cnli_8kjttvjcjx8b4", + "taxable_amount": "102.7901505", + "tax_amount": "6.93833516" + }, + { + "uid": "cnli_8kjttvjknzhx7", + "taxable_amount": "8.25071442", + "tax_amount": "0.55692322" + }, + { + "uid": "cnli_8kjttvjnmh25w", + "taxable_amount": "65.31815584", + "tax_amount": "4.40897552" + }, + { + "uid": "cnli_8kjttvjqn86kc", + "taxable_amount": "2.81517432", + "tax_amount": "0.19002427" + }, + { + "uid": "cnli_8kjttvjtxxbdd", + "taxable_amount": "6.87559535", + "tax_amount": "0.46410269" + } + ] + } + ], + "applications": [ + { + "uid": "cdt_8m9vbdbdwd28n", + "transaction_time": "2018-12-31T21:19:28Z", + "invoice_uid": "inv_8k5jvdzct4hb2", + "memo": "Refund for overpayment", + "applied_amount": "200.5" + } + ], + "refunds": [ + { + "transaction_id": 329, + "payment_id": 39, + "memo": "Refund for overpayment", + "original_amount": "524.9", + "applied_amount": "200.5" + } + ] +} +``` + + +# Record Payment for Subscription + Record 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. Excess payment will result in the creation of a prepayment on the Invoice Account. -Only ungrouped or primary subscriptions may be paid using the "bulk" payment request. - -```go -RecordPaymentForSubscription( - ctx context.Context, - subscriptionId int, +Only ungrouped or primary subscriptions may be paid using the "bulk" payment request. + +```go +RecordPaymentForSubscription( + ctx context.Context, + subscriptionId int, body *models.RecordPaymentRequest) ( models.ApiResponse[models.PaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.RecordPaymentRequest`](../../doc/models/record-payment-request.md) | Body, Optional | - | - -## Response Type - -[`models.PaymentResponse`](../../doc/models/payment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.RecordPaymentRequest`](../../doc/models/record-payment-request.md) | Body, Optional | - | + +## Response Type + +[`models.PaymentResponse`](../../doc/models/payment-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1947,44 +1947,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "paid_invoices": [ - { - "invoice_uid": "xyz_012345678", - "status": "paid", - "due_amount": "0.0", - "paid_amount": "50.0" - }, - { - "invoice_uid": "xyz_012345678", - "status": "paid", - "due_amount": "0.0", - "paid_amount": "50.0" - } - ], - "prepayment": { - "subscription_id": "123456", - "amount_in_cents": "5000", - "ending_balance_in_cents": "5000" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Reopen Invoice - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "paid_invoices": [ + { + "invoice_uid": "xyz_012345678", + "status": "paid", + "due_amount": "0.0", + "paid_amount": "50.0" + }, + { + "invoice_uid": "xyz_012345678", + "status": "paid", + "due_amount": "0.0", + "paid_amount": "50.0" + } + ], + "prepayment": { + "subscription_id": "123456", + "amount_in_cents": "5000", + "ending_balance_in_cents": "5000" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# 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). 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: @@ -1996,29 +1996,29 @@ A note about reactivations: any canceled invoices from the most recent active pe ### Reopening Consolidated Invoices -When reopening a consolidated invoice, all of its canceled segments will also be reopened. - -```go -ReopenInvoice( - ctx context.Context, +When reopening a consolidated invoice, all of its canceled segments will also be reopened. + +```go +ReopenInvoice( + ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -2029,44 +2029,44 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# 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. - -```go -VoidInvoice( - ctx context.Context, - uid string, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# 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. + +```go +VoidInvoice( + ctx context.Context, + uid string, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | -| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -2085,336 +2085,336 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List 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`. - -```go -ListInvoiceSegments( - ctx context.Context,input ListInvoiceSegmentsInput) ( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# 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`. + +```go +ListConsolidatedInvoiceSegments( + ctx context.Context,input ListConsolidatedInvoiceSegmentsInput) ( models.ApiResponse[models.ConsolidatedInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `invoiceUid` | `string` | Template, Required | The unique identifier of the consolidated invoice | -| `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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments. | - -## Response Type - -[`models.ConsolidatedInvoice`](../../doc/models/consolidated-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceUid` | `string` | Template, Required | The unique identifier of the consolidated invoice | +| `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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments. | + +## Response Type + +[`models.ConsolidatedInvoice`](../../doc/models/consolidated-invoice.md) + +## Example Usage + +```go ctx := context.Background() invoiceUid := "invoice_uid0" page := 2 perPage := 50 direction := models.Direction("asc") -apiResponse, err := invoicesController.ListInvoiceSegments(ctx, invoiceUid, &page, &perPage, &direction) +apiResponse, err := invoicesController.ListConsolidatedInvoiceSegments(ctx, invoiceUid, &page, &perPage, &direction) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "invoices": [ - { - "uid": "inv_8htcd29wcq3q6", - "site_id": 51288, - "customer_id": 20153415, - "subscription_id": 23277588, - "number": "125", - "sequence_number": 125, - "issue_date": "2018-09-20", - "due_date": "2018-09-20", - "paid_date": "2018-09-20", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "parent", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": 23277588, - "product_name": "Trial and setup fee", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 20153415, - "first_name": "Meg", - "last_name": "Example", - "organization": "", - "email": "meg@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "shipping_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "credit_amount": "0.0", - "paid_amount": "100.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8htcd29wcq3q6?token=fb6kpjz5rcr2vttyjs4rcv6y" - }, - { - "uid": "inv_8hr3546xp4h8n", - "site_id": 51288, - "customer_id": 21687686, - "subscription_id": 22007644, - "number": "124", - "sequence_number": 124, - "issue_date": "2018-09-18", - "due_date": "2018-09-18", - "paid_date": null, - "status": "open", - "collection_method": "remittance", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Trial and setup fee", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 21687686, - "first_name": "Charlene", - "last_name": "Tester", - "organization": "", - "email": "food@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "", - "line2": "", - "city": "", - "state": "", - "zip": "", - "country": "" - }, - "shipping_address": { - "street": "", - "line2": "", - "city": "", - "state": "", - "zip": "", - "country": "" - }, - "subtotal_amount": "100.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "100.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "100.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546xp4h8n?token=fb6kpjz5rcr2vttyjs4rcv6y" - }, - { - "uid": "inv_8hr3546wdwxkr", - "site_id": 51288, - "customer_id": 21687670, - "subscription_id": 22007627, - "number": "123", - "sequence_number": 123, - "issue_date": "2018-09-18", - "due_date": "2018-09-18", - "paid_date": "2018-09-18", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Trial End - Free", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 21687670, - "first_name": "Hello", - "last_name": "World", - "organization": "123", - "email": "example@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 Anywhere Street", - "line2": "", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "shipping_address": { - "street": "", - "line2": "", - "city": "Boston", - "state": "AL", - "zip": "02120", - "country": "US" - }, - "subtotal_amount": "0.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "0.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546wdwxkr?token=fb6kpjz5rcr2vttyjs4rcv6y" - }, - { - "uid": "inv_8hjtk8bz56bbp", - "site_id": 51288, - "customer_id": 20137757, - "subscription_id": 20541100, - "number": "122", - "sequence_number": 122, - "issue_date": "2018-09-10", - "due_date": "2018-09-10", - "paid_date": "2018-09-10", - "status": "paid", - "collection_method": "automatic", - "payment_instructions": "Make checks payable to Acme, Inc.", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "$0 Product", - "product_family_name": "Billing Plans", - "seller": { - "name": "General Goods", - "address": { - "street": "123 General Goods Way", - "line2": "Apt. 10", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US" - }, - "phone": "555-555-1212" - }, - "customer": { - "chargify_id": 20137757, - "first_name": "Sasha", - "last_name": "Example", - "organization": "", - "email": "example@example.com" - }, - "memo": "Please pay within 15 days.", - "billing_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Catville", - "state": "MA", - "zip": "90210", - "country": "US" - }, - "shipping_address": { - "street": "123 I Love Cats Way", - "line2": "", - "city": "Catville", - "state": "AL", - "zip": "90210", - "country": "US" - }, - "subtotal_amount": "0.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "0.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "0.0", - "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" - } - ] -} -``` - - -# Create Invoice - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "invoices": [ + { + "uid": "inv_8htcd29wcq3q6", + "site_id": 51288, + "customer_id": 20153415, + "subscription_id": 23277588, + "number": "125", + "sequence_number": 125, + "issue_date": "2018-09-20", + "due_date": "2018-09-20", + "paid_date": "2018-09-20", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "parent", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": 23277588, + "product_name": "Trial and setup fee", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 20153415, + "first_name": "Meg", + "last_name": "Example", + "organization": "", + "email": "meg@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "shipping_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "credit_amount": "0.0", + "paid_amount": "100.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8htcd29wcq3q6?token=fb6kpjz5rcr2vttyjs4rcv6y" + }, + { + "uid": "inv_8hr3546xp4h8n", + "site_id": 51288, + "customer_id": 21687686, + "subscription_id": 22007644, + "number": "124", + "sequence_number": 124, + "issue_date": "2018-09-18", + "due_date": "2018-09-18", + "paid_date": null, + "status": "open", + "collection_method": "remittance", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Trial and setup fee", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 21687686, + "first_name": "Charlene", + "last_name": "Tester", + "organization": "", + "email": "food@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "", + "line2": "", + "city": "", + "state": "", + "zip": "", + "country": "" + }, + "shipping_address": { + "street": "", + "line2": "", + "city": "", + "state": "", + "zip": "", + "country": "" + }, + "subtotal_amount": "100.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "100.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "100.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546xp4h8n?token=fb6kpjz5rcr2vttyjs4rcv6y" + }, + { + "uid": "inv_8hr3546wdwxkr", + "site_id": 51288, + "customer_id": 21687670, + "subscription_id": 22007627, + "number": "123", + "sequence_number": 123, + "issue_date": "2018-09-18", + "due_date": "2018-09-18", + "paid_date": "2018-09-18", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Trial End - Free", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 21687670, + "first_name": "Hello", + "last_name": "World", + "organization": "123", + "email": "example@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 Anywhere Street", + "line2": "", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "shipping_address": { + "street": "", + "line2": "", + "city": "Boston", + "state": "AL", + "zip": "02120", + "country": "US" + }, + "subtotal_amount": "0.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "0.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8hr3546wdwxkr?token=fb6kpjz5rcr2vttyjs4rcv6y" + }, + { + "uid": "inv_8hjtk8bz56bbp", + "site_id": 51288, + "customer_id": 20137757, + "subscription_id": 20541100, + "number": "122", + "sequence_number": 122, + "issue_date": "2018-09-10", + "due_date": "2018-09-10", + "paid_date": "2018-09-10", + "status": "paid", + "collection_method": "automatic", + "payment_instructions": "Make checks payable to Acme, Inc.", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "$0 Product", + "product_family_name": "Billing Plans", + "seller": { + "name": "General Goods", + "address": { + "street": "123 General Goods Way", + "line2": "Apt. 10", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US" + }, + "phone": "555-555-1212" + }, + "customer": { + "chargify_id": 20137757, + "first_name": "Sasha", + "last_name": "Example", + "organization": "", + "email": "example@example.com" + }, + "memo": "Please pay within 15 days.", + "billing_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Catville", + "state": "MA", + "zip": "90210", + "country": "US" + }, + "shipping_address": { + "street": "123 I Love Cats Way", + "line2": "", + "city": "Catville", + "state": "AL", + "zip": "90210", + "country": "US" + }, + "subtotal_amount": "0.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "0.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "0.0", + "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" + } + ] +} +``` + + +# Create Invoice + This endpoint will allow you to create an ad hoc invoice. ### Basic Behavior @@ -2581,31 +2581,31 @@ A custom memo can be sent with the `memo` parameter to override the site's defau #### Status -By default, invoices will be created with open status. Possible alternative is `draft`. - -```go -CreateInvoice( - ctx context.Context, - subscriptionId int, +By default, invoices will be created with open status. Possible alternative is `draft`. + +```go +CreateInvoice( + ctx context.Context, + subscriptionId int, body *models.CreateInvoiceRequest) ( models.ApiResponse[models.InvoiceResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.InvoiceResponse`](../../doc/models/invoice-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.InvoiceResponse`](../../doc/models/invoice-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -2631,150 +2631,150 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "invoice": { - "uid": "inv_98nbmb93gxjz8", - "site_id": 5, - "customer_id": 13, - "subscription_id": 17, - "number": "1", - "sequence_number": 1, - "issue_date": "2020-12-02", - "due_date": "2020-12-02", - "paid_date": null, - "status": "open", - "collection_method": "remittance", - "payment_instructions": "", - "currency": "USD", - "consolidation_level": "none", - "parent_invoice_uid": null, - "parent_invoice_number": null, - "group_primary_subscription_id": null, - "product_name": "Digitized discrete initiative", - "product_family_name": "Networked bottom-line orchestration", - "role": "adhoc", - "seller": { - "name": "Steuber, West and Hegmann 1", - "address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "phone": "(766) 316-0492" - }, - "customer": { - "chargify_id": 13, - "first_name": "Dean", - "last_name": "Adams", - "organization": null, - "email": "brandi1@example.com", - "vat_number": null, - "reference": null - }, - "memo": "", - "billing_address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "shipping_address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null - }, - "subtotal_amount": "1800.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "1800.0", - "credit_amount": "0.0", - "paid_amount": "0.0", - "refund_amount": "0.0", - "due_amount": "1800.0", - "line_items": [ - { - "uid": "li_98nbmb9jgz84c", - "title": "Some product", - "description": "12/02/2020 - 12/02/2020", - "quantity": "12.0", - "unit_price": "150.0", - "subtotal_amount": "1800.0", - "discount_amount": "0.0", - "tax_amount": "0.0", - "total_amount": "1800.0", - "tiered_unit_price": false, - "period_range_start": "2020-12-02", - "period_range_end": "2020-12-02", - "product_id": null, - "product_version": null, - "product_price_point_id": null, - "component_id": null, - "price_point_id": null - } - ], - "discounts": [], - "taxes": [], - "credits": [], - "payments": [], - "refunds": [], - "custom_fields": [], - "public_url": "https://www.test-chargifypay.com/invoice/inv_98nbmb93gxjz8?token=rmfmwvbdy4xmyw5f29j5gc6x" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# Send Invoice - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "invoice": { + "uid": "inv_98nbmb93gxjz8", + "site_id": 5, + "customer_id": 13, + "subscription_id": 17, + "number": "1", + "sequence_number": 1, + "issue_date": "2020-12-02", + "due_date": "2020-12-02", + "paid_date": null, + "status": "open", + "collection_method": "remittance", + "payment_instructions": "", + "currency": "USD", + "consolidation_level": "none", + "parent_invoice_uid": null, + "parent_invoice_number": null, + "group_primary_subscription_id": null, + "product_name": "Digitized discrete initiative", + "product_family_name": "Networked bottom-line orchestration", + "role": "adhoc", + "seller": { + "name": "Steuber, West and Hegmann 1", + "address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "phone": "(766) 316-0492" + }, + "customer": { + "chargify_id": 13, + "first_name": "Dean", + "last_name": "Adams", + "organization": null, + "email": "brandi1@example.com", + "vat_number": null, + "reference": null + }, + "memo": "", + "billing_address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "shipping_address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null + }, + "subtotal_amount": "1800.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "1800.0", + "credit_amount": "0.0", + "paid_amount": "0.0", + "refund_amount": "0.0", + "due_amount": "1800.0", + "line_items": [ + { + "uid": "li_98nbmb9jgz84c", + "title": "Some product", + "description": "12/02/2020 - 12/02/2020", + "quantity": "12.0", + "unit_price": "150.0", + "subtotal_amount": "1800.0", + "discount_amount": "0.0", + "tax_amount": "0.0", + "total_amount": "1800.0", + "tiered_unit_price": false, + "period_range_start": "2020-12-02", + "period_range_end": "2020-12-02", + "product_id": null, + "product_version": null, + "product_price_point_id": null, + "component_id": null, + "price_point_id": null + } + ], + "discounts": [], + "taxes": [], + "credits": [], + "payments": [], + "refunds": [], + "custom_fields": [], + "public_url": "https://www.test-chargifypay.com/invoice/inv_98nbmb93gxjz8?token=rmfmwvbdy4xmyw5f29j5gc6x" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-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. Please note that if no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. -On success, a 204 no-content response will be returned. Please note that this does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. - -```go -SendInvoice( - ctx context.Context, - uid string, +On success, a 204 no-content response will be returned. Please note that this does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. + +```go +SendInvoice( + ctx context.Context, + uid string, body *models.SendInvoiceRequest) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | -| `body` | [`*models.SendInvoiceRequest`](../../doc/models/send-invoice-request.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`*models.SendInvoiceRequest`](../../doc/models/send-invoice-request.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -2789,43 +2789,43 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Preview Customer Information Changes - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Preview Customer Information Changes + Customer information may change after an invoice is issued which may lead to a mismatch between customer information that are present on an open invoice and actual customer information. This endpoint allows to preview these differences, if any. -The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. - -```go -PreviewCustomerInformationChanges( - ctx context.Context, +The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. + +```go +PreviewCustomerInformationChanges( + ctx context.Context, uid string) ( models.ApiResponse[models.CustomerChangesPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | - -## Response Type - -[`models.CustomerChangesPreviewResponse`](../../doc/models/customer-changes-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +[`models.CustomerChangesPreviewResponse`](../../doc/models/customer-changes-preview-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -2836,97 +2836,97 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "changes": { - "payer": { - "before": { - "last_name": "Beatty" - }, - "after": { - "last_name": "Doe" - } - }, - "shipping_address": { - "before": { - "line2": "Suite 703" - }, - "after": { - "line2": "Suite 702" - } - }, - "billing_address": { - "before": { - "line2": "Suite 703" - }, - "after": { - "line2": "Suite 702" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 1002, - "owner_type": "Customer", - "name": "Color", - "value": "blue", - "metadatum_id": 20 - } - ], - "after": [ - { - "owner_id": 1002, - "owner_type": "Customer", - "name": "Color", - "value": "green", - "metadatum_id": 20 - } - ] - } - } -} -``` - -## 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) | - - -# Update Customer Information - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "changes": { + "payer": { + "before": { + "last_name": "Beatty" + }, + "after": { + "last_name": "Doe" + } + }, + "shipping_address": { + "before": { + "line2": "Suite 703" + }, + "after": { + "line2": "Suite 702" + } + }, + "billing_address": { + "before": { + "line2": "Suite 703" + }, + "after": { + "line2": "Suite 702" + } + }, + "custom_fields": { + "before": [ + { + "owner_id": 1002, + "owner_type": "Customer", + "name": "Color", + "value": "blue", + "metadatum_id": 20 + } + ], + "after": [ + { + "owner_id": 1002, + "owner_type": "Customer", + "name": "Color", + "value": "green", + "metadatum_id": 20 + } + ] + } + } +} +``` + +## 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) | + + +# 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 before. -The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. - -```go -UpdateCustomerInformation( - ctx context.Context, +The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. + +```go +UpdateCustomerInformation( + ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -2937,208 +2937,206 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "elit Ut", - "site_id": 46283786, - "customer_id": -62349460, - "subscription_id": 12801726, - "number": "dolore et ut", - "sequence_number": -84210096, - "issue_date": "2017-01-01", - "due_date": "2017-01-30", - "paid_date": "2017-01-28", - "status": "open", - "collection_method": "Excepteur", - "payment_instructions": "enim officia", - "currency": "dolore", - "consolidation_level": "none", - "product_name": "occaecat veniam culpa", - "product_family_name": "qui commodo ea dolore cillum", - "seller": { - "name": "co", - "phone": "ullamco in officia" - }, - "customer": { - "chargify_id": -55826334, - "first_name": "deserunt", - "last_name": "velit dolore", - "email": "aliquip sed velit Lorem" - }, - "memo": "ea cupidatat deserunt", - "billing_address": { - "street": "qui commodo cupidatat sunt", - "line2": "ut officia enim", - "city": "velit minim dolore sint nulla", - "state": "velit", - "zip": "ullamco", - "country": "irure est laborum deserun" - }, - "shipping_address": { - "street": "do fugiat dolore deserunt officia", - "line2": "ipsum cillum", - "city": "aliqua laboris incididunt ut", - "state": "et fugiat sit", - "zip": "dolore do", - "country": "Excepteur consequat cillum" - }, - "subtotal_amount": "dolore mollit", - "discount_amount": "aute", - "tax_amount": "eu aliqua est velit ea", - "total_amount": "ut non", - "credit_amount": "sit", - "refund_amount": "et eiusmod qui sed", - "paid_amount": "amet nulla s", - "due_amount": "non esse ullamco", - "line_items": [ - { - "description": "qui", - "price_point_id": 123, - "tax_amount": "occaecat deserunt veniam", - "subtotal_amount": "commodo consequat tempor et Duis" - }, - { - "uid": "", - "subtotal_amount": "ven" - }, - { - "price_point_id": 94750853, - "product_id": 79058036, - "tax_amount": "1.0", - "subtotal_amount": "128.5" - }, - { - "unit_price": "eiusmod consequat ut nostrud", - "tax_amount": "quis nulla proident" - }, - { - "period_range_end": "2022-02-02", - "product_id": 57352537, - "description": "minim in dolore Ut Excepteur", - "uid": "sit qui in ullamco anim" - } - ], - "discounts": [ - { - "title": "nostrud" - } - ], - "taxes": [ - { - "source_type": "enim", - "line_item_breakouts": [ - { - "uid": "in ipsum", - "tax_amount": "velit", - "taxable_amount": "quis sint" - }, - { - "uid": "co" - } - ] - }, - { - "uid": "enim irure in", - "title": "incididunt est mollit irure" - } - ], - "credits": [ - { - "uid": "exercitation eiusmod", - "transaction_time": "2024-01-23T13:51:27Z", - "credit_note_number": "qui fugiat labore laborum", - "credit_note_uid": "ipsum sunt" - }, - { - "memo": "dolor" - } - ], - "refunds": [ - { - "memo": "deserunt elit" - }, - { - "original_amount": "Duis nulla" - } - ], - "payments": [ - { - "prepayment": false, - "memo": "enim Excepteur Lorem magna sit" - }, - { - "transaction_time": "2024-01-23T13:51:27Z", - "prepayment": false, - "payment_method": { - "details": "labore ut et", - "kind": "dolor qui", - "memo": "ea commodo", - "type": "fugiat veniam", - "card_brand": "consequat", - "card_expiration": "aliqua a", - "last_four": "ut in consectetur sed", - "masked_card_number": "minim ea ullamco nostrud tempor" - } - }, - { - "prepayment": true, - "transaction_id": 67527234 - }, - { - "original_amount": "c", - "memo": "dolore fugiat labore" - } - ], - "custom_fields": [ - { - "name": "non nul", - "value": "consectetur aliqua", - "owner_type": "ad", - "owner_id": 18482224 - }, - { - "value": "anim", - "owner_type": "in" - }, - { - "owner_id": -13438519 - }, - { - "name": "ullamco non deserunt in" - } - ], - "public_url": "dolo", - "previous_balance_data": { - "captured_at": "2024-01-09T11:22:23-05:00", - "invoices": [ - { - "number": "veniam dolore labore ipsum cupidatat", - "uid": "tempor", - "outstanding_amount": "Excepteur nostrud irur" - }, - { - "outstanding_amount": "id" - } - ] - } -} -``` - -## 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) | - - -# Issue Invoice - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "elit Ut", + "site_id": 46283786, + "customer_id": -62349460, + "subscription_id": 12801726, + "number": "dolore et ut", + "sequence_number": -84210096, + "issue_date": "2017-01-01", + "due_date": "2017-01-30", + "paid_date": "2017-01-28", + "status": "open", + "collection_method": "automatic", + "payment_instructions": "enim officia", + "currency": "dolore", + "consolidation_level": "none", + "product_name": "occaecat veniam culpa", + "product_family_name": "qui commodo ea dolore cillum", + "seller": { + "name": "co", + "phone": "ullamco in officia" + }, + "customer": { + "chargify_id": -55826334, + "first_name": "deserunt", + "last_name": "velit dolore", + "email": "aliquip sed velit Lorem" + }, + "memo": "ea cupidatat deserunt", + "billing_address": { + "street": "qui commodo cupidatat sunt", + "line2": "ut officia enim", + "city": "velit minim dolore sint nulla", + "state": "velit", + "zip": "ullamco", + "country": "irure est laborum deserun" + }, + "shipping_address": { + "street": "do fugiat dolore deserunt officia", + "line2": "ipsum cillum", + "city": "aliqua laboris incididunt ut", + "state": "et fugiat sit", + "zip": "dolore do", + "country": "Excepteur consequat cillum" + }, + "subtotal_amount": "dolore mollit", + "discount_amount": "aute", + "tax_amount": "eu aliqua est velit ea", + "total_amount": "ut non", + "credit_amount": "sit", + "refund_amount": "et eiusmod qui sed", + "paid_amount": "amet nulla s", + "due_amount": "non esse ullamco", + "line_items": [ + { + "description": "qui", + "price_point_id": 123, + "tax_amount": "occaecat deserunt veniam", + "subtotal_amount": "commodo consequat tempor et Duis" + }, + { + "uid": "", + "subtotal_amount": "ven" + }, + { + "price_point_id": 94750853, + "product_id": 79058036, + "tax_amount": "1.0", + "subtotal_amount": "128.5" + }, + { + "unit_price": "eiusmod consequat ut nostrud", + "tax_amount": "quis nulla proident" + }, + { + "period_range_end": "2022-02-02", + "product_id": 57352537, + "description": "minim in dolore Ut Excepteur", + "uid": "sit qui in ullamco anim" + } + ], + "discounts": [ + { + "title": "nostrud" + } + ], + "taxes": [ + { + "source_type": "enim", + "line_item_breakouts": [ + { + "uid": "in ipsum", + "tax_amount": "velit", + "taxable_amount": "quis sint" + }, + { + "uid": "co" + } + ] + }, + { + "uid": "enim irure in", + "title": "incididunt est mollit irure" + } + ], + "credits": [ + { + "uid": "exercitation eiusmod", + "transaction_time": "2024-01-23T13:51:27Z", + "credit_note_number": "qui fugiat labore laborum", + "credit_note_uid": "ipsum sunt" + }, + { + "memo": "dolor" + } + ], + "refunds": [ + { + "memo": "deserunt elit" + }, + { + "original_amount": "Duis nulla" + } + ], + "payments": [ + { + "prepayment": false, + "memo": "enim Excepteur Lorem magna sit" + }, + { + "transaction_time": "2024-01-23T13:51:27Z", + "prepayment": false, + "payment_method": { + "details": "labore ut et", + "kind": "dolor qui", + "memo": "ea commodo", + "type": "fugiat veniam", + "card_brand": "consequat", + "card_expiration": "aliqua a", + "last_four": "ut in consectetur sed", + "masked_card_number": "minim ea ullamco nostrud tempor" + } + }, + { + "prepayment": true, + "transaction_id": 67527234 + }, + { + "original_amount": "c", + "memo": "dolore fugiat labore" + } + ], + "custom_fields": [ + { + "name": "CustomerStatus", + "value": "Gold", + "owner_type": "Customer", + "owner_id": 18482224, + "metadatum_id": 13924 + }, + { + "name": "SubscriptionTag", + "value": "Special Subscriber", + "owner_type": "Subscription", + "owner_id": 21344, + "metadatum_id": 139245 + } + ], + "public_url": "dolo", + "previous_balance_data": { + "captured_at": "2024-01-09T11:22:23-05:00", + "invoices": [ + { + "number": "veniam dolore labore ipsum cupidatat", + "uid": "tempor", + "outstanding_amount": "Excepteur nostrud irur" + }, + { + "outstanding_amount": "id" + } + ] + } +} +``` + +## 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) | + + +# Issue Invoice + This endpoint allows you to issue an invoice that is in "pending" 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. @@ -3149,31 +3147,31 @@ For Automatic subscriptions, prepayments and service credits will apply to the i - `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). - -```go -IssueInvoice( - ctx context.Context, - uid string, +- `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). + +```go +IssueInvoice( + ctx context.Context, + uid string, body *models.IssueInvoiceRequest) ( models.ApiResponse[models.Invoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | -| `body` | [`*models.IssueInvoiceRequest`](../../doc/models/issue-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.Invoice`](../../doc/models/invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`*models.IssueInvoiceRequest`](../../doc/models/issue-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.Invoice`](../../doc/models/invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -3188,13 +3186,13 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 0e670ce0..695b335f 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -1,24 +1,24 @@ -# Offers - -```go -offersController := client.OffersController() -``` - -## Class Name - -`OffersController` - -## Methods - +# Offers + +```go +offersController := client.OffersController() +``` + +## Class Name + +`OffersController` + +## Methods + * [Create Offer](../../doc/controllers/offers.md#create-offer) * [List Offers](../../doc/controllers/offers.md#list-offers) -* [Read Offers](../../doc/controllers/offers.md#read-offers) +* [Read Offer](../../doc/controllers/offers.md#read-offer) * [Archive Offer](../../doc/controllers/offers.md#archive-offer) -* [Unarchive Offer](../../doc/controllers/offers.md#unarchive-offer) - - -# Create Offer - +* [Unarchive Offer](../../doc/controllers/offers.md#unarchive-offer) + + +# Create Offer + Create an offer within your Chargify site by sending a POST request. ## Documentation @@ -31,29 +31,29 @@ Full documentation on how to use offers in the Chargify UI can be located [here] ## 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 `product_price_point_id` is not passed in, the product's default price point will be used. - -```go -CreateOffer( - ctx context.Context, +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 `product_price_point_id` is not passed in, the product's default price point will be used. + +```go +CreateOffer( + ctx context.Context, body *models.CreateOfferRequest) ( models.ApiResponse[models.OfferResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateOfferRequest`](../../doc/models/create-offer-request.md) | Body, Optional | - | - -## Response Type - -[`models.OfferResponse`](../../doc/models/offer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateOfferRequest`](../../doc/models/create-offer-request.md) | Body, Optional | - | + +## Response Type + +[`models.OfferResponse`](../../doc/models/offer-response.md) + +## Example Usage + +```go ctx := context.Background() bodyOfferComponents0 := models.CreateOfferComponent{ @@ -83,84 +83,84 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "offer": { - "id": 3, - "site_id": 2, - "product_family_id": 4, - "product_family_name": "Chargify", - "product_id": 31, - "product_name": "30-Day Square Trial", - "product_price_in_cents": 2000, - "product_revisable_number": 0, - "name": "Solo", - "handle": "han_shot_first", - "description": "A Star Wars Story", - "created_at": "2018-06-08T14:51:52-04:00", - "updated_at": "2018-06-08T14:51:52-04:00", - "archived_at": null, - "product_price_point_name": "Default", - "offer_items": [ - { - "component_id": 24, - "component_name": "Invoices", - "component_unit_price": "3.0", - "price_point_id": 104, - "price_point_name": "Original", - "starting_quantity": "1.0", - "editable": false - } - ], - "offer_discounts": [ - { - "coupon_id": 3, - "coupon_code": "DEF456", - "coupon_name": "IB Loyalty" - } - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# List Offers - -This endpoint will list offers for a site. - -```go -ListOffers( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "offer": { + "id": 3, + "site_id": 2, + "product_family_id": 4, + "product_family_name": "Chargify", + "product_id": 31, + "product_name": "30-Day Square Trial", + "product_price_in_cents": 2000, + "product_revisable_number": 0, + "name": "Solo", + "handle": "han_shot_first", + "description": "A Star Wars Story", + "created_at": "2018-06-08T14:51:52-04:00", + "updated_at": "2018-06-08T14:51:52-04:00", + "archived_at": null, + "product_price_point_name": "Default", + "offer_items": [ + { + "component_id": 24, + "component_name": "Invoices", + "component_unit_price": "3.0", + "price_point_id": 104, + "price_point_name": "Original", + "starting_quantity": "1.0", + "editable": false + } + ], + "offer_discounts": [ + { + "coupon_id": 3, + "coupon_code": "DEF456", + "coupon_name": "IB Loyalty" + } + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# List Offers + +This endpoint will list offers for a site. + +```go +ListOffers( ctx context.Context,input ListOffersInput) ( models.ApiResponse[models.ListOffersResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `includeArchived` | `*bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | - -## Response Type - -[`models.ListOffersResponse`](../../doc/models/list-offers-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `includeArchived` | `*bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | + +## Response Type + +[`models.ListOffersResponse`](../../doc/models/list-offers-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -173,130 +173,130 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "offers": [ - { - "id": 239, - "site_id": 48110, - "product_family_id": 1025627, - "product_family_name": "Gold", - "product_id": 110, - "product_name": "Pro", - "product_price_in_cents": 1000, - "product_revisable_number": 0, - "product_price_point_id": 138, - "product_price_point_name": "Default", - "name": "Third Offer", - "handle": "third", - "description": "", - "created_at": "2018-08-03T09:56:11-05:00", - "updated_at": "2018-08-03T09:56:11-05:00", - "archived_at": null, - "offer_items": [ - { - "component_id": 426665, - "component_name": "Database Size (GB)", - "component_unit_price": "1.0", - "price_point_id": 149438, - "price_point_name": "Auto-created", - "starting_quantity": "0.0", - "editable": false, - "currency_prices": [] - } - ], - "offer_discounts": [ - { - "coupon_id": 234, - "coupon_code": "GR8_CUSTOMER", - "coupon_name": "Multi-service Discount" - } - ], - "offer_signup_pages": [ - { - "id": 356482, - "nickname": "ggoods", - "enabled": true, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargifypay.com/subscribe/hjpvhnw63tzy" - } - ] - } - ] -} -``` - - -# Read Offers - -This method allows you to list a specific offer's attributes. This is different than list all offers for a site, as it requires an `offer_id`. - -```go -ReadOffers( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "offers": [ + { + "id": 239, + "site_id": 48110, + "product_family_id": 1025627, + "product_family_name": "Gold", + "product_id": 110, + "product_name": "Pro", + "product_price_in_cents": 1000, + "product_revisable_number": 0, + "product_price_point_id": 138, + "product_price_point_name": "Default", + "name": "Third Offer", + "handle": "third", + "description": "", + "created_at": "2018-08-03T09:56:11-05:00", + "updated_at": "2018-08-03T09:56:11-05:00", + "archived_at": null, + "offer_items": [ + { + "component_id": 426665, + "component_name": "Database Size (GB)", + "component_unit_price": "1.0", + "price_point_id": 149438, + "price_point_name": "Auto-created", + "starting_quantity": "0.0", + "editable": false, + "currency_prices": [] + } + ], + "offer_discounts": [ + { + "coupon_id": 234, + "coupon_code": "GR8_CUSTOMER", + "coupon_name": "Multi-service Discount" + } + ], + "offer_signup_pages": [ + { + "id": 356482, + "nickname": "ggoods", + "enabled": true, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargifypay.com/subscribe/hjpvhnw63tzy" + } + ] + } + ] +} +``` + + +# Read Offer + +This method allows you to list a specific offer's attributes. This is different than list all offers for a site, as it requires an `offer_id`. + +```go +ReadOffer( + ctx context.Context, offerId int) ( models.ApiResponse[models.OfferResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `offerId` | `int` | Template, Required | The Chargify id of the offer | - -## Response Type - -[`models.OfferResponse`](../../doc/models/offer-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `offerId` | `int` | Template, Required | The Chargify id of the offer | + +## Response Type + +[`models.OfferResponse`](../../doc/models/offer-response.md) + +## Example Usage + +```go ctx := context.Background() offerId := 130 -apiResponse, err := offersController.ReadOffers(ctx, offerId) +apiResponse, err := offersController.ReadOffer(ctx, offerId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Archive Offer - -Archive an existing offer. Please provide an `offer_id` in order to archive the correct item. - -```go -ArchiveOffer( - ctx context.Context, +} +``` + + +# Archive Offer + +Archive an existing offer. Please provide an `offer_id` in order to archive the correct item. + +```go +ArchiveOffer( + ctx context.Context, offerId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `offerId` | `int` | Template, Required | The Chargify id of the offer | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `offerId` | `int` | Template, Required | The Chargify id of the offer | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() offerId := 130 @@ -305,35 +305,35 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Unarchive Offer - -Unarchive a previously archived offer. Please provide an `offer_id` in order to un-archive the correct item. - -```go -UnarchiveOffer( - ctx context.Context, +} +``` + + +# Unarchive Offer + +Unarchive a previously archived offer. Please provide an `offer_id` in order to un-archive the correct item. + +```go +UnarchiveOffer( + ctx context.Context, offerId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `offerId` | `int` | Template, Required | The Chargify id of the offer | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `offerId` | `int` | Template, Required | The Chargify id of the offer | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() offerId := 130 @@ -342,6 +342,6 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - +} +``` + diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 596adec1..f35abb48 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -1,15 +1,15 @@ -# Payment Profiles - -```go -paymentProfilesController := client.PaymentProfilesController() -``` - -## Class Name - -`PaymentProfilesController` - -## Methods - +# Payment Profiles + +```go +paymentProfilesController := client.PaymentProfilesController() +``` + +## Class Name + +`PaymentProfilesController` + +## Methods + * [Create Payment Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) * [List Payment Profiles](../../doc/controllers/payment-profiles.md#list-payment-profiles) * [Read Payment Profile](../../doc/controllers/payment-profiles.md#read-payment-profile) @@ -18,14 +18,14 @@ paymentProfilesController := client.PaymentProfilesController() * [Delete Subscriptions Payment Profile](../../doc/controllers/payment-profiles.md#delete-subscriptions-payment-profile) * [Verify Bank Account](../../doc/controllers/payment-profiles.md#verify-bank-account) * [Delete Subscription Group Payment Profile](../../doc/controllers/payment-profiles.md#delete-subscription-group-payment-profile) -* [Update Subscription Default Payment Profile](../../doc/controllers/payment-profiles.md#update-subscription-default-payment-profile) -* [Update Subscription Group Default Payment Profile](../../doc/controllers/payment-profiles.md#update-subscription-group-default-payment-profile) +* [Change Subscription Default Payment Profile](../../doc/controllers/payment-profiles.md#change-subscription-default-payment-profile) +* [Change Subscription Group Default Payment Profile](../../doc/controllers/payment-profiles.md#change-subscription-group-default-payment-profile) * [Read One Time Token](../../doc/controllers/payment-profiles.md#read-one-time-token) -* [Send Request Update Payment Email](../../doc/controllers/payment-profiles.md#send-request-update-payment-email) - - -# Create Payment Profile - +* [Send Request Update Payment Email](../../doc/controllers/payment-profiles.md#send-request-update-payment-email) + + +# Create Payment Profile + Use this endpoint to create a payment profile for a customer. Payment Profiles house the credit card, ACH (Authorize.Net or Stripe only,) or PayPal (Braintree only,) data for a customer. The payment information is attached to the customer within Chargify, as opposed to the Subscription itself. @@ -269,29 +269,29 @@ You may wish to redirect customers to different pages depending on whether their 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not - -```go -CreatePaymentProfile( - ctx context.Context, +8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not + +```go +CreatePaymentProfile( + ctx context.Context, body *models.CreatePaymentProfileRequest) ( models.ApiResponse[models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreatePaymentProfileRequest`](../../doc/models/create-payment-profile-request.md) | Body, Optional | When following the IBAN or the Local Bank details examples, a customer, bank account and mandate will be created in your current vault. If the customer, bank account, and mandate already exist in your vault, follow the Import example to link the payment profile into Chargify. | - -## Response Type - -[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreatePaymentProfileRequest`](../../doc/models/create-payment-profile-request.md) | Body, Optional | When following the IBAN or the Local Bank details examples, a customer, bank account and mandate will be created in your current vault. If the customer, bank account, and mandate already exist in your vault, follow the Import example to link the payment profile into Chargify. | + +## Response Type + +[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() bodyPaymentProfile := models.CreatePaymentProfile{ @@ -315,72 +315,72 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "first_name": "Jessica", - "last_name": "Test", - "card_type": "visa", - "masked_card_number": "XXXX-XXXX-XXXX-1111", - "expiration_month": 10, - "expiration_year": 2018, - "customer_id": 19195410, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Main St.", - "billing_city": "Boston", - "billing_state": "MA", - "billing_zip": "02120", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": null, - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": "handle", - "disabled": false - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Payment Profiles - -This method will return all of the 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. - -```go -ListPaymentProfiles( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "first_name": "Jessica", + "last_name": "Test", + "card_type": "visa", + "masked_card_number": "XXXX-XXXX-XXXX-1111", + "expiration_month": 10, + "expiration_year": 2018, + "customer_id": 19195410, + "current_vault": "bogus", + "vault_token": "1", + "billing_address": "123 Main St.", + "billing_city": "Boston", + "billing_state": "MA", + "billing_zip": "02120", + "billing_country": "US", + "customer_vault_token": null, + "billing_address_2": null, + "payment_type": "credit_card", + "site_gateway_setting_id": 1, + "gateway_handle": "handle", + "disabled": false + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Payment Profiles + +This method will return all of the 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. + +```go +ListPaymentProfiles( ctx context.Context,input ListPaymentProfilesInput) ( models.ApiResponse[[]models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `customerId` | `*int` | Query, Optional | The ID of the customer for which you wish to list payment profiles | - -## Response Type - -[`[]models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `customerId` | `*int` | Query, Optional | The ID of the customer for which you wish to list payment profiles | + +## Response Type + +[`[]models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -392,71 +392,71 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "payment_profile": { - "id": 10089892, - "first_name": "Chester", - "last_name": "Tester", - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "0011223344", - "billing_address": "456 Juniper Court", - "billing_city": "Boulder", - "billing_state": "CO", - "billing_zip": "80302", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "bank_name": "Bank of Kansas City", - "masked_bank_routing_number": "XXXX6789", - "masked_bank_account_number": "XXXX3344", - "bank_account_type": "checking", - "bank_account_holder_type": "personal", - "payment_type": "bank_account", - "verified": true, - "site_gateway_setting_id": 1, - "gateway_handle": "handle" - } - }, - { - "payment_profile": { - "id": 10188522, - "first_name": "Frankie", - "last_name": "Tester", - "customer_id": 14543712, - "current_vault": "bogus", - "vault_token": "123456789", - "billing_address": "123 Montana Way", - "billing_city": "Los Angeles", - "billing_state": "CA", - "billing_zip": "90210", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "bank_name": "Bank of Kansas City", - "masked_bank_routing_number": "XXXX6789", - "masked_bank_account_number": "XXXX6789", - "bank_account_type": "checking", - "bank_account_holder_type": "personal", - "payment_type": "bank_account", - "verified": true, - "site_gateway_setting_id": 1, - "gateway_handle": "handle" - } - } -] -``` - - -# Read Payment Profile - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "payment_profile": { + "id": 10089892, + "first_name": "Chester", + "last_name": "Tester", + "customer_id": 14543792, + "current_vault": "bogus", + "vault_token": "0011223344", + "billing_address": "456 Juniper Court", + "billing_city": "Boulder", + "billing_state": "CO", + "billing_zip": "80302", + "billing_country": "US", + "customer_vault_token": null, + "billing_address_2": "", + "bank_name": "Bank of Kansas City", + "masked_bank_routing_number": "XXXX6789", + "masked_bank_account_number": "XXXX3344", + "bank_account_type": "checking", + "bank_account_holder_type": "personal", + "payment_type": "bank_account", + "verified": true, + "site_gateway_setting_id": 1, + "gateway_handle": "handle" + } + }, + { + "payment_profile": { + "id": 10188522, + "first_name": "Frankie", + "last_name": "Tester", + "customer_id": 14543712, + "current_vault": "bogus", + "vault_token": "123456789", + "billing_address": "123 Montana Way", + "billing_city": "Los Angeles", + "billing_state": "CA", + "billing_zip": "90210", + "billing_country": "US", + "customer_vault_token": null, + "billing_address_2": "", + "bank_name": "Bank of Kansas City", + "masked_bank_routing_number": "XXXX6789", + "masked_bank_account_number": "XXXX6789", + "bank_account_type": "checking", + "bank_account_holder_type": "personal", + "payment_type": "bank_account", + "verified": true, + "site_gateway_setting_id": 1, + "gateway_handle": "handle" + } + } +] +``` + + +# Read Payment Profile + Using the GET method you can retrieve a Payment Profile identified by its unique ID. Please note that a different JSON object will be returned if the card method on file is a bank account. @@ -491,29 +491,29 @@ Example response for Bank Account: "gateway_handle": null } } -``` - -```go -ReadPaymentProfile( - ctx context.Context, +``` + +```go +ReadPaymentProfile( + ctx context.Context, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() paymentProfileId := 198 @@ -524,47 +524,47 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "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 - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Update Payment Profile - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "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 + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Update Payment Profile + ## Partial Card Updates In the event that you are using the Authorize.net, Stripe, Cybersource, Forte or Braintree Blue payment gateways, you can update just the billing and contact information for a payment method. Note the lack of credit-card related data contained in the JSON payload. @@ -598,31 +598,31 @@ The result will be that you have updated the billing information for the card, y - Updating a payment profile directly will not trigger an attempt to capture a past-due balance. If this is the intent, update the card details via the Subscription instead. -- If you are using Authorize.net or Stripe, you may elect to manually trigger a retry for a past due subscription after a partial update. - -```go -UpdatePaymentProfile( - ctx context.Context, - paymentProfileId int, +- If you are using Authorize.net or Stripe, you may elect to manually trigger a retry for a past due subscription after a partial update. + +```go +UpdatePaymentProfile( + ctx context.Context, + paymentProfileId int, body *models.UpdatePaymentProfileRequest) ( models.ApiResponse[models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | -| `body` | [`*models.UpdatePaymentProfileRequest`](../../doc/models/update-payment-profile-request.md) | Body, Optional | - | - -## Response Type - -[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | +| `body` | [`*models.UpdatePaymentProfileRequest`](../../doc/models/update-payment-profile-request.md) | Body, Optional | - | + +## Response Type + +[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() paymentProfileId := 198 @@ -653,73 +653,73 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "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 - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorStringMapResponseException`](../../doc/models/error-string-map-response-exception.md) | - - -# Delete Unused Payment Profile - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "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 + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorStringMapResponseException`](../../doc/models/error-string-map-response-exception.md) | + + +# Delete Unused Payment Profile + 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. - -```go -DeleteUnusedPaymentProfile( - ctx context.Context, +If the payment profile is in use by one or more subscriptions or groups, a 422 and error message will be returned. + +```go +DeleteUnusedPaymentProfile( + ctx context.Context, paymentProfileId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() paymentProfileId := 198 @@ -728,48 +728,48 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Delete Subscriptions Payment Profile - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Delete Subscriptions Payment Profile + This will delete 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). - -```go -DeleteSubscriptionsPaymentProfile( - ctx context.Context, - subscriptionId int, ++ 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). + +```go +DeleteSubscriptionsPaymentProfile( + ctx context.Context, + subscriptionId int, paymentProfileId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 paymentProfileId := 198 @@ -779,37 +779,37 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Verify Bank Account - -Submit the two small deposit amounts the customer received in their bank account in order to verify the bank account. (Stripe only) - -```go -VerifyBankAccount( - ctx context.Context, - bankAccountId int, +} +``` + + +# Verify Bank Account + +Submit the two small deposit amounts the customer received in their bank account in order to verify the bank account. (Stripe only) + +```go +VerifyBankAccount( + ctx context.Context, + bankAccountId int, body *models.BankAccountVerificationRequest) ( models.ApiResponse[models.BankAccountResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `bankAccountId` | `int` | Template, Required | Identifier of the bank account in the system. | -| `body` | [`*models.BankAccountVerificationRequest`](../../doc/models/bank-account-verification-request.md) | Body, Optional | - | - -## Response Type - -[`models.BankAccountResponse`](../../doc/models/bank-account-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bankAccountId` | `int` | Template, Required | Identifier of the bank account in the system. | +| `body` | [`*models.BankAccountVerificationRequest`](../../doc/models/bank-account-verification-request.md) | Body, Optional | - | + +## Response Type + +[`models.BankAccountResponse`](../../doc/models/bank-account-response.md) + +## Example Usage + +```go ctx := context.Background() bankAccountId := 252 @@ -829,74 +829,74 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "id": 10089892, - "first_name": "Chester", - "last_name": "Tester", - "customer_id": 14543792, - "current_vault": "stripe_connect", - "vault_token": "cus_0123abc456def", - "billing_address": "456 Juniper Court", - "billing_city": "Boulder", - "billing_state": "CO", - "billing_zip": "80302", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "bank_name": "Bank of Kansas City", - "masked_bank_routing_number": "XXXX6789", - "masked_bank_account_number": "XXXX3344", - "bank_account_type": "checking", - "bank_account_holder_type": "personal", - "payment_type": "bank_account" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Delete Subscription Group Payment Profile - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "id": 10089892, + "first_name": "Chester", + "last_name": "Tester", + "customer_id": 14543792, + "current_vault": "stripe_connect", + "vault_token": "cus_0123abc456def", + "billing_address": "456 Juniper Court", + "billing_city": "Boulder", + "billing_state": "CO", + "billing_zip": "80302", + "billing_country": "US", + "customer_vault_token": null, + "billing_address_2": "", + "bank_name": "Bank of Kansas City", + "masked_bank_routing_number": "XXXX6789", + "masked_bank_account_number": "XXXX3344", + "bank_account_type": "checking", + "bank_account_holder_type": "personal", + "payment_type": "bank_account" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Delete Subscription Group Payment Profile + This will delete a Payment Profile belonging to a Subscription Group. -**Note**: If the Payment Profile belongs to multiple Subscription Groups and/or Subscriptions, it will be removed from all of them. - -```go -DeleteSubscriptionGroupPaymentProfile( - ctx context.Context, - uid string, +**Note**: If the Payment Profile belongs to multiple Subscription Groups and/or Subscriptions, it will be removed from all of them. + +```go +DeleteSubscriptionGroupPaymentProfile( + ctx context.Context, + uid string, paymentProfileId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" paymentProfileId := 198 @@ -906,200 +906,200 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Update Subscription Default Payment Profile - +} +``` + + +# Change Subscription Default Payment Profile + This will change the default payment profile on the subscription to the existing payment profile with the id specified. -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. - -```go -UpdateSubscriptionDefaultPaymentProfile( - ctx context.Context, - subscriptionId int, +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. + +```go +ChangeSubscriptionDefaultPaymentProfile( + ctx context.Context, + subscriptionId int, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 paymentProfileId := 198 -apiResponse, err := paymentProfilesController.UpdateSubscriptionDefaultPaymentProfile(ctx, subscriptionId, paymentProfileId) +apiResponse, err := paymentProfilesController.ChangeSubscriptionDefaultPaymentProfile(ctx, subscriptionId, paymentProfileId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "id": 10211899, - "first_name": "Amelia", - "last_name": "Example", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 2, - "expiration_year": 2018, - "customer_id": 14399371, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "", - "billing_city": "", - "billing_state": "", - "billing_zip": "", - "billing_country": "", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Update Subscription Group Default Payment Profile - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "id": 10211899, + "first_name": "Amelia", + "last_name": "Example", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 2, + "expiration_year": 2018, + "customer_id": 14399371, + "current_vault": "bogus", + "vault_token": "1", + "billing_address": "", + "billing_city": "", + "billing_state": "", + "billing_zip": "", + "billing_country": "", + "customer_vault_token": null, + "billing_address_2": "", + "payment_type": "credit_card", + "site_gateway_setting_id": 1, + "gateway_handle": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# 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. 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, otherwise you will receive an error. - -```go -UpdateSubscriptionGroupDefaultPaymentProfile( - ctx context.Context, - uid string, +The new payment profile must belong to the subscription group's customer, otherwise you will receive an error. + +```go +ChangeSubscriptionGroupDefaultPaymentProfile( + ctx context.Context, + uid string, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | - -## Response Type - -[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `paymentProfileId` | `int` | Template, Required | The Chargify id of the payment profile | + +## Response Type + +[`models.PaymentProfileResponse`](../../doc/models/payment-profile-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" paymentProfileId := 198 -apiResponse, err := paymentProfilesController.UpdateSubscriptionGroupDefaultPaymentProfile(ctx, uid, paymentProfileId) +apiResponse, err := paymentProfilesController.ChangeSubscriptionGroupDefaultPaymentProfile(ctx, uid, paymentProfileId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "payment_profile": { - "id": 10211899, - "first_name": "Amelia", - "last_name": "Example", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 2, - "expiration_year": 2018, - "customer_id": 14399371, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "", - "billing_city": "", - "billing_state": "", - "billing_zip": "", - "billing_country": "", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read One Time Token - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "payment_profile": { + "id": 10211899, + "first_name": "Amelia", + "last_name": "Example", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 2, + "expiration_year": 2018, + "customer_id": 14399371, + "current_vault": "bogus", + "vault_token": "1", + "billing_address": "", + "billing_city": "", + "billing_state": "", + "billing_zip": "", + "billing_country": "", + "customer_vault_token": null, + "billing_address_2": "", + "payment_type": "credit_card", + "site_gateway_setting_id": 1, + "gateway_handle": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read One Time Token + One Time Tokens aka Chargify 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. -To obtain a One Time Token you have to use [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). - -```go -ReadOneTimeToken( - ctx context.Context, +To obtain a One Time Token you have to use [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). + +```go +ReadOneTimeToken( + ctx context.Context, chargifyToken string) ( models.ApiResponse[models.GetOneTimeTokenRequest], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `chargifyToken` | `string` | Template, Required | Chargify Token | - -## Response Type - -[`models.GetOneTimeTokenRequest`](../../doc/models/get-one-time-token-request.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `chargifyToken` | `string` | Template, Required | Chargify Token | + +## Response Type + +[`models.GetOneTimeTokenRequest`](../../doc/models/get-one-time-token-request.md) + +## Example Usage + +```go ctx := context.Background() chargifyToken := "chargify_token8" @@ -1110,47 +1110,47 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Send Request Update Payment Email - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Send Request Update Payment Email + You can send 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. Additionally, if you attempt to send a "request payment update" email for a subscription that does not exist, you will receive a `404` error response. This error message will indicate that the subscription could not be found, and will provide instructions on how to correct the error and resubmit the request. -These error responses are designed to prevent excessive or invalid requests, and to provide clear and helpful information to users who encounter errors during the request process. - -```go -SendRequestUpdatePaymentEmail( - ctx context.Context, +These error responses are designed to prevent excessive or invalid requests, and to provide clear and helpful information to users who encounter errors during the request process. + +```go +SendRequestUpdatePaymentEmail( + ctx context.Context, subscriptionId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1159,13 +1159,13 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index ed7dc84d..2cd2b412 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -1,56 +1,56 @@ -# Product Families - -```go -productFamiliesController := client.ProductFamiliesController() -``` - -## Class Name - -`ProductFamiliesController` - -## Methods - +# Product Families + +```go +productFamiliesController := client.ProductFamiliesController() +``` + +## Class Name + +`ProductFamiliesController` + +## Methods + * [List Products for Product Family](../../doc/controllers/product-families.md#list-products-for-product-family) * [Create Product Family](../../doc/controllers/product-families.md#create-product-family) * [List Product Families](../../doc/controllers/product-families.md#list-product-families) -* [Read Product Family](../../doc/controllers/product-families.md#read-product-family) - - -# List Products for Product Family - -This method allows to retrieve a list of Products belonging to a Product Family. - -```go -ListProductsForProductFamily( +* [Read Product Family](../../doc/controllers/product-families.md#read-product-family) + + +# List Products for Product Family + +This method allows to retrieve a list of Products belonging to a Product Family. + +```go +ListProductsForProductFamily( ctx context.Context,input ListProductsForProductFamilyInput) ( models.ApiResponse[[]models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the product belongs | -| `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`. | -| `perPage` | `*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`. | -| `dateField` | [`*models.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`. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | 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. | -| `startDatetime` | `*string` | 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. | -| `endDatetime` | `*string` | 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. | -| `includeArchived` | `*bool` | Query, Optional | Include archived products | -| `include` | [`*models.ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | -| `filterPrepaidProductPricePointProductPricePointId` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, 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`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | - -## Response Type - -[`[]models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the product belongs | +| `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`. | +| `perPage` | `*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`. | +| `dateField` | [`*models.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`. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | 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. | +| `startDatetime` | `*string` | 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. | +| `endDatetime` | `*string` | 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. | +| `includeArchived` | `*bool` | Query, Optional | Include archived products | +| `include` | [`*models.ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | +| `filterPrepaidProductPricePointProductPricePointId` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, 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`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | + +## Response Type + +[`[]models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 page := 2 @@ -65,142 +65,142 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "product": { - "id": 3801242, - "name": "Free product", - "handle": "zero-dollar-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2016-04-21T16:08:39-04:00", - "updated_at": "2016-08-03T11:27:53-04:00", - "price_in_cents": 10000, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": 0, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "initial_charge_after_trial": false, - "version_number": 4, - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 283460, - "return_url": null, - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/smcc4j3d2w6h/zero-dollar-product" - } - ], - "product_price_point_name": "Default", - "use_site_exchange_rate": true - } - }, - { - "product": { - "id": 3858146, - "name": "Calendar Billing Product", - "handle": "calendar-billing-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2016-07-05T13:07:38-04:00", - "updated_at": "2016-07-05T13:07:38-04:00", - "price_in_cents": 10000, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": "", - "taxable": false, - "update_return_url": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 289193, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/gxdbfxzxhcjq/calendar-billing-product" - } - ], - "product_price_point_name": "Default", - "use_site_exchange_rate": true - } - } -] -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Create Product Family - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "product": { + "id": 3801242, + "name": "Free product", + "handle": "zero-dollar-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2016-04-21T16:08:39-04:00", + "updated_at": "2016-08-03T11:27:53-04:00", + "price_in_cents": 10000, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": 0, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "initial_charge_after_trial": false, + "version_number": 4, + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 283460, + "return_url": null, + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/smcc4j3d2w6h/zero-dollar-product" + } + ], + "product_price_point_name": "Default", + "use_site_exchange_rate": true + } + }, + { + "product": { + "id": 3858146, + "name": "Calendar Billing Product", + "handle": "calendar-billing-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2016-07-05T13:07:38-04:00", + "updated_at": "2016-07-05T13:07:38-04:00", + "price_in_cents": 10000, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": "", + "taxable": false, + "update_return_url": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 289193, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/gxdbfxzxhcjq/calendar-billing-product" + } + ], + "product_price_point_name": "Default", + "use_site_exchange_rate": true + } + } +] +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Create Product Family + This method will create a Product Family within your Chargify 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 Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405369633421). - -```go -CreateProductFamily( - ctx context.Context, +Full documentation on how Product Families operate within the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405369633421). + +```go +CreateProductFamily( + ctx context.Context, body *models.CreateProductFamilyRequest) ( models.ApiResponse[models.ProductFamilyResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateProductFamilyRequest`](../../doc/models/create-product-family-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProductFamilyResponse`](../../doc/models/product-family-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateProductFamilyRequest`](../../doc/models/create-product-family-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProductFamilyResponse`](../../doc/models/product-family-response.md) + +## Example Usage + +```go ctx := context.Background() bodyProductFamily := models.CreateProductFamily{ @@ -219,58 +219,58 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product_family": { - "id": 933860, - "name": "Acme Projects", - "description": "Amazing project management tool", - "handle": "acme-projects", - "accounting_code": null - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Product Families - -This method allows to retrieve a list of Product Families for a site. - -```go -ListProductFamilies( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product_family": { + "id": 933860, + "name": "Acme Projects", + "description": "Amazing project management tool", + "handle": "acme-projects", + "accounting_code": null + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Product Families + +This method allows to retrieve a list of Product Families for a site. + +```go +ListProductFamilies( ctx context.Context,input ListProductFamiliesInput) ( models.ApiResponse[[]models.ProductFamilyResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dateField` | [`*models.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`. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `endDate` | `*string` | 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. | -| `startDatetime` | `*string` | 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. | -| `endDatetime` | `*string` | 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. | - -## Response Type - -[`[]models.ProductFamilyResponse`](../../doc/models/product-family-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `dateField` | [`*models.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`. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `endDate` | `*string` | 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. | +| `startDatetime` | `*string` | 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. | +| `endDatetime` | `*string` | 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. | + +## Response Type + +[`[]models.ProductFamilyResponse`](../../doc/models/product-family-response.md) + +## Example Usage + +```go ctx := context.Background() dateField := models.BasicDateField("updated_at") @@ -281,66 +281,66 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "product_family": { - "id": 37, - "name": "Acme Projects", - "description": null, - "handle": "acme-projects", - "accounting_code": null, - "created_at": "2013-02-20T15:05:51-07:00", - "updated_at": "2013-02-20T15:05:51-07:00" - } - }, - { - "product_family": { - "id": 155, - "name": "Bat Family", - "description": "Another family.", - "handle": "bat-family", - "accounting_code": null, - "created_at": "2014-04-16T12:41:13-06:00", - "updated_at": "2014-04-16T12:41:13-06:00" - } - } -] -``` - - -# Read Product Family - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "product_family": { + "id": 37, + "name": "Acme Projects", + "description": null, + "handle": "acme-projects", + "accounting_code": null, + "created_at": "2013-02-20T15:05:51-07:00", + "updated_at": "2013-02-20T15:05:51-07:00" + } + }, + { + "product_family": { + "id": 155, + "name": "Bat Family", + "description": "Another family.", + "handle": "bat-family", + "accounting_code": null, + "created_at": "2014-04-16T12:41:13-06:00", + "updated_at": "2014-04-16T12:41:13-06:00" + } + } +] +``` + + +# Read Product Family + This method allows to retrieve a Product Family via the `product_family_id`. The response will contain a Product Family object. -The product family can be specified either with the id number, or with the `handle:my-family` format. - -```go -ReadProductFamily( - ctx context.Context, +The product family can be specified either with the id number, or with the `handle:my-family` format. + +```go +ReadProductFamily( + ctx context.Context, id int) ( models.ApiResponse[models.ProductFamilyResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `int` | Template, Required | The Chargify id of the product family | - -## Response Type - -[`models.ProductFamilyResponse`](../../doc/models/product-family-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `int` | Template, Required | The Chargify id of the product family | + +## Response Type + +[`models.ProductFamilyResponse`](../../doc/models/product-family-response.md) + +## Example Usage + +```go ctx := context.Background() id := 112 @@ -351,20 +351,20 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - } -} -``` - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + } +} +``` + diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index cfbad67a..b5f171a5 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -1,15 +1,15 @@ -# Product Price Points - -```go -productPricePointsController := client.ProductPricePointsController() -``` - -## Class Name - -`ProductPricePointsController` - -## Methods - +# Product Price Points + +```go +productPricePointsController := client.ProductPricePointsController() +``` + +## Class Name + +`ProductPricePointsController` + +## Methods + * [Create Product Price Point](../../doc/controllers/product-price-points.md#create-product-price-point) * [List Product Price Points](../../doc/controllers/product-price-points.md#list-product-price-points) * [Update Product Price Point](../../doc/controllers/product-price-points.md#update-product-price-point) @@ -17,39 +17,39 @@ productPricePointsController := client.ProductPricePointsController() * [Archive Product Price Point](../../doc/controllers/product-price-points.md#archive-product-price-point) * [Unarchive Product Price Point](../../doc/controllers/product-price-points.md#unarchive-product-price-point) * [Promote Product Price Point to Default](../../doc/controllers/product-price-points.md#promote-product-price-point-to-default) -* [Create Product Price Points](../../doc/controllers/product-price-points.md#create-product-price-points) +* [Bulk Create Product Price Points](../../doc/controllers/product-price-points.md#bulk-create-product-price-points) * [Create Product Currency Prices](../../doc/controllers/product-price-points.md#create-product-currency-prices) * [Update Product Currency Prices](../../doc/controllers/product-price-points.md#update-product-currency-prices) -* [List All Product Price Points](../../doc/controllers/product-price-points.md#list-all-product-price-points) - - -# Create Product Price Point - -[Product Price Point Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755824155) - -```go -CreateProductPricePoint( - ctx context.Context, - productId interface{}, +* [List All Product Price Points](../../doc/controllers/product-price-points.md#list-all-product-price-points) + + +# Create Product Price Point + +[Product Price Point Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755824155) + +```go +CreateProductPricePoint( + ctx context.Context, + productId interface{}, body *models.CreateProductPricePointRequest) ( models.ApiResponse[models.ProductPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `body` | [`*models.CreateProductPricePointRequest`](../../doc/models/create-product-price-point-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `body` | [`*models.CreateProductPricePointRequest`](../../doc/models/create-product-price-point-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() productId := interface{}("[key1, val1][key2, val2]") @@ -79,71 +79,71 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ProductPricePointErrorResponseException`](../../doc/models/product-price-point-error-response-exception.md) | - - -# List Product Price Points - -Use this endpoint to retrieve a list of product price points. - -```go -ListProductPricePoints( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ProductPricePointErrorResponseException`](../../doc/models/product-price-point-error-response-exception.md) | + + +# List Product Price Points + +Use this endpoint to retrieve a list of product price points. + +```go +ListProductPricePoints( ctx context.Context,input ListProductPricePointsInput) ( models.ApiResponse[models.ListProductPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `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`. | -| `perPage` | `*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. | -| `currencyPrices` | `*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. | -| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | - -## Response Type - -[`models.ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `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`. | +| `perPage` | `*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. | +| `currencyPrices` | `*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. | +| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | + +## Response Type + +[`models.ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) + +## Example Usage + +```go ctx := context.Background() productId := interface{}("[key1, val1][key2, val2]") page := 2 @@ -156,70 +156,70 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } - ] -} -``` - - -# Update Product Price Point - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } + ] +} +``` + + +# Update Product Price Point + Use this endpoint to update a product price point. -Note: Custom product price points are not able to be updated. - -```go -UpdateProductPricePoint( - ctx context.Context, - productId interface{}, - pricePointId interface{}, +Note: Custom product price points are not able to be updated. + +```go +UpdateProductPricePoint( + ctx context.Context, + productId interface{}, + pricePointId interface{}, body *models.UpdateProductPricePointRequest) ( models.ApiResponse[models.ProductPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | -| `body` | [`*models.UpdateProductPricePointRequest`](../../doc/models/update-product-price-point-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | +| `body` | [`*models.UpdateProductPricePointRequest`](../../doc/models/update-product-price-point-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() productId := interface{}("[key1, val1][key2, val2]") pricePointId := interface{}("[key1, val1][key2, val2]") @@ -240,66 +240,66 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } -} -``` - - -# Read Product Price Point - -Use this endpoint to retrieve details for a specific product price point. - -```go -ReadProductPricePoint( - ctx context.Context, - productId interface{}, - pricePointId interface{}, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } +} +``` + + +# Read Product Price Point + +Use this endpoint to retrieve details for a specific product price point. + +```go +ReadProductPricePoint( + ctx context.Context, + productId interface{}, + pricePointId interface{}, currencyPrices *bool) ( models.ApiResponse[models.ProductPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | -| `currencyPrices` | `*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. | - -## Response Type - -[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | +| `currencyPrices` | `*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. | + +## Response Type + +[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() productId := interface{}("[key1, val1][key2, val2]") pricePointId := interface{}("[key1, val1][key2, val2]") @@ -311,64 +311,64 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } -} -``` - - -# Archive Product Price Point - -Use this endpoint to archive a product price point. - -```go -ArchiveProductPricePoint( - ctx context.Context, - productId interface{}, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } +} +``` + + +# Archive Product Price Point + +Use this endpoint to archive a product price point. + +```go +ArchiveProductPricePoint( + ctx context.Context, + productId interface{}, pricePointId interface{}) ( models.ApiResponse[models.ProductPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | - -## Response Type - -[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `interface{}` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `pricePointId` | `interface{}` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | + +## Response Type + +[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() productId := interface{}("[key1, val1][key2, val2]") pricePointId := interface{}("[key1, val1][key2, val2]") @@ -380,70 +380,70 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Unarchive Product Price Point - -Use this endpoint to unarchive an archived product price point. - -```go -UnarchiveProductPricePoint( - ctx context.Context, - productId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Unarchive Product Price Point + +Use this endpoint to unarchive an archived product price point. + +```go +UnarchiveProductPricePoint( + ctx context.Context, + productId int, pricePointId int) ( models.ApiResponse[models.ProductPricePointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the product price point | - -## Response Type - -[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the product price point | + +## Response Type + +[`models.ProductPricePointResponse`](../../doc/models/product-price-point-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 pricePointId := 10 @@ -455,66 +455,66 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_point": { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } -} -``` - - -# Promote Product Price Point to Default - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_point": { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } +} +``` + + +# Promote Product Price Point to Default + Use this endpoint to make a product price point the default for the product. -Note: Custom product price points are not able to be set as the default for a product. - -```go -PromoteProductPricePointToDefault( - ctx context.Context, - productId int, +Note: Custom product price points are not able to be set as the default for a product. + +```go +PromoteProductPricePointToDefault( + ctx context.Context, + productId int, pricePointId int) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product to which the price point belongs | -| `pricePointId` | `int` | Template, Required | The Chargify id of the product price point | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product to which the price point belongs | +| `pricePointId` | `int` | Template, Required | The Chargify id of the product price point | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 pricePointId := 10 @@ -526,91 +526,91 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 29778, - "name": "Educational", - "handle": "educational", - "description": null, - "accounting_code": null, - "request_credit_card": true, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "created_at": "2023-12-01T06:56:12-05:00", - "updated_at": "2023-12-01T06:56:26-05:00", - "price_in_cents": 100, - "interval": 2, - "interval_unit": "month", - "initial_charge_in_cents": 120000, - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": null, - "taxable": false, - "update_return_url": null, - "tax_code": null, - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": null, - "default_product_price_point_id": 32395, - "request_billing_address": false, - "require_billing_address": false, - "require_shipping_address": false, - "use_site_exchange_rate": true, - "item_category": null, - "product_price_point_id": 32395, - "product_price_point_name": "Default", - "product_price_point_handle": "uuid:8c878f50-726e-013c-c71b-0286551bb34f", - "product_family": { - "id": 933860, - "name": "Acme Projects", - "description": "Amazing project management tool", - "handle": "acme-projects", - "accounting_code": null, - "created_at": "2023-12-01T06:56:12-05:00", - "updated_at": "2023-12-01T06:56:12-05:00" - }, - "public_signup_pages": [] - } -} -``` - - -# Create Product Price Points - -Use this endpoint to create multiple product price points in one request. - -```go -CreateProductPricePoints( - ctx context.Context, - productId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 29778, + "name": "Educational", + "handle": "educational", + "description": null, + "accounting_code": null, + "request_credit_card": true, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "created_at": "2023-12-01T06:56:12-05:00", + "updated_at": "2023-12-01T06:56:26-05:00", + "price_in_cents": 100, + "interval": 2, + "interval_unit": "month", + "initial_charge_in_cents": 120000, + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": null, + "taxable": false, + "update_return_url": null, + "tax_code": null, + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": null, + "default_product_price_point_id": 32395, + "request_billing_address": false, + "require_billing_address": false, + "require_shipping_address": false, + "use_site_exchange_rate": true, + "item_category": null, + "product_price_point_id": 32395, + "product_price_point_name": "Default", + "product_price_point_handle": "uuid:8c878f50-726e-013c-c71b-0286551bb34f", + "product_family": { + "id": 933860, + "name": "Acme Projects", + "description": "Amazing project management tool", + "handle": "acme-projects", + "accounting_code": null, + "created_at": "2023-12-01T06:56:12-05:00", + "updated_at": "2023-12-01T06:56:12-05:00" + }, + "public_signup_pages": [] + } +} +``` + + +# Bulk Create Product Price Points + +Use this endpoint to create multiple product price points in one request. + +```go +BulkCreateProductPricePoints( + ctx context.Context, + productId int, body *models.BulkCreateProductPricePointsRequest) ( models.ApiResponse[models.BulkCreateProductPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product to which the price points belong | -| `body` | [`*models.BulkCreateProductPricePointsRequest`](../../doc/models/bulk-create-product-price-points-request.md) | Body, Optional | - | - -## Response Type - -[`models.BulkCreateProductPricePointsResponse`](../../doc/models/bulk-create-product-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product to which the price points belong | +| `body` | [`*models.BulkCreateProductPricePointsRequest`](../../doc/models/bulk-create-product-price-points-request.md) | Body, Optional | - | + +## Response Type + +[`models.BulkCreateProductPricePointsResponse`](../../doc/models/bulk-create-product-price-points-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 @@ -649,83 +649,83 @@ body := models.BulkCreateProductPricePointsRequest{ PricePoints: bodyPricePoints, } -apiResponse, err := productPricePointsController.CreateProductPricePoints(ctx, productId, &body) +apiResponse, err := productPricePointsController.BulkCreateProductPricePoints(ctx, productId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 283, - "name": "Educational", - "handle": "educational", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "trial_price_in_cents": 4900, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "initial_charge_in_cents": 120000, - "initial_charge_after_trial": false, - "expiration_interval": 12, - "expiration_interval_unit": "month", - "product_id": 901, - "archived_at": "2023-11-30T06:37:20-05:00", - "created_at": "2023-11-27T06:37:20-05:00", - "updated_at": "2023-11-27T06:37:20-05:00" - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | `ApiError` | - - -# Create Product Currency Prices - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 283, + "name": "Educational", + "handle": "educational", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "trial_price_in_cents": 4900, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "initial_charge_in_cents": 120000, + "initial_charge_after_trial": false, + "expiration_interval": 12, + "expiration_interval_unit": "month", + "product_id": 901, + "archived_at": "2023-11-30T06:37:20-05:00", + "created_at": "2023-11-27T06:37:20-05:00", + "updated_at": "2023-11-27T06:37:20-05:00" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | `ApiError` | + + +# Create Product Currency Prices + This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. When creating currency prices, they need to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. -Note: Currency Prices are not able to be created for custom product price points. - -```go -CreateProductCurrencyPrices( - ctx context.Context, - productPricePointId int, +Note: Currency Prices are not able to be created for custom product price points. + +```go +CreateProductCurrencyPrices( + ctx context.Context, + productPricePointId int, body *models.CreateProductCurrencyPricesRequest) ( models.ApiResponse[models.CurrencyPricesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productPricePointId` | `int` | Template, Required | The Chargify id of the product price point | -| `body` | [`*models.CreateProductCurrencyPricesRequest`](../../doc/models/create-product-currency-prices-request.md) | Body, Optional | - | - -## Response Type - -[`models.CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productPricePointId` | `int` | Template, Required | The Chargify id of the product price point | +| `body` | [`*models.CreateProductCurrencyPricesRequest`](../../doc/models/create-product-currency-prices-request.md) | Body, Optional | - | + +## Response Type + +[`models.CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) + +## Example Usage + +```go ctx := context.Background() productPricePointId := 234 @@ -759,64 +759,64 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "currency_prices": [ - { - "id": 100, - "currency": "EUR", - "price": 123, - "formatted_price": "€123,00", - "product_price_point_id": 32669, - "role": "baseline" - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# Update Product Currency Prices - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "currency_prices": [ + { + "id": 100, + "currency": "EUR", + "price": 123, + "formatted_price": "€123,00", + "product_price_point_id": 32669, + "role": "baseline" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Update Product Currency Prices + This endpoint allows you to update the `price`s of currency prices for a given currency that exists on the product price point. When updating the pricing, it needs to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. -Note: Currency Prices are not able to be updated for custom product price points. - -```go -UpdateProductCurrencyPrices( - ctx context.Context, - productPricePointId int, +Note: Currency Prices are not able to be updated for custom product price points. + +```go +UpdateProductCurrencyPrices( + ctx context.Context, + productPricePointId int, body *models.UpdateCurrencyPricesRequest) ( models.ApiResponse[models.CurrencyPricesResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productPricePointId` | `int` | Template, Required | The Chargify id of the product price point | -| `body` | [`*models.UpdateCurrencyPricesRequest`](../../doc/models/update-currency-prices-request.md) | Body, Optional | - | - -## Response Type - -[`models.CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productPricePointId` | `int` | Template, Required | The Chargify id of the product price point | +| `body` | [`*models.UpdateCurrencyPricesRequest`](../../doc/models/update-currency-prices-request.md) | Body, Optional | - | + +## Response Type + +[`models.CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) + +## Example Usage + +```go ctx := context.Background() productPricePointId := 234 @@ -842,68 +842,68 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "currency_prices": [ - { - "id": 123, - "currency": "EUR", - "price": 100, - "formatted_price": "€123,00", - "product_price_point_id": 32669, - "role": "baseline" - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# List All Product Price Points - -This method allows retrieval of a list of Products Price Points belonging to a Site. - -```go -ListAllProductPricePoints( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "currency_prices": [ + { + "id": 123, + "currency": "EUR", + "price": 100, + "formatted_price": "€123,00", + "product_price_point_id": 32669, + "role": "baseline" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# List All Product Price Points + +This method allows retrieval of a list of Products Price Points belonging to a Site. + +```go +ListAllProductPricePoints( ctx context.Context,input ListAllProductPricePointsInput) ( models.ApiResponse[models.ListProductPricePointsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `filterArchivedAt` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | -| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query: `filter[date_field]=created_at`. | -| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | -| `filterIds` | `[]int` | Query, Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | -| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | -| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=catalog,custom`. | -| `include` | [`*models.ListProductsPricePointsInclude`](../../doc/models/list-products-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `*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`. | -| `perPage` | `*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`. | - -## Response Type - -[`models.ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | +| `filterArchivedAt` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | +| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query: `filter[date_field]=created_at`. | +| `filterEndDate` | `*time.Time` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `filterEndDatetime` | `*time.Time` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | +| `filterIds` | `[]int` | Query, Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | +| `filterStartDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns price points with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `filterStartDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points 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. | +| `filterType` | [`[]models.PricePointType`](../../doc/models/price-point-type.md) | Query, Optional | Allows fetching price points with matching type. Use in query: `filter[type]=catalog,custom`. | +| `include` | [`*models.ListProductsPricePointsInclude`](../../doc/models/list-products-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | +| `page` | `*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`. | +| `perPage` | `*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`. | + +## Response Type + +[`models.ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) + +## Example Usage + +```go ctx := context.Background()Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key') include := models.ListProductsPricePointsInclude("currency_prices") page := 2 @@ -916,42 +916,42 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "price_points": [ - { - "id": 0, - "name": "My pricepoint", - "handle": "handle", - "price_in_cents": 10, - "interval": 5, - "interval_unit": "month", - "trial_price_in_cents": 10, - "trial_interval": 1, - "trial_interval_unit": "month", - "trial_type": "payment_expected", - "introductory_offer": true, - "initial_charge_in_cents": 0, - "initial_charge_after_trial": true, - "expiration_interval": 0, - "expiration_interval_unit": "month", - "product_id": 1230, - "created_at": "2021-04-02T17:52:09-04:00", - "updated_at": "2021-04-02T17:52:09-04:00", - "use_site_exchange_rate": true - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "price_points": [ + { + "id": 0, + "name": "My pricepoint", + "handle": "handle", + "price_in_cents": 10, + "interval": 5, + "interval_unit": "month", + "trial_price_in_cents": 10, + "trial_interval": 1, + "trial_interval_unit": "month", + "trial_type": "payment_expected", + "introductory_offer": true, + "initial_charge_in_cents": 0, + "initial_charge_after_trial": true, + "expiration_interval": 0, + "expiration_interval_unit": "month", + "product_id": 1230, + "created_at": "2021-04-02T17:52:09-04:00", + "updated_at": "2021-04-02T17:52:09-04:00", + "use_site_exchange_rate": true + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 4dcd63f8..529dee5f 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -1,53 +1,53 @@ -# Products - -```go -productsController := client.ProductsController() -``` - -## Class Name - -`ProductsController` - -## Methods - +# Products + +```go +productsController := client.ProductsController() +``` + +## Class Name + +`ProductsController` + +## Methods + * [Create Product](../../doc/controllers/products.md#create-product) * [Read Product](../../doc/controllers/products.md#read-product) * [Update Product](../../doc/controllers/products.md#update-product) * [Archive Product](../../doc/controllers/products.md#archive-product) * [Read Product by Handle](../../doc/controllers/products.md#read-product-by-handle) -* [List Products](../../doc/controllers/products.md#list-products) - - -# Create Product - +* [List Products](../../doc/controllers/products.md#list-products) + + +# Create Product + Use this method to create a product within your Chargify site. + [Products Documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405561405709) -+ [Changing a Subscription's Product](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404225334669-Product-Changes-Migrations) - -```go -CreateProduct( - ctx context.Context, - productFamilyId int, ++ [Changing a Subscription's Product](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404225334669-Product-Changes-Migrations) + +```go +CreateProduct( + ctx context.Context, + productFamilyId int, body *models.CreateOrUpdateProductRequest) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the product belongs | -| `body` | [`*models.CreateOrUpdateProductRequest`](../../doc/models/create-or-update-product-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productFamilyId` | `int` | Template, Required | The Chargify id of the product family to which the product belongs | +| `body` | [`*models.CreateOrUpdateProductRequest`](../../doc/models/create-or-update-product-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productFamilyId := 140 @@ -75,90 +75,90 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 4364984, - "name": "Gold Plan", - "handle": "gold", - "description": "This is our gold plan.", - "accounting_code": "123", - "request_credit_card": true, - "created_at": "2016-11-04T16:31:15-04:00", - "updated_at": "2016-11-04T16:31:15-04:00", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "expiration_interval_unit": null, - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": null, - "archived_at": null, - "require_credit_card": true, - "return_params": null, - "taxable": false, - "update_return_url": null, - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": null, - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 301078, - "return_url": null, - "return_params": null, - "url": "https://general-goods.chargify.com/subscribe/ftgbpq7f5qpr/gold" - } - ], - "product_price_point_name": "Default" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Product - -This endpoint allows you to read the current details of a product that you've created in Chargify. - -```go -ReadProduct( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 4364984, + "name": "Gold Plan", + "handle": "gold", + "description": "This is our gold plan.", + "accounting_code": "123", + "request_credit_card": true, + "created_at": "2016-11-04T16:31:15-04:00", + "updated_at": "2016-11-04T16:31:15-04:00", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "expiration_interval_unit": null, + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": null, + "archived_at": null, + "require_credit_card": true, + "return_params": null, + "taxable": false, + "update_return_url": null, + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": null, + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 301078, + "return_url": null, + "return_params": null, + "url": "https://general-goods.chargify.com/subscribe/ftgbpq7f5qpr/gold" + } + ], + "product_price_point_name": "Default" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read Product + +This endpoint allows you to read the current details of a product that you've created in Chargify. + +```go +ReadProduct( + ctx context.Context, productId int) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 @@ -169,56 +169,56 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 4535635, - "name": "Paid Annual Seats", - "handle": "paid-annual-seats", - "description": "Paid annual seats for our commercial enterprise product", - "accounting_code": "paid-annual-seats", - "request_credit_card": true, - "expiration_interval": 1, - "expiration_interval_unit": "day", - "created_at": "2017-08-25T10:25:31-05:00", - "updated_at": "2018-01-16T12:58:04-06:00", - "price_in_cents": 10000, - "interval": 12, - "interval_unit": "month", - "initial_charge_in_cents": 4900, - "trial_price_in_cents": 1000, - "trial_interval": 14, - "trial_interval_unit": "day", - "archived_at": null, - "require_credit_card": true, - "return_params": "id={subscription_id}&ref={customer_reference}", - "taxable": true, - "update_return_url": "http://www.example.com", - "tax_code": "D0000000", - "initial_charge_after_trial": false, - "version_number": 4, - "update_return_params": "id={subscription_id}&ref={customer_reference}", - "product_family": { - "id": 1025627, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [], - "product_price_point_name": "Default" - } -} -``` - - -# Update Product - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 4535635, + "name": "Paid Annual Seats", + "handle": "paid-annual-seats", + "description": "Paid annual seats for our commercial enterprise product", + "accounting_code": "paid-annual-seats", + "request_credit_card": true, + "expiration_interval": 1, + "expiration_interval_unit": "day", + "created_at": "2017-08-25T10:25:31-05:00", + "updated_at": "2018-01-16T12:58:04-06:00", + "price_in_cents": 10000, + "interval": 12, + "interval_unit": "month", + "initial_charge_in_cents": 4900, + "trial_price_in_cents": 1000, + "trial_interval": 14, + "trial_interval_unit": "day", + "archived_at": null, + "require_credit_card": true, + "return_params": "id={subscription_id}&ref={customer_reference}", + "taxable": true, + "update_return_url": "http://www.example.com", + "tax_code": "D0000000", + "initial_charge_after_trial": false, + "version_number": 4, + "update_return_params": "id={subscription_id}&ref={customer_reference}", + "product_family": { + "id": 1025627, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [], + "product_price_point_name": "Default" + } +} +``` + + +# Update Product + Use this method to change aspects of an existing product. ### Input Attributes Update Notes @@ -227,31 +227,31 @@ Use this method to change aspects of an existing product. ### Product Price Point -Updating a product using this endpoint will create a new price point and set it as the default price point for this product. If you should like to update an existing product price point, that must be done separately. - -```go -UpdateProduct( - ctx context.Context, - productId int, +Updating a product using this endpoint will create a new price point and set it as the default price point for this product. If you should like to update an existing product price point, that must be done separately. + +```go +UpdateProduct( + ctx context.Context, + productId int, body *models.CreateOrUpdateProductRequest) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product | -| `body` | [`*models.CreateOrUpdateProductRequest`](../../doc/models/create-or-update-product-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product | +| `body` | [`*models.CreateOrUpdateProductRequest`](../../doc/models/create-or-update-product-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 @@ -262,91 +262,91 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 4365034, - "name": "Platinum Plan", - "handle": "platinum", - "description": "This is our platinum plan.", - "accounting_code": "123", - "request_credit_card": true, - "created_at": "2016-11-04T16:34:29-04:00", - "updated_at": "2016-11-04T16:37:11-04:00", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": null, - "archived_at": null, - "require_credit_card": true, - "return_params": null, - "taxable": false, - "update_return_url": null, - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": null, - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 301079, - "return_url": null, - "return_params": null, - "url": "https://general-goods.chargify.com/subscribe/wgyd96tb5pj9/platinum" - } - ], - "product_price_point_name": "Original" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Archive Product - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 4365034, + "name": "Platinum Plan", + "handle": "platinum", + "description": "This is our platinum plan.", + "accounting_code": "123", + "request_credit_card": true, + "created_at": "2016-11-04T16:34:29-04:00", + "updated_at": "2016-11-04T16:37:11-04:00", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": null, + "archived_at": null, + "require_credit_card": true, + "return_params": null, + "taxable": false, + "update_return_url": null, + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": null, + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 301079, + "return_url": null, + "return_params": null, + "url": "https://general-goods.chargify.com/subscribe/wgyd96tb5pj9/platinum" + } + ], + "product_price_point_name": "Original" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Archive Product + Sending a DELETE request to this endpoint will archive the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. -This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. - -```go -ArchiveProduct( - ctx context.Context, +This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. + +```go +ArchiveProduct( + ctx context.Context, productId int) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The Chargify id of the product | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `productId` | `int` | Template, Required | The Chargify id of the product | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() productId := 202 @@ -357,85 +357,85 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 4535638, - "name": "Business Monthly", - "handle": null, - "description": "Business Monthly", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-08-25T10:25:31-05:00", - "updated_at": "2018-01-16T13:02:44-06:00", - "price_in_cents": 4900, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": 0, - "trial_interval": 1, - "trial_interval_unit": "day", - "archived_at": "2018-01-16T13:02:44-06:00", - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 1025627, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [], - "product_price_point_name": "Default" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Product by Handle - -This method allows to retrieve a Product object by its `api_handle`. - -```go -ReadProductByHandle( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 4535638, + "name": "Business Monthly", + "handle": null, + "description": "Business Monthly", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-08-25T10:25:31-05:00", + "updated_at": "2018-01-16T13:02:44-06:00", + "price_in_cents": 4900, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": 0, + "trial_interval": 1, + "trial_interval_unit": "day", + "archived_at": "2018-01-16T13:02:44-06:00", + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 1025627, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [], + "product_price_point_name": "Default" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read Product by Handle + +This method allows to retrieve a Product object by its `api_handle`. + +```go +ReadProductByHandle( + ctx context.Context, apiHandle string) ( models.ApiResponse[models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `apiHandle` | `string` | Template, Required | The handle of the product | - -## Response Type - -[`models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `apiHandle` | `string` | Template, Required | The handle of the product | + +## Response Type + +[`models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() apiHandle := "api_handle6" @@ -446,112 +446,112 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "product": { - "id": 3903594, - "name": "No cost product", - "handle": "no-cost-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2016-09-02T17:11:29-04:00", - "updated_at": "2016-11-30T11:46:13-05:00", - "price_in_cents": 0, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": 5, - "trial_interval": 1, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "reference=5678", - "taxable": false, - "update_return_url": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "reference=5678", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 281174, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/xgdxtk4vhtbz/no-cost-product" - }, - { - "id": 282270, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/xxqmrgtsbd9k/no-cost-product" - }, - { - "id": 291587, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/pvhwss7zjjnh/no-cost-product" - }, - { - "id": 294832, - "return_url": "http://www.example.com/", - "return_params": "engine=md7a", - "url": "https://general-goods.chargify.com/subscribe/m6tbcq4mcgpw/no-cost-product" - } - ], - "product_price_point_name": "Default" - } -} -``` - - -# List Products - -This method allows to retrieve a list of Products belonging to a Site. - -```go -ListProducts( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "product": { + "id": 3903594, + "name": "No cost product", + "handle": "no-cost-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2016-09-02T17:11:29-04:00", + "updated_at": "2016-11-30T11:46:13-05:00", + "price_in_cents": 0, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": 5, + "trial_interval": 1, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "reference=5678", + "taxable": false, + "update_return_url": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "reference=5678", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 281174, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/xgdxtk4vhtbz/no-cost-product" + }, + { + "id": 282270, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/xxqmrgtsbd9k/no-cost-product" + }, + { + "id": 291587, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/pvhwss7zjjnh/no-cost-product" + }, + { + "id": 294832, + "return_url": "http://www.example.com/", + "return_params": "engine=md7a", + "url": "https://general-goods.chargify.com/subscribe/m6tbcq4mcgpw/no-cost-product" + } + ], + "product_price_point_name": "Default" + } +} +``` + + +# List Products + +This method allows to retrieve a list of Products belonging to a Site. + +```go +ListProducts( ctx context.Context,input ListProductsInput) ( models.ApiResponse[[]models.ProductResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `dateField` | [`*models.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`. | -| `endDate` | `*time.Time` | 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. | -| `endDatetime` | `*time.Time` | 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. | -| `startDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `startDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | -| `page` | `*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`. | -| `perPage` | `*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`. | -| `includeArchived` | `*bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | -| `include` | [`*models.ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | -| `filterPrepaidProductPricePointProductPricePointId` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, 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`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | - -## Response Type - -[`[]models.ProductResponse`](../../doc/models/product-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `dateField` | [`*models.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`. | +| `endDate` | `*time.Time` | 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. | +| `endDatetime` | `*time.Time` | 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. | +| `startDate` | `*time.Time` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `startDatetime` | `*time.Time` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | +| `page` | `*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`. | +| `perPage` | `*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`. | +| `includeArchived` | `*bool` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | +| `include` | [`*models.ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | +| `filterPrepaidProductPricePointProductPricePointId` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, 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`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, 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`. | + +## Response Type + +[`[]models.ProductResponse`](../../doc/models/product-response.md) + +## Example Usage + +```go ctx := context.Background() dateField := models.BasicDateField("updated_at") page := 2 @@ -566,66 +566,66 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "product": { - "id": 0, - "name": "string", - "handle": "string", - "description": "string", - "accounting_code": "string", - "request_credit_card": true, - "expiration_interval": 0, - "expiration_interval_unit": "month", - "created_at": "2023-11-23T10:28:34-05:00", - "updated_at": "2023-11-23T10:28:34-05:00", - "price_in_cents": 0, - "interval": 0, - "interval_unit": "month", - "initial_charge_in_cents": 0, - "trial_price_in_cents": 0, - "trial_interval": 0, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": "string", - "taxable": true, - "update_return_url": "string", - "initial_charge_after_trial": true, - "version_number": 0, - "update_return_params": "string", - "product_family": { - "id": 0, - "name": "string", - "handle": "string", - "accounting_code": null, - "description": "string", - "created_at": "string", - "updated_at": "string" - }, - "public_signup_pages": [ - { - "id": 0, - "return_url": "string", - "return_params": "string", - "url": "string" - } - ], - "product_price_point_name": "string", - "request_billing_address": true, - "require_billing_address": true, - "require_shipping_address": true, - "use_site_exchange_rate": true, - "tax_code": "string", - "default_product_price_point_id": 0 - } - } -] -``` - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "product": { + "id": 0, + "name": "string", + "handle": "string", + "description": "string", + "accounting_code": "string", + "request_credit_card": true, + "expiration_interval": 0, + "expiration_interval_unit": "month", + "created_at": "2023-11-23T10:28:34-05:00", + "updated_at": "2023-11-23T10:28:34-05:00", + "price_in_cents": 0, + "interval": 0, + "interval_unit": "month", + "initial_charge_in_cents": 0, + "trial_price_in_cents": 0, + "trial_interval": 0, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": "string", + "taxable": true, + "update_return_url": "string", + "initial_charge_after_trial": true, + "version_number": 0, + "update_return_params": "string", + "product_family": { + "id": 0, + "name": "string", + "handle": "string", + "accounting_code": null, + "description": "string", + "created_at": "string", + "updated_at": "string" + }, + "public_signup_pages": [ + { + "id": 0, + "return_url": "string", + "return_params": "string", + "url": "string" + } + ], + "product_price_point_name": "string", + "request_billing_address": true, + "require_billing_address": true, + "require_shipping_address": true, + "use_site_exchange_rate": true, + "tax_code": "string", + "default_product_price_point_id": 0 + } + } +] +``` + diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 21a32f92..bc31d82e 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -1,15 +1,15 @@ -# Proforma Invoices - -```go -proformaInvoicesController := client.ProformaInvoicesController() -``` - -## Class Name - -`ProformaInvoicesController` - -## Methods - +# Proforma Invoices + +```go +proformaInvoicesController := client.ProformaInvoicesController() +``` + +## Class Name + +`ProformaInvoicesController` + +## Methods + * [Create Consolidated Proforma Invoice](../../doc/controllers/proforma-invoices.md#create-consolidated-proforma-invoice) * [List Subscription Group Proforma Invoices](../../doc/controllers/proforma-invoices.md#list-subscription-group-proforma-invoices) * [Read Proforma Invoice](../../doc/controllers/proforma-invoices.md#read-proforma-invoice) @@ -18,40 +18,40 @@ proformaInvoicesController := client.ProformaInvoicesController() * [Void Proforma Invoice](../../doc/controllers/proforma-invoices.md#void-proforma-invoice) * [Preview Proforma Invoice](../../doc/controllers/proforma-invoices.md#preview-proforma-invoice) * [Create Signup Proforma Invoice](../../doc/controllers/proforma-invoices.md#create-signup-proforma-invoice) -* [Preview Signup Proforma Invoice](../../doc/controllers/proforma-invoices.md#preview-signup-proforma-invoice) - - -# Create Consolidated Proforma Invoice - +* [Preview Signup Proforma Invoice](../../doc/controllers/proforma-invoices.md#preview-signup-proforma-invoice) + + +# Create Consolidated Proforma Invoice + This endpoint will trigger the creation of 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. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. ## Restrictions -Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be prepaid, and must be in a live state. - -```go -CreateConsolidatedProformaInvoice( - ctx context.Context, +Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be prepaid, and must be in a live state. + +```go +CreateConsolidatedProformaInvoice( + ctx context.Context, uid string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -60,43 +60,43 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Subscription Group Proforma Invoices - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Subscription Group Proforma Invoices + Only proforma invoices with a `consolidation_level` of parent are returned. -By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to true. - -```go -ListSubscriptionGroupProformaInvoices( - ctx context.Context, +By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to true. + +```go +ListSubscriptionGroupProformaInvoices( + ctx context.Context, uid string) ( models.ApiResponse[models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -107,45 +107,45 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Read Proforma Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Read Proforma Invoice + Use this endpoint to read the details of an existing proforma invoice. ## Restrictions -Proforma invoices are only available on Relationship Invoicing sites. - -```go -ReadProformaInvoice( - ctx context.Context, +Proforma invoices are only available on Relationship Invoicing sites. + +```go +ReadProformaInvoice( + ctx context.Context, proformaInvoiceUid int) ( models.ApiResponse[models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `proformaInvoiceUid` | `int` | Template, Required | The uid of the proforma invoice | - -## Response Type - -[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `proformaInvoiceUid` | `int` | Template, Required | The uid of the proforma invoice | + +## Response Type + +[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() proformaInvoiceUid := 242 @@ -156,47 +156,47 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Create Proforma Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Create Proforma Invoice + This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. If you would like to preview the next billing amounts without generating a full proforma invoice, please use the renewal preview endpoint. ## Restrictions -Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be in a group, must not be prepaid, and must be in a live state. - -```go -CreateProformaInvoice( - ctx context.Context, +Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be in a group, must not be prepaid, and must be in a live state. + +```go +CreateProformaInvoice( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -207,52 +207,52 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Proforma Invoices - -By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. - -```go -ListProformaInvoices( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Proforma Invoices + +By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. + +```go +ListProformaInvoices( ctx context.Context,input ListProformaInvoicesInput) ( models.ApiResponse[[]models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `startDate` | `*string` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | -| `endDate` | `*string` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | -| `status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | -| `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`. | -| `perPage` | `*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`. | -| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | -| `lineItems` | `*bool` | Query, Optional | Include line items data | -| `discounts` | `*bool` | Query, Optional | Include discounts data | -| `taxes` | `*bool` | Query, Optional | Include taxes data | -| `credits` | `*bool` | Query, Optional | Include credits data | -| `payments` | `*bool` | Query, Optional | Include payments data | -| `customFields` | `*bool` | Query, Optional | Include custom fields data | - -## Response Type - -[`[]models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `startDate` | `*string` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | +| `endDate` | `*string` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | +| `status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | +| `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`. | +| `perPage` | `*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`. | +| `direction` | [`*models.Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices. | +| `lineItems` | `*bool` | Query, Optional | Include line items data | +| `discounts` | `*bool` | Query, Optional | Include discounts data | +| `taxes` | `*bool` | Query, Optional | Include taxes data | +| `credits` | `*bool` | Query, Optional | Include credits data | +| `payments` | `*bool` | Query, Optional | Include payments data | +| `customFields` | `*bool` | Query, Optional | Include custom fields data | + +## Response Type + +[`[]models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 page := 2 @@ -272,12 +272,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Void Proforma Invoice - +} +``` + + +# Void Proforma Invoice + This endpoint will void a proforma invoice that has the status "draft". ## Restrictions @@ -286,31 +286,31 @@ Proforma invoices are only available on Relationship Invoicing sites. Only proforma invoices that have the appropriate status may be reopened. If the invoice identified by {uid} does not have the appropriate status, the response will have HTTP status code 422 and an error message. -A reason for the void operation is required to be included in the request body. If one is not provided, the response will have HTTP status code 422 and an error message. - -```go -VoidProformaInvoice( - ctx context.Context, - proformaInvoiceUid string, +A reason for the void operation is required to be included in the request body. If one is not provided, the response will have HTTP status code 422 and an error message. + +```go +VoidProformaInvoice( + ctx context.Context, + proformaInvoiceUid string, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `proformaInvoiceUid` | `string` | Template, Required | The uid of the proforma invoice | -| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `proformaInvoiceUid` | `string` | Template, Required | The uid of the proforma invoice | +| `body` | [`*models.VoidInvoiceRequest`](../../doc/models/void-invoice-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() proformaInvoiceUid := "proforma_invoice_uid4" @@ -321,48 +321,48 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Preview Proforma Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Preview Proforma Invoice + Return 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. 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. If all the data returned in the preview is as expected, you may then create a static proforma invoice and send it to your customer. The data within a preview will not be saved and will not be accessible after the call is made. -Alternatively, if you have some proforma invoices already, you may make a preview call to determine whether any billing information for the subscription's upcoming renewal has changed. - -```go -PreviewProformaInvoice( - ctx context.Context, +Alternatively, if you have some proforma invoices already, you may make a preview call to determine whether any billing information for the subscription's upcoming renewal has changed. + +```go +PreviewProformaInvoice( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.ProformaInvoicePreview], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.ProformaInvoicePreview`](../../doc/models/proforma-invoice-preview.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.ProformaInvoicePreview`](../../doc/models/proforma-invoice-preview.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -373,48 +373,48 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Create Signup Proforma Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Create Signup Proforma Invoice + This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. Create a proforma invoice to preview costs before a subscription's signup. Like other proforma invoices, it can be emailed to the customer, voided, and publicly viewed on the chargifypay domain. Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. -A product and customer first name, last name, and email are the minimum requirements. We recommend associating the proforma invoice with a customer_id to easily find their proforma invoices, since the subscription_id will always be blank. - -```go -CreateSignupProformaInvoice( - ctx context.Context, +A product and customer first name, last name, and email are the minimum requirements. We recommend associating the proforma invoice with a customer_id to easily find their proforma invoices, since the subscription_id will always be blank. + +```go +CreateSignupProformaInvoice( + ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.ProformaInvoice], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.ProformaInvoice`](../../doc/models/proforma-invoice.md) + +## Example Usage + +```go ctx := context.Background() bodySubscriptionCustomerAttributes := models.CustomerAttributes{ @@ -439,50 +439,50 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Bad Request | [`ProformaBadRequestErrorResponseException`](../../doc/models/proforma-bad-request-error-response-exception.md) | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - - -# Preview Signup Proforma Invoice - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`ProformaBadRequestErrorResponseException`](../../doc/models/proforma-bad-request-error-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Preview Signup Proforma Invoice + This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. Create a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. You have the option of optionally previewing the first renewal's costs as well. The proforma invoice preview will not be persisted. Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. -A product and customer first name, last name, and email are the minimum requirements. - -```go -PreviewSignupProformaInvoice( - ctx context.Context, - includeNextProformaInvoice *string, +A product and customer first name, last name, and email are the minimum requirements. + +```go +PreviewSignupProformaInvoice( + ctx context.Context, + includeNextProformaInvoice *string, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SignupProformaPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `includeNextProformaInvoice` | `*string` | Query, Optional | Choose to include a proforma invoice preview for the first renewal | -| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SignupProformaPreviewResponse`](../../doc/models/signup-proforma-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `includeNextProformaInvoice` | `*string` | Query, Optional | Choose to include a proforma invoice preview for the first renewal | +| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SignupProformaPreviewResponse`](../../doc/models/signup-proforma-preview-response.md) + +## Example Usage + +```go ctx := context.Background() bodySubscriptionCustomerAttributes := models.CustomerAttributes{ @@ -507,13 +507,13 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Bad Request | [`ProformaBadRequestErrorResponseException`](../../doc/models/proforma-bad-request-error-response-exception.md) | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`ProformaBadRequestErrorResponseException`](../../doc/models/proforma-bad-request-error-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index b2061909..167ebce0 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -1,24 +1,24 @@ -# Reason Codes - -```go -reasonCodesController := client.ReasonCodesController() -``` - -## Class Name - -`ReasonCodesController` - -## Methods - +# Reason Codes + +```go +reasonCodesController := client.ReasonCodesController() +``` + +## Class Name + +`ReasonCodesController` + +## Methods + * [Create Reason Code](../../doc/controllers/reason-codes.md#create-reason-code) * [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) * [Read Reason Code](../../doc/controllers/reason-codes.md#read-reason-code) * [Update Reason Code](../../doc/controllers/reason-codes.md#update-reason-code) -* [Delete Reason Code](../../doc/controllers/reason-codes.md#delete-reason-code) - - -# Create Reason Code - +* [Delete Reason Code](../../doc/controllers/reason-codes.md#delete-reason-code) + + +# Create Reason Code + # Reason Codes Intro ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription to your product or service. @@ -33,29 +33,29 @@ Full documentation on how Reason Codes operate within Chargify can be located un ## Create Reason Code -This method gives a merchant the option to create a reason codes for a given Site. - -```go -CreateReasonCode( - ctx context.Context, +This method gives a merchant the option to create a reason codes for a given Site. + +```go +CreateReasonCode( + ctx context.Context, body *models.CreateReasonCodeRequest) ( models.ApiResponse[models.ReasonCodeResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateReasonCodeRequest`](../../doc/models/create-reason-code-request.md) | Body, Optional | - | - -## Response Type - -[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateReasonCodeRequest`](../../doc/models/create-reason-code-request.md) | Body, Optional | - | + +## Response Type + +[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) + +## Example Usage + +```go ctx := context.Background() bodyReasonCode := models.CreateReasonCode{ @@ -75,41 +75,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Reason Codes - -This method gives a merchant the option to retrieve a list of all of the current churn codes for a given site. - -```go -ListReasonCodes( +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Reason Codes + +This method gives a merchant the option to retrieve a list of all of the current churn codes for a given site. + +```go +ListReasonCodes( ctx context.Context,input ListReasonCodesInput) ( models.ApiResponse[[]models.ReasonCodeResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`[]models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`[]models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -121,75 +121,75 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "reason_code": { - "id": 2, - "site_id": 2, - "code": "LARGE", - "description": "This is too complicated", - "position": 1, - "created_at": "2017-02-16T16:49:07-05:00", - "updated_at": "2017-02-17T16:29:51-05:00" - } - }, - { - "reason_code": { - "id": 1, - "site_id": 2, - "code": "CH1", - "description": "This doesnt meet my needs", - "position": 2, - "created_at": "2017-02-16T16:48:45-05:00", - "updated_at": "2017-02-17T16:29:59-05:00" - } - }, - { - "reason_code": { - "id": 5, - "site_id": 2, - "code": "HAN99", - "description": "Hard to setup", - "position": 3, - "created_at": "2017-02-17T16:29:42-05:00", - "updated_at": "2017-02-17T16:29:59-05:00" - } - } -] -``` - - -# Read Reason Code - -This method gives a merchant the option to retrieve a list of a particular code for a given Site by providing the unique numerical ID of the code. - -```go -ReadReasonCode( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "reason_code": { + "id": 2, + "site_id": 2, + "code": "LARGE", + "description": "This is too complicated", + "position": 1, + "created_at": "2017-02-16T16:49:07-05:00", + "updated_at": "2017-02-17T16:29:51-05:00" + } + }, + { + "reason_code": { + "id": 1, + "site_id": 2, + "code": "CH1", + "description": "This doesnt meet my needs", + "position": 2, + "created_at": "2017-02-16T16:48:45-05:00", + "updated_at": "2017-02-17T16:29:59-05:00" + } + }, + { + "reason_code": { + "id": 5, + "site_id": 2, + "code": "HAN99", + "description": "Hard to setup", + "position": 3, + "created_at": "2017-02-17T16:29:42-05:00", + "updated_at": "2017-02-17T16:29:59-05:00" + } + } +] +``` + + +# Read Reason Code + +This method gives a merchant the option to retrieve a list of a particular code for a given Site by providing the unique numerical ID of the code. + +```go +ReadReasonCode( + ctx context.Context, reasonCodeId int) ( models.ApiResponse[models.ReasonCodeResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | - -## Response Type - -[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | + +## Response Type + +[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) + +## Example Usage + +```go ctx := context.Background() reasonCodeId := 32 @@ -200,43 +200,43 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Update Reason Code - -This method gives a merchant the option to update an existing reason code for a given site. - -```go -UpdateReasonCode( - ctx context.Context, - reasonCodeId int, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Update Reason Code + +This method gives a merchant the option to update an existing reason code for a given site. + +```go +UpdateReasonCode( + ctx context.Context, + reasonCodeId int, body *models.UpdateReasonCodeRequest) ( models.ApiResponse[models.ReasonCodeResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | -| `body` | [`*models.UpdateReasonCodeRequest`](../../doc/models/update-reason-code-request.md) | Body, Optional | - | - -## Response Type - -[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | +| `body` | [`*models.UpdateReasonCodeRequest`](../../doc/models/update-reason-code-request.md) | Body, Optional | - | + +## Response Type + +[`models.ReasonCodeResponse`](../../doc/models/reason-code-response.md) + +## Example Usage + +```go ctx := context.Background() reasonCodeId := 32 @@ -247,41 +247,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Delete Reason Code - -This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. - -```go -DeleteReasonCode( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Delete Reason Code + +This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. + +```go +DeleteReasonCode( + ctx context.Context, reasonCodeId int) ( models.ApiResponse[models.ReasonCodesJsonResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | - -## Response Type - -[`models.ReasonCodesJsonResponse`](../../doc/models/reason-codes-json-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `reasonCodeId` | `int` | Template, Required | The Chargify id of the reason code | + +## Response Type + +[`models.ReasonCodesJsonResponse`](../../doc/models/reason-codes-json-response.md) + +## Example Usage + +```go ctx := context.Background() reasonCodeId := 32 @@ -292,20 +292,20 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "ok": "ok" -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "ok": "ok" +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index 8e13ced3..7d6ca51b 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -1,16 +1,16 @@ -# Referral Codes - -```go -referralCodesController := client.ReferralCodesController() -``` - -## Class Name - -`ReferralCodesController` - - -# Validate Referral Code - +# Referral Codes + +```go +referralCodesController := client.ReferralCodesController() +``` + +## Class Name + +`ReferralCodesController` + + +# Validate Referral Code + Use this method to determine if the 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 @@ -19,29 +19,29 @@ Full documentation on how to use the referrals feature in the Chargify UI can be ## 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. - -```go -ValidateReferralCode( - ctx context.Context, +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. + +```go +ValidateReferralCode( + ctx context.Context, code string) ( models.ApiResponse[models.ReferralValidationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `code` | `string` | Query, Required | The referral code you are trying to validate | - -## Response Type - -[`models.ReferralValidationResponse`](../../doc/models/referral-validation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `code` | `string` | Query, Required | The referral code you are trying to validate | + +## Response Type + +[`models.ReferralValidationResponse`](../../doc/models/referral-validation-response.md) + +## Example Usage + +```go ctx := context.Background() code := "code8" @@ -52,25 +52,25 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "referral_code": { - "id": 1032514, - "site_id": 31615, - "subscription_id": 16254270, - "code": "9b6cdw" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "referral_code": { + "id": 1032514, + "site_id": 31615, + "subscription_id": 16254270, + "code": "9b6cdw" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | + diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 9193227a..213c2767 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -1,22 +1,22 @@ -# Sales Commissions - -```go -salesCommissionsController := client.SalesCommissionsController() -``` - -## Class Name - -`SalesCommissionsController` - -## Methods - +# Sales Commissions + +```go +salesCommissionsController := client.SalesCommissionsController() +``` + +## Class Name + +`SalesCommissionsController` + +## Methods + * [List Sales Commission Settings](../../doc/controllers/sales-commissions.md#list-sales-commission-settings) * [List Sales Reps](../../doc/controllers/sales-commissions.md#list-sales-reps) -* [Read Sales Rep](../../doc/controllers/sales-commissions.md#read-sales-rep) - - -# List Sales Commission Settings - +* [Read Sales Rep](../../doc/controllers/sales-commissions.md#read-sales-rep) + + +# List Sales Commission Settings + Endpoint returns subscriptions with associated sales reps ## Modified Authentication Process @@ -25,32 +25,32 @@ 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 please contact Chargify support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` - -```go -ListSalesCommissionSettings( +> Note: The request is at seller level, it means `<>` variable will be replaced by `app` + +```go +ListSalesCommissionSettings( ctx context.Context,input ListSalesCommissionSettingsInput) ( models.ApiResponse[[]models.SaleRepSettings], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | -| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | -| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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`. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | - -## Response Type - -[`[]models.SaleRepSettings`](../../doc/models/sale-rep-settings.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | +| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | +| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | +| `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`. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | + +## Response Type + +[`[]models.SaleRepSettings`](../../doc/models/sale-rep-settings.md) + +## Example Usage + +```go ctx := context.Background() sellerId := "seller_id8" authorization := "Bearer <>" @@ -64,46 +64,46 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "customer_name": "Ziomek Ziomeczek", - "subscription_id": 81746, - "site_link": "https://chargify9.staging-chargify.com/dashboard", - "site_name": "Chargify", - "subscription_mrr": "$200.00", - "sales_rep_id": 48, - "sales_rep_name": "John Candy" - }, - { - "customer_name": "Ziom Kom", - "subscription_id": 83758, - "site_link": "https://chargify9.staging-chargify.com/dashboard", - "site_name": "Chargify", - "subscription_mrr": "$200.00", - "sales_rep_id": 49, - "sales_rep_name": "Josh Acme" - }, - { - "customer_name": "George Bush", - "subscription_id": 83790, - "site_link": "https://chargify9.staging-chargify.com/dashboard", - "site_name": "Chargify", - "subscription_mrr": "$200.00", - "sales_rep_id": 48, - "sales_rep_name": "John Candy" - } -] -``` - - -# List Sales Reps - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "customer_name": "Ziomek Ziomeczek", + "subscription_id": 81746, + "site_link": "https://chargify9.staging-chargify.com/dashboard", + "site_name": "Chargify", + "subscription_mrr": "$200.00", + "sales_rep_id": 48, + "sales_rep_name": "John Candy" + }, + { + "customer_name": "Ziom Kom", + "subscription_id": 83758, + "site_link": "https://chargify9.staging-chargify.com/dashboard", + "site_name": "Chargify", + "subscription_mrr": "$200.00", + "sales_rep_id": 49, + "sales_rep_name": "Josh Acme" + }, + { + "customer_name": "George Bush", + "subscription_id": 83790, + "site_link": "https://chargify9.staging-chargify.com/dashboard", + "site_name": "Chargify", + "subscription_mrr": "$200.00", + "sales_rep_id": 48, + "sales_rep_name": "John Candy" + } +] +``` + + +# List Sales Reps + Endpoint returns sales rep list with details ## Modified Authentication Process @@ -112,32 +112,32 @@ 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 please contact Chargify support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` - -```go -ListSalesReps( +> Note: The request is at seller level, it means `<>` variable will be replaced by `app` + +```go +ListSalesReps( ctx context.Context,input ListSalesRepsInput) ( models.ApiResponse[[]models.ListSaleRepItem], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | -| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | -| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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`. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | - -## Response Type - -[`[]models.ListSaleRepItem`](../../doc/models/list-sale-rep-item.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | +| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | +| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | +| `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`. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | + +## Response Type + +[`[]models.ListSaleRepItem`](../../doc/models/list-sale-rep-item.md) + +## Example Usage + +```go ctx := context.Background() sellerId := "seller_id8" authorization := "Bearer <>" @@ -151,95 +151,95 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "id": 48, - "full_name": "John Candy", - "subscriptions_count": 2, - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - }, - "february_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - }, - "march_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - }, - "april_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - } - }, - "test_mode": true - }, - { - "id": 49, - "full_name": "Josh Acme", - "subscriptions_count": 1, - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00" - }, - "february_2020": { - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00" - }, - "march_2020": { - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00" - }, - "april_2020": { - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00" - } - }, - "test_mode": true - } -] -``` - - -# Read Sales Rep - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "id": 48, + "full_name": "John Candy", + "subscriptions_count": 2, + "mrr_data": { + "november_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "december_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "january_2020": { + "mrr": "$400.00", + "usage": "$0.00", + "recurring": "$400.00" + }, + "february_2020": { + "mrr": "$400.00", + "usage": "$0.00", + "recurring": "$400.00" + }, + "march_2020": { + "mrr": "$400.00", + "usage": "$0.00", + "recurring": "$400.00" + }, + "april_2020": { + "mrr": "$400.00", + "usage": "$0.00", + "recurring": "$400.00" + } + }, + "test_mode": true + }, + { + "id": 49, + "full_name": "Josh Acme", + "subscriptions_count": 1, + "mrr_data": { + "november_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "december_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "january_2020": { + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00" + }, + "february_2020": { + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00" + }, + "march_2020": { + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00" + }, + "april_2020": { + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00" + } + }, + "test_mode": true + } +] +``` + + +# Read Sales Rep + Endpoint returns sales rep and attached subscriptions details. ## Modified Authentication Process @@ -248,39 +248,39 @@ 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 please contact Chargify support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` - -```go -ReadSalesRep( - ctx context.Context, - sellerId string, - salesRepId string, - authorization *string, - liveMode *bool, - page *int, +> Note: The request is at seller level, it means `<>` variable will be replaced by `app` + +```go +ReadSalesRep( + ctx context.Context, + sellerId string, + salesRepId string, + authorization *string, + liveMode *bool, + page *int, perPage *int) ( models.ApiResponse[models.SaleRep], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | -| `salesRepId` | `string` | Template, Required | The Chargify id of sales rep. | -| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | -| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `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`. | -| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | - -## Response Type - -[`models.SaleRep`](../../doc/models/sale-rep.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `sellerId` | `string` | Template, Required | The Chargify id of your seller account | +| `salesRepId` | `string` | Template, Required | The Chargify id of sales rep. | +| `authorization` | `*string` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). | +| `liveMode` | `*bool` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | +| `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`. | +| `perPage` | `*int` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. | + +## Response Type + +[`models.SaleRep`](../../doc/models/sale-rep.md) + +## Example Usage + +```go ctx := context.Background() sellerId := "seller_id8" salesRepId := "sales_rep_id4" @@ -295,43 +295,43 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "id": 48, - "full_name": "John Candy", - "subscriptions_count": 2, - "test_mode": true, - "subscriptions": [ - { - "id": 81746, - "site_name": "Chargify", - "subscription_url": "https://chargify9.staging-chargify.com/subscriptions/81746", - "customer_name": "Ziomek Ziomeczek", - "created_at": "2020-01-03T02:36:27-05:00", - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00", - "last_payment": "2020-04-03T03:40:27-04:00", - "churn_date": null - }, - { - "id": 83790, - "site_name": "Chargify", - "subscription_url": "https://chargify9.staging-chargify.com/subscriptions/83790", - "customer_name": "George Bush", - "created_at": "2020-01-17T07:34:32-05:00", - "mrr": "$200.00", - "usage": "$0.00", - "recurring": "$200.00", - "last_payment": "2020-04-17T08:41:03-04:00", - "churn_date": null - } - ] -} -``` - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "id": 48, + "full_name": "John Candy", + "subscriptions_count": 2, + "test_mode": true, + "subscriptions": [ + { + "id": 81746, + "site_name": "Chargify", + "subscription_url": "https://chargify9.staging-chargify.com/subscriptions/81746", + "customer_name": "Ziomek Ziomeczek", + "created_at": "2020-01-03T02:36:27-05:00", + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00", + "last_payment": "2020-04-03T03:40:27-04:00", + "churn_date": null + }, + { + "id": 83790, + "site_name": "Chargify", + "subscription_url": "https://chargify9.staging-chargify.com/subscriptions/83790", + "customer_name": "George Bush", + "created_at": "2020-01-17T07:34:32-05:00", + "mrr": "$200.00", + "usage": "$0.00", + "recurring": "$200.00", + "last_payment": "2020-04-17T08:41:03-04:00", + "churn_date": null + } + ] +} +``` + diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 8c13e64c..3c0db4cf 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -1,22 +1,22 @@ -# Sites - -```go -sitesController := client.SitesController() -``` - -## Class Name - -`SitesController` - -## Methods - +# Sites + +```go +sitesController := client.SitesController() +``` + +## Class Name + +`SitesController` + +## Methods + * [Read Site](../../doc/controllers/sites.md#read-site) * [Clear Site](../../doc/controllers/sites.md#clear-site) -* [List Chargify Js Public Keys](../../doc/controllers/sites.md#list-chargify-js-public-keys) - - -# Read Site - +* [List Chargify Js Public Keys](../../doc/controllers/sites.md#list-chargify-js-public-keys) + + +# Read Site + This endpoint allows you to fetch some site data. Full documentation on Sites in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407870738587). @@ -32,22 +32,22 @@ If 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://chargify.zendesk.com/hc/en-us/articles/4407746683291) - -```go -ReadSite( +[Who Pays & Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) + +```go +ReadSite( ctx context.Context) ( models.ApiResponse[models.SiteResponse], - error) -``` - -## Response Type - -[`models.SiteResponse`](../../doc/models/site-response.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`models.SiteResponse`](../../doc/models/site-response.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := sitesController.ReadSite(ctx) if err != nil { @@ -56,87 +56,87 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "site": { - "id": 0, - "name": "string", - "subdomain": "string", - "currency": "string", - "seller_id": 0, - "non_primary_currencies": [ - "string" - ], - "relationship_invoicing_enabled": true, - "customer_hierarchy_enabled": true, - "whopays_enabled": true, - "whopays_default_payer": "string", - "default_payment_collection_method": "string", - "organization_address": { - "street": null, - "line2": null, - "city": null, - "state": null, - "zip": null, - "country": null, - "name": "string", - "phone": "string" - }, - "tax_configuration": { - "kind": "custom", - "fully_configured": true, - "destination_address": "shipping_then_billing" - }, - "net_terms": { - "default_net_terms": 0, - "automatic_net_terms": 0, - "remittance_net_terms": 0, - "net_terms_on_remittance_signups_enabled": false, - "custom_net_terms_enabled": false - }, - "test": true, - "allocation_settings": { - "upgrade_charge": "prorated", - "downgrade_credit": "none", - "accrue_charge": "true" - } - } -} -``` - - -# Clear Site - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "site": { + "id": 0, + "name": "string", + "subdomain": "string", + "currency": "string", + "seller_id": 0, + "non_primary_currencies": [ + "string" + ], + "relationship_invoicing_enabled": true, + "customer_hierarchy_enabled": true, + "whopays_enabled": true, + "whopays_default_payer": "string", + "default_payment_collection_method": "string", + "organization_address": { + "street": null, + "line2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "name": "string", + "phone": "string" + }, + "tax_configuration": { + "kind": "custom", + "fully_configured": true, + "destination_address": "shipping_then_billing" + }, + "net_terms": { + "default_net_terms": 0, + "automatic_net_terms": 0, + "remittance_net_terms": 0, + "net_terms_on_remittance_signups_enabled": false, + "custom_net_terms_enabled": false + }, + "test": true, + "allocation_settings": { + "upgrade_charge": "prorated", + "downgrade_credit": "none", + "accrue_charge": "true" + } + } +} +``` + + +# Clear Site + This call is asynchronous and there may be a delay before the site data is fully deleted. If you are clearing site data for an automated test, you will need to build in a delay and/or check that there are no products, etc., in the site before proceeding. -**This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** - -```go -ClearSite( - ctx context.Context, +**This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** + +```go +ClearSite( + ctx context.Context, cleanupScope *models.CleanupScope) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `cleanupScope` | [`*models.CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`. | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cleanupScope` | [`*models.CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`. | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() cleanupScope := models.CleanupScope("all") @@ -145,35 +145,35 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# List Chargify Js Public Keys - -This endpoint returns public keys used for Chargify.js. - -```go -ListChargifyJsPublicKeys( +} +``` + + +# List Chargify Js Public Keys + +This endpoint returns public keys used for Chargify.js. + +```go +ListChargifyJsPublicKeys( ctx context.Context,input ListChargifyJsPublicKeysInput) ( models.ApiResponse[models.ListPublicKeysResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`models.ListPublicKeysResponse`](../../doc/models/list-public-keys-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`models.ListPublicKeysResponse`](../../doc/models/list-public-keys-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -185,26 +185,26 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "chargify_js_keys": [ - { - "public_key": "chjs_ftrxt7c4fv6f74wchjs_5zyn7gnwv", - "requires_security_token": false, - "created_at": "2021-01-01T05:00:00-04:00" - } - ], - "meta": { - "total_count": 1, - "current_page": 1, - "total_pages": 1, - "per_page": 10 - } -} -``` - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "chargify_js_keys": [ + { + "public_key": "chjs_ftrxt7c4fv6f74wchjs_5zyn7gnwv", + "requires_security_token": false, + "created_at": "2021-01-01T05:00:00-04:00" + } + ], + "meta": { + "total_count": 1, + "current_page": 1, + "total_pages": 1, + "per_page": 10 + } +} +``` + diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 406ba273..b251779c 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -1,61 +1,61 @@ -# Subscription Components - -```go -subscriptionComponentsController := client.SubscriptionComponentsController() -``` - -## Class Name - -`SubscriptionComponentsController` - -## Methods - +# Subscription Components + +```go +subscriptionComponentsController := client.SubscriptionComponentsController() +``` + +## Class Name + +`SubscriptionComponentsController` + +## Methods + * [Read Subscription Component](../../doc/controllers/subscription-components.md#read-subscription-component) * [List Subscription Components](../../doc/controllers/subscription-components.md#list-subscription-components) -* [Update Subscription Components Price Points](../../doc/controllers/subscription-components.md#update-subscription-components-price-points) -* [Reset Subscription Components Price Points](../../doc/controllers/subscription-components.md#reset-subscription-components-price-points) +* [Bulk Update Subscription Components Price Points](../../doc/controllers/subscription-components.md#bulk-update-subscription-components-price-points) +* [Bulk Reset Subscription Components Price Points](../../doc/controllers/subscription-components.md#bulk-reset-subscription-components-price-points) * [Allocate Component](../../doc/controllers/subscription-components.md#allocate-component) * [List Allocations](../../doc/controllers/subscription-components.md#list-allocations) * [Allocate Components](../../doc/controllers/subscription-components.md#allocate-components) * [Preview Allocations](../../doc/controllers/subscription-components.md#preview-allocations) -* [Update Prepaid Usage Allocation](../../doc/controllers/subscription-components.md#update-prepaid-usage-allocation) +* [Update Prepaid Usage Allocation Expiration Date](../../doc/controllers/subscription-components.md#update-prepaid-usage-allocation-expiration-date) * [Delete Prepaid Usage Allocation](../../doc/controllers/subscription-components.md#delete-prepaid-usage-allocation) * [Create Usage](../../doc/controllers/subscription-components.md#create-usage) * [List Usages](../../doc/controllers/subscription-components.md#list-usages) * [Activate Event Based Component](../../doc/controllers/subscription-components.md#activate-event-based-component) * [Deactivate Event Based Component](../../doc/controllers/subscription-components.md#deactivate-event-based-component) * [Record Event](../../doc/controllers/subscription-components.md#record-event) -* [Record Events](../../doc/controllers/subscription-components.md#record-events) -* [List Subscription Components for Site](../../doc/controllers/subscription-components.md#list-subscription-components-for-site) - - -# Read Subscription Component - -This request will list information regarding a specific component owned by a subscription. - -```go -ReadSubscriptionComponent( - ctx context.Context, - subscriptionId int, +* [Bulk Record Events](../../doc/controllers/subscription-components.md#bulk-record-events) +* [List Subscription Components for Site](../../doc/controllers/subscription-components.md#list-subscription-components-for-site) + + +# Read Subscription Component + +This request will list information regarding a specific component owned by a subscription. + +```go +ReadSubscriptionComponent( + ctx context.Context, + subscriptionId int, componentId int) ( models.ApiResponse[models.SubscriptionComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component. Alternatively, the component's handle prefixed by `handle:` | - -## Response Type - -[`models.SubscriptionComponentResponse`](../../doc/models/subscription-component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component. Alternatively, the component's handle prefixed by `handle:` | + +## Response Type + +[`models.SubscriptionComponentResponse`](../../doc/models/subscription-component-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -67,75 +67,75 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "component": { - "component_id": 193028, - "subscription_id": 14593192, - "allocated_quantity": 1, - "pricing_scheme": "per_unit", - "name": "Users", - "kind": "quantity_based_component", - "unit_name": "Users", - "price_point_id": 1, - "price_point_handle": "top-tier", - "enabled": true - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# List Subscription Components - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "component": { + "component_id": 193028, + "subscription_id": 14593192, + "allocated_quantity": 1, + "pricing_scheme": "per_unit", + "name": "Users", + "kind": "quantity_based_component", + "unit_name": "Users", + "price_point_id": 1, + "price_point_handle": "top-tier", + "enabled": true + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# List Subscription Components + This request will list a subscription's applied components. ## Archived Components -When requesting to list components for a given subscription, if the subscription contains **archived** components they will be listed in the server response. - -```go -ListSubscriptionComponents( +When requesting to list components for a given subscription, if the subscription contains **archived** components they will be listed in the server response. + +```go +ListSubscriptionComponents( ctx context.Context,input ListSubscriptionComponentsInput) ( models.ApiResponse[[]models.SubscriptionComponentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `dateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query `date_field=updated_at`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. | -| `pricePointIds` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | -| `productFamilyIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | -| `sort` | [`*models.ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query `sort=updated_at`. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | -| `include` | [`*models.ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | -| `filterCurrencies` | `[]string` | Query, Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`. | - -## Response Type - -[`[]models.SubscriptionComponentResponse`](../../doc/models/subscription-component-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `dateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query `date_field=updated_at`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. | +| `pricePointIds` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | +| `productFamilyIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | +| `sort` | [`*models.ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query `sort=updated_at`. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | +| `include` | [`*models.ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | +| `filterCurrencies` | `[]string` | Query, Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`. | + +## Response Type + +[`[]models.SubscriptionComponentResponse`](../../doc/models/subscription-component-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 dateField := models.SubscriptionListDateField("updated_at") @@ -151,72 +151,72 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "component": { - "component_id": 0, - "subscription_id": 0, - "allocated_quantity": 0, - "pricing_scheme": "per_unit", - "name": "string", - "kind": "quantity_based_component", - "unit_name": "string", - "price_point_id": 0, - "price_point_handle": "string", - "price_point_type": "default", - "price_point_name": "string", - "enabled": true, - "unit_balance": 0, - "id": 0, - "created_at": "2022-02-22T14:07:00-05:00", - "updated_at": "2022-02-22T14:07:00-05:00", - "component_handle": "string", - "archived_at": "string" - } - } -] -``` - - -# Update Subscription Components Price Points - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "component": { + "component_id": 0, + "subscription_id": 0, + "allocated_quantity": 0, + "pricing_scheme": "per_unit", + "name": "string", + "kind": "quantity_based_component", + "unit_name": "string", + "price_point_id": 0, + "price_point_handle": "string", + "price_point_type": "default", + "price_point_name": "string", + "enabled": true, + "unit_balance": 0, + "id": 0, + "created_at": "2022-02-22T14:07:00-05:00", + "updated_at": "2022-02-22T14:07:00-05:00", + "component_handle": "string", + "archived_at": "string" + } + } +] +``` + + +# Bulk Update Subscription Components Price Points + Updates the price points on one or more of a subscription's components. The `price_point` key can take either a: 1. Price point id (integer) 2. Price point handle (string) -3. `"_default"` string, which will reset the price point to the component's current default price point. - -```go -UpdateSubscriptionComponentsPricePoints( - ctx context.Context, - subscriptionId int, +3. `"_default"` string, which will reset the price point to the component's current default price point. + +```go +BulkUpdateSubscriptionComponentsPricePoints( + ctx context.Context, + subscriptionId int, body *models.BulkComponentSPricePointAssignment) ( models.ApiResponse[models.BulkComponentSPricePointAssignment], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.BulkComponentSPricePointAssignment`](../../doc/models/bulk-component-s-price-point-assignment.md) | Body, Optional | - | - -## Response Type - -[`models.BulkComponentSPricePointAssignment`](../../doc/models/bulk-component-s-price-point-assignment.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.BulkComponentSPricePointAssignment`](../../doc/models/bulk-component-s-price-point-assignment.md) | Body, Optional | - | + +## Response Type + +[`models.BulkComponentSPricePointAssignment`](../../doc/models/bulk-component-s-price-point-assignment.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -240,184 +240,184 @@ body := models.BulkComponentSPricePointAssignment{ Components: bodyComponents, } -apiResponse, err := subscriptionComponentsController.UpdateSubscriptionComponentsPricePoints(ctx, subscriptionId, &body) +apiResponse, err := subscriptionComponentsController.BulkUpdateSubscriptionComponentsPricePoints(ctx, subscriptionId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "components": [ - { - "component_id": 123, - "price_point": 456 - }, - { - "component_id": 789, - "price_point": 987 - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ComponentPricePointErrorException`](../../doc/models/component-price-point-error-exception.md) | - - -# Reset Subscription Components Price Points - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "components": [ + { + "component_id": 123, + "price_point": 456 + }, + { + "component_id": 789, + "price_point": 987 + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ComponentPricePointErrorException`](../../doc/models/component-price-point-error-exception.md) | + + +# Bulk Reset Subscription Components Price Points + Resets all of a subscription's components to use the current default. -**Note**: this will update the price point for all of the subscription's components, even ones that have not been allocated yet. - -```go -ResetSubscriptionComponentsPricePoints( - ctx context.Context, +**Note**: this will update the price point for all of the subscription's components, even ones that have not been allocated yet. + +```go +BulkResetSubscriptionComponentsPricePoints( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 -apiResponse, err := subscriptionComponentsController.ResetSubscriptionComponentsPricePoints(ctx, subscriptionId) +apiResponse, err := subscriptionComponentsController.BulkResetSubscriptionComponentsPricePoints(ctx, subscriptionId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": -80293620, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2023-11-23T10:28:34-05:00", - "created_at": "2023-11-23T10:28:34-05:00", - "updated_at": "2023-11-23T10:28:34-05:00", - "expires_at": null, - "balance_in_cents": 50504234, - "current_period_ends_at": "2023-11-23T10:28:34-05:00", - "next_assessment_at": "2023-11-23T10:28:34-05:00", - "canceled_at": null, - "cancellation_message": "lorem ipsum", - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "remittance", - "snap_day": null, - "cancellation_method": "dunning", - "current_period_started_at": "2023-11-23T10:28:34-05:00", - "previous_state": "active", - "signup_payment_id": -45156092, - "signup_revenue": "do aliquip ea", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": -49740952, - "product_price_in_cents": 87617888, - "product_version_number": 13656635, - "payment_type": null, - "referral_code": null, - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "current_billing_amount_in_cents": -26151968, - "customer": { - "id": 15208337, - "first_name": "ipsum culpa in labore eiusmod", - "last_name": "esse", - "organization": null, - "email": "ex eiusmod", - "created_at": "ad occaecat cillum", - "updated_at": "ut aute proident est", - "reference": "laboris ea cupidatat", - "address": null, - "address_2": null, - "city": "id eiusmod proident", - "state": "magna eiusmod anim non", - "zip": null, - "country": null, - "phone": null, - "portal_invite_last_sent_at": null, - "portal_invite_last_accepted_at": "reprehenderit labore voluptate", - "portal_customer_created_at": "nisi aute reprehenderit Excepteur Duis", - "cc_emails": "eiusmod sunt", - "tax_exempt": true - }, - "product": { - "id": -74447756, - "name": "eu mollit nulla ut aute", - "handle": "esse dolor anim", - "description": "Lorem ut et non", - "accounting_code": "nisi", - "request_credit_card": false, - "expiration_interval": 1, - "expiration_interval_unit": "day", - "created_at": "2022-11-23T10:28:34-05:00", - "updated_at": "2022-11-23T10:28:34-05:00", - "price_in_cents": -4151649, - "interval": 20680876, - "interval_unit": "day", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "day", - "archived_at": null, - "require_credit_card": true, - "return_params": "magna eu", - "taxable": true, - "update_return_url": "exercitation in", - "tax_code": "Excepteur aliqua sunt in", - "initial_charge_after_trial": true, - "version_number": 41642597, - "update_return_params": "dolore labore", - "product_family": { - "id": -5356997, - "name": "officia amet Lorem proident enim", - "description": "Duis", - "handle": "ea dolore dolore sunt", - "accounting_code": null - }, - "public_signup_pages": [] - } - } -} -``` - - -# Allocate Component - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": -80293620, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2023-11-23T10:28:34-05:00", + "created_at": "2023-11-23T10:28:34-05:00", + "updated_at": "2023-11-23T10:28:34-05:00", + "expires_at": null, + "balance_in_cents": 50504234, + "current_period_ends_at": "2023-11-23T10:28:34-05:00", + "next_assessment_at": "2023-11-23T10:28:34-05:00", + "canceled_at": null, + "cancellation_message": "lorem ipsum", + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "remittance", + "snap_day": null, + "cancellation_method": "dunning", + "current_period_started_at": "2023-11-23T10:28:34-05:00", + "previous_state": "active", + "signup_payment_id": -45156092, + "signup_revenue": "do aliquip ea", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": -49740952, + "product_price_in_cents": 87617888, + "product_version_number": 13656635, + "payment_type": null, + "referral_code": null, + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "current_billing_amount_in_cents": -26151968, + "customer": { + "id": 15208337, + "first_name": "ipsum culpa in labore eiusmod", + "last_name": "esse", + "organization": null, + "email": "ex eiusmod", + "created_at": "ad occaecat cillum", + "updated_at": "ut aute proident est", + "reference": "laboris ea cupidatat", + "address": null, + "address_2": null, + "city": "id eiusmod proident", + "state": "magna eiusmod anim non", + "zip": null, + "country": null, + "phone": null, + "portal_invite_last_sent_at": null, + "portal_invite_last_accepted_at": "reprehenderit labore voluptate", + "portal_customer_created_at": "nisi aute reprehenderit Excepteur Duis", + "cc_emails": "eiusmod sunt", + "tax_exempt": true + }, + "product": { + "id": -74447756, + "name": "eu mollit nulla ut aute", + "handle": "esse dolor anim", + "description": "Lorem ut et non", + "accounting_code": "nisi", + "request_credit_card": false, + "expiration_interval": 1, + "expiration_interval_unit": "day", + "created_at": "2022-11-23T10:28:34-05:00", + "updated_at": "2022-11-23T10:28:34-05:00", + "price_in_cents": -4151649, + "interval": 20680876, + "interval_unit": "day", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "day", + "archived_at": null, + "require_credit_card": true, + "return_params": "magna eu", + "taxable": true, + "update_return_url": "exercitation in", + "tax_code": "Excepteur aliqua sunt in", + "initial_charge_after_trial": true, + "version_number": 41642597, + "update_return_params": "dolore labore", + "product_family": { + "id": -5356997, + "name": "officia amet Lorem proident enim", + "description": "Duis", + "handle": "ea dolore dolore sunt", + "accounting_code": null + }, + "public_signup_pages": [] + } + } +} +``` + + +# Allocate Component + This endpoint creates a new allocation, setting the current allocated quantity for the Component and recording a memo. **Notice**: Allocations can only be updated for Quantity, On/Off, and Prepaid Components. @@ -466,33 +466,33 @@ See the tables below for valid values. 1. Allocation API call top level (outside of the `allocations` array) 2. [Site-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-schemes) -**NOTE: Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong.** - -```go -AllocateComponent( - ctx context.Context, - subscriptionId int, - componentId int, +**NOTE: Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong.** + +```go +AllocateComponent( + ctx context.Context, + subscriptionId int, + componentId int, body *models.CreateAllocationRequest) ( models.ApiResponse[models.AllocationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `body` | [`*models.CreateAllocationRequest`](../../doc/models/create-allocation-request.md) | Body, Optional | - | - -## Response Type - -[`models.AllocationResponse`](../../doc/models/allocation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `body` | [`*models.CreateAllocationRequest`](../../doc/models/create-allocation-request.md) | Body, Optional | - | + +## Response Type + +[`models.AllocationResponse`](../../doc/models/allocation-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -513,46 +513,46 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "allocation": { - "component_id": 4034995, - "subscription_id": 23737320, - "quantity": 3, - "previous_quantity": 2, - "memo": "dolore cupidatat elit", - "timestamp": "2022-11-23T10:28:34-05:00", - "proration_upgrade_scheme": "laboris ipsum dolore", - "proration_downgrade_scheme": "eiusmod dolore", - "price_point_id": -69720370, - "previous_price_point_id": -76493052, - "accrue_charge": true, - "upgrade_charge": "full", - "downgrade_credit": "full", - "payment": { - "id": -44566528, - "amount_in_cents": 123, - "success": false, - "memo": "aliqua" - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Allocations - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "allocation": { + "component_id": 4034995, + "subscription_id": 23737320, + "quantity": 3, + "previous_quantity": 2, + "memo": "dolore cupidatat elit", + "timestamp": "2022-11-23T10:28:34-05:00", + "proration_upgrade_scheme": "laboris ipsum dolore", + "proration_downgrade_scheme": "eiusmod dolore", + "price_point_id": -69720370, + "previous_price_point_id": -76493052, + "accrue_charge": true, + "upgrade_charge": "full", + "downgrade_credit": "full", + "payment": { + "id": -44566528, + "amount_in_cents": 123, + "success": false, + "memo": "aliqua" + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Allocations + This endpoint returns the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -572,33 +572,33 @@ puts component.allocated_quantity component = Chargify::Subscription.find(7).component(1) puts component.allocated_quantity # => 23 -``` - -```go -ListAllocations( - ctx context.Context, - subscriptionId int, - componentId int, +``` + +```go +ListAllocations( + ctx context.Context, + subscriptionId int, + componentId int, page *int) ( models.ApiResponse[[]models.AllocationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `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`. | - -## Response Type - -[`[]models.AllocationResponse`](../../doc/models/allocation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `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`. | + +## Response Type + +[`[]models.AllocationResponse`](../../doc/models/allocation-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -611,79 +611,79 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "allocation": { - "memo": "moving to 7", - "timestamp": "2012-11-20T22:00:37Z", - "quantity": 7, - "previous_quantity": 3, - "component_id": 11960, - "subscription_id": 2585595, - "proration_upgrade_scheme": "no-prorate", - "proration_downgrade_scheme": "no-prorate" - } - }, - { - "allocation": { - "memo": null, - "timestamp": "2012-11-20T21:48:09Z", - "quantity": 3, - "previous_quantity": 0, - "component_id": 11960, - "subscription_id": 2585595, - "proration_upgrade_scheme": "no-prorate", - "proration_downgrade_scheme": "no-prorate" - } - } -] -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Allocate Components - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "allocation": { + "memo": "moving to 7", + "timestamp": "2012-11-20T22:00:37Z", + "quantity": 7, + "previous_quantity": 3, + "component_id": 11960, + "subscription_id": 2585595, + "proration_upgrade_scheme": "no-prorate", + "proration_downgrade_scheme": "no-prorate" + } + }, + { + "allocation": { + "memo": null, + "timestamp": "2012-11-20T21:48:09Z", + "quantity": 3, + "previous_quantity": 0, + "component_id": 11960, + "subscription_id": 2585595, + "proration_upgrade_scheme": "no-prorate", + "proration_downgrade_scheme": "no-prorate" + } + } +] +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Allocate Components + Creates multiple allocations, setting the current allocated quantity for each of the components and recording a memo. The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. Be aware of the Order of Resolutions explained below in determining the proration scheme. A `component_id` is required for each allocation. -This endpoint only responds to JSON. It is not available for XML. - -```go -AllocateComponents( - ctx context.Context, - subscriptionId int, +This endpoint only responds to JSON. It is not available for XML. + +```go +AllocateComponents( + ctx context.Context, + subscriptionId int, body *models.AllocateComponents) ( models.ApiResponse[[]models.AllocationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.AllocateComponents`](../../doc/models/allocate-components.md) | Body, Optional | - | - -## Response Type - -[`[]models.AllocationResponse`](../../doc/models/allocation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.AllocateComponents`](../../doc/models/allocate-components.md) | Body, Optional | - | + +## Response Type + +[`[]models.AllocationResponse`](../../doc/models/allocation-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -713,93 +713,93 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "allocation": { - "component_id": 193159, - "subscription_id": 15540611, - "quantity": 10, - "previous_quantity": 0, - "memo": "foo", - "timestamp": "2016-12-08T19:09:15Z", - "proration_upgrade_scheme": "prorate-attempt-capture", - "proration_downgrade_scheme": "no-prorate", - "payment": { - "amount_in_cents": 1451, - "success": true, - "memo": "Payment for: Prorated component allocation changes.", - "id": 165473487 - } - } - }, - { - "allocation": { - "component_id": 277221, - "subscription_id": 15540611, - "quantity": 5, - "previous_quantity": 0, - "memo": "bar", - "timestamp": "2016-12-08T19:09:15Z", - "proration_upgrade_scheme": "prorate-attempt-capture", - "proration_downgrade_scheme": "no-prorate", - "payment": { - "amount_in_cents": 1451, - "success": true, - "memo": "Payment for: Prorated component allocation changes.", - "id": 165473487 - } - } - } -] -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Preview Allocations - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "allocation": { + "component_id": 193159, + "subscription_id": 15540611, + "quantity": 10, + "previous_quantity": 0, + "memo": "foo", + "timestamp": "2016-12-08T19:09:15Z", + "proration_upgrade_scheme": "prorate-attempt-capture", + "proration_downgrade_scheme": "no-prorate", + "payment": { + "amount_in_cents": 1451, + "success": true, + "memo": "Payment for: Prorated component allocation changes.", + "id": 165473487 + } + } + }, + { + "allocation": { + "component_id": 277221, + "subscription_id": 15540611, + "quantity": 5, + "previous_quantity": 0, + "memo": "bar", + "timestamp": "2016-12-08T19:09:15Z", + "proration_upgrade_scheme": "prorate-attempt-capture", + "proration_downgrade_scheme": "no-prorate", + "payment": { + "amount_in_cents": 1451, + "success": true, + "memo": "Payment for: Prorated component allocation changes.", + "id": 165473487 + } + } + } +] +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Preview Allocations + Chargify offers the ability to preview a potential subscription's **quantity-based** or **on/off** component allocation in the middle of the current billing period. This is useful if you want users to be able to see the effect of a component operation before actually doing it. ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or `downgrade_credits` When the allocation uses multiple different types of `upgrade_charge`s or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the `allocation_preview`, but at the `line_items` and `allocations` level respectfully. -See example below for Fine-Grained Component Control response. - -```go -PreviewAllocations( - ctx context.Context, - subscriptionId int, +See example below for Fine-Grained Component Control response. + +```go +PreviewAllocations( + ctx context.Context, + subscriptionId int, body *models.PreviewAllocationsRequest) ( models.ApiResponse[models.AllocationPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.PreviewAllocationsRequest`](../../doc/models/preview-allocations-request.md) | Body, Optional | - | - -## Response Type - -[`models.AllocationPreviewResponse`](../../doc/models/allocation-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.PreviewAllocationsRequest`](../../doc/models/preview-allocations-request.md) | Body, Optional | - | + +## Response Type + +[`models.AllocationPreviewResponse`](../../doc/models/allocation-preview-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -829,121 +829,121 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "allocation_preview": { - "start_date": "2019-05-02T15:26:46Z", - "end_date": "2019-05-08T15:26:46Z", - "period_type": "prorated", - "total_in_cents": 150, - "total_discount_in_cents": 0, - "total_tax_in_cents": 0, - "subtotal_in_cents": 150, - "existing_balance_in_cents": 0, - "accrue_charge": true, - "line_items": [ - { - "direction": "upgrade", - "transaction_type": "charge", - "kind": "quantity_based_component", - "amount_in_cents": 100, - "taxable_amount_in_cents": 0, - "discount_amount_in_cents": 0, - "memo": "Foo: 0 to 10 foo", - "component_id": 123, - "component_handle": "foo" - }, - { - "direction": "downgrade", - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": -20, - "taxable_amount_in_cents": 0, - "discount_amount_in_cents": 0, - "memo": "Foo: 10 to 5 bar", - "component_id": 456, - "component_handle": "bar" - }, - { - "direction": "upgrade", - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": 70, - "taxable_amount_in_cents": 0, - "discount_amount_in_cents": 0, - "memo": "Foo: 0 to 10 baz", - "component_id": 789, - "component_handle": "baz" - } - ], - "allocations": [ - { - "accrue_charge": true, - "upgrade_charge": "prorated", - "downgrade_credit": "full", - "component_handle": "foo", - "component_id": 123, - "memo": "foo", - "previous_price_point_id": 123, - "previous_quantity": 0, - "price_point_id": 123, - "proration_downgrade_scheme": "full", - "proration_upgrade_scheme": "prorate-delay-capture", - "quantity": 10, - "subscription_id": 123456, - "timestamp": null - }, - { - "accrue_charge": true, - "upgrade_charge": "full", - "downgrade_credit": "prorated", - "component_handle": "bar", - "component_id": 456, - "memo": "foo", - "previous_price_point_id": 456, - "previous_quantity": 10, - "price_point_id": 456, - "proration_downgrade_scheme": "prorate", - "proration_upgrade_scheme": "full-price-delay-capture", - "quantity": 5, - "subscription_id": 123456, - "timestamp": null - }, - { - "accrue_charge": true, - "upgrade_charge": "full", - "downgrade_credit": "none", - "component_handle": "baz", - "component_id": 789, - "memo": "foo", - "previous_price_point_id": 789, - "previous_quantity": 0, - "price_point_id": 789, - "proration_downgrade_scheme": "no-prorate", - "proration_upgrade_scheme": "full-price-delay-capture", - "quantity": 10, - "subscription_id": 123456, - "timestamp": null - } - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ComponentAllocationErrorException`](../../doc/models/component-allocation-error-exception.md) | - - -# Update Prepaid Usage Allocation - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "allocation_preview": { + "start_date": "2019-05-02T15:26:46Z", + "end_date": "2019-05-08T15:26:46Z", + "period_type": "prorated", + "total_in_cents": 150, + "total_discount_in_cents": 0, + "total_tax_in_cents": 0, + "subtotal_in_cents": 150, + "existing_balance_in_cents": 0, + "accrue_charge": true, + "line_items": [ + { + "direction": "upgrade", + "transaction_type": "charge", + "kind": "quantity_based_component", + "amount_in_cents": 100, + "taxable_amount_in_cents": 0, + "discount_amount_in_cents": 0, + "memo": "Foo: 0 to 10 foo", + "component_id": 123, + "component_handle": "foo" + }, + { + "direction": "downgrade", + "transaction_type": "credit", + "kind": "quantity_based_component", + "amount_in_cents": -20, + "taxable_amount_in_cents": 0, + "discount_amount_in_cents": 0, + "memo": "Foo: 10 to 5 bar", + "component_id": 456, + "component_handle": "bar" + }, + { + "direction": "upgrade", + "transaction_type": "credit", + "kind": "quantity_based_component", + "amount_in_cents": 70, + "taxable_amount_in_cents": 0, + "discount_amount_in_cents": 0, + "memo": "Foo: 0 to 10 baz", + "component_id": 789, + "component_handle": "baz" + } + ], + "allocations": [ + { + "accrue_charge": true, + "upgrade_charge": "prorated", + "downgrade_credit": "full", + "component_handle": "foo", + "component_id": 123, + "memo": "foo", + "previous_price_point_id": 123, + "previous_quantity": 0, + "price_point_id": 123, + "proration_downgrade_scheme": "full", + "proration_upgrade_scheme": "prorate-delay-capture", + "quantity": 10, + "subscription_id": 123456, + "timestamp": null + }, + { + "accrue_charge": true, + "upgrade_charge": "full", + "downgrade_credit": "prorated", + "component_handle": "bar", + "component_id": 456, + "memo": "foo", + "previous_price_point_id": 456, + "previous_quantity": 10, + "price_point_id": 456, + "proration_downgrade_scheme": "prorate", + "proration_upgrade_scheme": "full-price-delay-capture", + "quantity": 5, + "subscription_id": 123456, + "timestamp": null + }, + { + "accrue_charge": true, + "upgrade_charge": "full", + "downgrade_credit": "none", + "component_handle": "baz", + "component_id": 789, + "memo": "foo", + "previous_price_point_id": 789, + "previous_quantity": 0, + "price_point_id": 789, + "proration_downgrade_scheme": "no-prorate", + "proration_upgrade_scheme": "full-price-delay-capture", + "quantity": 10, + "subscription_id": 123456, + "timestamp": null + } + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ComponentAllocationErrorException`](../../doc/models/component-allocation-error-exception.md) | + + +# Update Prepaid Usage Allocation Expiration Date + When the expiration interval options are selected on a prepaid usage component price point, all allocations will be created with an expiration date. This expiration date can be changed after the fact to allow for extending or shortening the allocation's active window. In order to change a prepaid usage allocation's expiration date, a PUT call must be made to the allocation's endpoint with a new expiration date. @@ -954,35 +954,35 @@ A few limitations exist when changing an allocation's expiration date: - An expiration date can only be changed for an allocation that belongs to a price point with expiration interval options explicitly set. - An expiration date can be changed towards the future with no limitations. -- An expiration date can be changed towards the past (essentially expiring it) up to the subscription's current period beginning date. - -```go -UpdatePrepaidUsageAllocation( - ctx context.Context, - subscriptionId int, - componentId int, - allocationId int, +- An expiration date can be changed towards the past (essentially expiring it) up to the subscription's current period beginning date. + +```go +UpdatePrepaidUsageAllocationExpirationDate( + ctx context.Context, + subscriptionId int, + componentId int, + allocationId int, body *models.UpdateAllocationExpirationDate) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `allocationId` | `int` | Template, Required | The Chargify id of the allocation | -| `body` | [`*models.UpdateAllocationExpirationDate`](../../doc/models/update-allocation-expiration-date.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `allocationId` | `int` | Template, Required | The Chargify id of the allocation | +| `body` | [`*models.UpdateAllocationExpirationDate`](../../doc/models/update-allocation-expiration-date.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -996,23 +996,23 @@ body := models.UpdateAllocationExpirationDate{ Allocation: models.ToPointer(bodyAllocation), } -resp, err := subscriptionComponentsController.UpdatePrepaidUsageAllocation(ctx, subscriptionId, componentId, allocationId, &body) +resp, err := subscriptionComponentsController.UpdatePrepaidUsageAllocationExpirationDate(ctx, subscriptionId, componentId, allocationId, &body) if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionComponentAllocationErrorException`](../../doc/models/subscription-component-allocation-error-exception.md) | - - -# Delete Prepaid Usage Allocation - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionComponentAllocationErrorException`](../../doc/models/subscription-component-allocation-error-exception.md) | + + +# Delete Prepaid Usage Allocation + Prepaid Usage components are unique in that their allocations are always additive. In order to reduce a subscription's allocated quantity for a prepaid usage component each allocation must be destroyed individually via this endpoint. ## Credit Scheme @@ -1021,35 +1021,35 @@ By default, destroying an allocation will generate a service credit on the subsc 1. `none`: The allocation will be destroyed and the balances will be updated but no service credit or refund will be created. 2. `credit`: The allocation will be destroyed and the balances will be updated and a service credit will be generated. This is also the default behavior if the `credit_scheme` param is not passed. -3. `refund`: The allocation will be destroyed and the balances will be updated and a refund will be issued along with a Credit Note. - -```go -DeletePrepaidUsageAllocation( - ctx context.Context, - subscriptionId int, - componentId int, - allocationId int, +3. `refund`: The allocation will be destroyed and the balances will be updated and a refund will be issued along with a Credit Note. + +```go +DeletePrepaidUsageAllocation( + ctx context.Context, + subscriptionId int, + componentId int, + allocationId int, body *models.CreditSchemeRequest) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | -| `allocationId` | `int` | Template, Required | The Chargify id of the allocation | -| `body` | [`*models.CreditSchemeRequest`](../../doc/models/credit-scheme-request.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | +| `allocationId` | `int` | Template, Required | The Chargify id of the allocation | +| `body` | [`*models.CreditSchemeRequest`](../../doc/models/credit-scheme-request.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -1064,18 +1064,18 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionComponentAllocationErrorException`](../../doc/models/subscription-component-allocation-error-exception.md) | - - -# Create Usage - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionComponentAllocationErrorException`](../../doc/models/subscription-component-allocation-error-exception.md) | + + +# Create Usage + ## Documentation Full documentation on how to create Components in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#creating-components). Additionally, for information on how to record component usage against a subscription, please see the following resources: @@ -1131,33 +1131,33 @@ The `unit_balance` has a floor of `0`; negative unit balances are never allowed. Q. Is it possible to record metered usage for more than one component at a time? -A. No. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. - -```go -CreateUsage( - ctx context.Context, - subscriptionId int, - componentId interface{}, +A. No. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. + +```go +CreateUsage( + ctx context.Context, + subscriptionId int, + componentId interface{}, body *models.CreateUsageRequest) ( models.ApiResponse[models.UsageResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `interface{}` | Template, Required | Either the Chargify id for the component or the component's handle prefixed by `handle:` | -| `body` | [`*models.CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Optional | - | - -## Response Type - -[`models.UsageResponse`](../../doc/models/usage-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `interface{}` | Template, Required | Either the Chargify id for the component or the component's handle prefixed by `handle:` | +| `body` | [`*models.CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Optional | - | + +## Response Type + +[`models.UsageResponse`](../../doc/models/usage-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := interface{}("[key1, val1][key2, val2]") @@ -1179,35 +1179,35 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "usage": { - "id": 138522957, - "memo": "My memo", - "created_at": "2017-11-13T10:05:32-06:00", - "price_point_id": 149416, - "quantity": 1000, - "component_id": 500093, - "component_handle": "handle", - "subscription_id": 22824464 - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Usages - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "usage": { + "id": 138522957, + "memo": "My memo", + "created_at": "2017-11-13T10:05:32-06:00", + "price_point_id": 149416, + "quantity": 1000, + "component_id": 500093, + "component_handle": "handle", + "subscription_id": 22824464 + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Usages + This request will return a list of the 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. @@ -1222,35 +1222,35 @@ Note: The `since_date` and `until_date` attributes each default to midnight on t ## Read Usage by Handle -Use this endpoint to read the previously recorded components for a subscription. You can now specify either the component id (integer) or the component handle prefixed by "handle:" to specify the unique identifier for the component you are working with. - -```go -ListUsages( +Use this endpoint to read the previously recorded components for a subscription. You can now specify either the component id (integer) or the component handle prefixed by "handle:" to specify the unique identifier for the component you are working with. + +```go +ListUsages( ctx context.Context,input ListUsagesInput) ( models.ApiResponse[[]models.UsageResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `interface{}` | Template, Required | Either the Chargify id for the component or the component's handle prefixed by `handle:` | -| `sinceId` | `*int` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `maxId` | `*int` | Query, Optional | Returns usages with an id less than or equal to the one specified | -| `sinceDate` | `*time.Time` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | -| `untilDate` | `*time.Time` | 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`. | -| `perPage` | `*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`. | - -## Response Type - -[`[]models.UsageResponse`](../../doc/models/usage-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `interface{}` | Template, Required | Either the Chargify id for the component or the component's handle prefixed by `handle:` | +| `sinceId` | `*int` | Query, Optional | Returns usages with an id greater than or equal to the one specified | +| `maxId` | `*int` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `sinceDate` | `*time.Time` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | +| `untilDate` | `*time.Time` | 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`. | +| `perPage` | `*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`. | + +## Response Type + +[`[]models.UsageResponse`](../../doc/models/usage-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := interface{}("[key1, val1][key2, val2]") @@ -1264,74 +1264,74 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "usage": { - "id": 178534642, - "memo": "20", - "created_at": "2018-08-03T11:58:42-05:00", - "price_point_id": 242632, - "quantity": "20.0", - "component_id": 500093, - "component_handle": "handle", - "subscription_id": 22824464 - } - }, - { - "usage": { - "id": 178534591, - "memo": "10", - "created_at": "2018-08-03T11:58:29-05:00", - "price_point_id": 242632, - "quantity": "10.0", - "component_id": 500093, - "component_handle": "handle", - "subscription_id": 22824464 - } - } -] -``` - - -# Activate Event Based Component - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "usage": { + "id": 178534642, + "memo": "20", + "created_at": "2018-08-03T11:58:42-05:00", + "price_point_id": 242632, + "quantity": "20.0", + "component_id": 500093, + "component_handle": "handle", + "subscription_id": 22824464 + } + }, + { + "usage": { + "id": 178534591, + "memo": "10", + "created_at": "2018-08-03T11:58:29-05:00", + "price_point_id": 242632, + "quantity": "10.0", + "component_id": 500093, + "component_handle": "handle", + "subscription_id": 22824464 + } + } +] +``` + + +# Activate Event Based Component + 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://chargify.zendesk.com/hc/en-us/articles/4407720810907#activating-components-for-subscribers). Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Chargify to bill 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.* - -```go -ActivateEventBasedComponent( - ctx context.Context, - subscriptionId int, +*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.* + +```go +ActivateEventBasedComponent( + ctx context.Context, + subscriptionId int, componentId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -1341,37 +1341,37 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Deactivate Event Based Component - -Use this endpoint to deactivate an event-based component for a single subscription. Deactivating the event-based component causes Chargify to ignore related events at subscription renewal. - -```go -DeactivateEventBasedComponent( - ctx context.Context, - subscriptionId int, +} +``` + + +# Deactivate Event Based Component + +Use this endpoint to deactivate an event-based component for a single subscription. Deactivating the event-based component causes Chargify to ignore related events at subscription renewal. + +```go +DeactivateEventBasedComponent( + ctx context.Context, + subscriptionId int, componentId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `componentId` | `int` | Template, Required | The Chargify id of the component | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `componentId` | `int` | Template, Required | The Chargify id of the component | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 componentId := 222 @@ -1381,12 +1381,12 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Record Event - +} +``` + + +# Record Event + ## 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 Chargify. @@ -1405,35 +1405,35 @@ Use this endpoint to record a single event. ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle -``` - -```go -RecordEvent( - ctx context.Context, - subdomain string, - apiHandle string, - storeUid *string, +``` + +```go +RecordEvent( + ctx context.Context, + subdomain string, + apiHandle string, + storeUid *string, body *models.EBBEvent) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subdomain` | `string` | Template, Required | Your site's subdomain | -| `apiHandle` | `string` | Template, Required | Identifies the Stream for which the event should be published. | -| `storeUid` | `*string` | Query, Optional | If you've attached your own Keen project as a Chargify event data-store, use this parameter to indicate the data-store. | -| `body` | [`*models.EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subdomain` | `string` | Template, Required | Your site's subdomain | +| `apiHandle` | `string` | Template, Required | Identifies the Stream for which the event should be published. | +| `storeUid` | `*string` | Query, Optional | If you've attached your own Keen project as a Chargify event data-store, use this parameter to indicate the data-store. | +| `body` | [`*models.EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subdomain := "subdomain4" apiHandle := "api_handle6" @@ -1452,45 +1452,45 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Record Events - +} +``` + + +# Bulk Record Events + Use this endpoint to record a collection of events. *Note: this endpoint differs from the standard Chargify endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* -A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. - -```go -RecordEvents( - ctx context.Context, - subdomain string, - apiHandle string, - storeUid *string, +A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. + +```go +BulkRecordEvents( + ctx context.Context, + subdomain string, + apiHandle string, + storeUid *string, body []models.EBBEvent) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subdomain` | `string` | Template, Required | Your site's subdomain | -| `apiHandle` | `string` | Template, Required | Identifies the Stream for which the events should be published. | -| `storeUid` | `*string` | Query, Optional | If you've attached your own Keen project as a Chargify event data-store, use this parameter to indicate the data-store. | -| `body` | [`[]models.EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subdomain` | `string` | Template, Required | Your site's subdomain | +| `apiHandle` | `string` | Template, Required | Identifies the Stream for which the events should be published. | +| `storeUid` | `*string` | Query, Optional | If you've attached your own Keen project as a Chargify event data-store, use this parameter to indicate the data-store. | +| `body` | [`[]models.EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subdomain := "subdomain4" apiHandle := "api_handle6" @@ -1505,59 +1505,59 @@ body0 := models.EBBEvent{ } body := []models.EBBEvent{body0} -resp, err := subscriptionComponentsController.RecordEvents(ctx, subdomain, apiHandle, nil, body) +resp, err := subscriptionComponentsController.BulkRecordEvents(ctx, subdomain, apiHandle, nil, body) if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# List Subscription Components for Site - -This request will list components applied to each subscription. - -```go -ListSubscriptionComponentsForSite( +} +``` + + +# List Subscription Components for Site + +This request will list components applied to each subscription. + +```go +ListSubscriptionComponentsForSite( ctx context.Context,input ListSubscriptionComponentsForSiteInput) ( models.ApiResponse[models.ListSubscriptionComponentsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `sort` | [`*models.ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query: `sort=updated_at`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `dateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query: `date_field=updated_at`. | -| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2011-12-15`. | -| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | -| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2011-12-16`. | -| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. | -| `subscriptionIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`. | -| `pricePointIds` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | -| `productFamilyIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | -| `include` | [`*models.ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. | -| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | -| `filterCurrencies` | `[]string` | Query, Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`. | -| `filterSubscriptionStates` | [`[]models.SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Query, Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`. | -| `filterSubscriptionDateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. To use this filter you also have to include the following param in the request `include=subscription`. | -| `filterSubscriptionStartDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | -| `filterSubscriptionStartDatetime` | `*string` | Query, 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`. | -| `filterSubscriptionEndDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | -| `filterSubscriptionEndDatetime` | `*string` | Query, 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`. | - -## Response Type - -[`models.ListSubscriptionComponentsResponse`](../../doc/models/list-subscription-components-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `sort` | [`*models.ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query: `sort=updated_at`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | +| `dateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Use in query: `date_field=updated_at`. | +| `startDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2011-12-15`. | +| `startDatetime` | `*string` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | +| `endDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2011-12-16`. | +| `endDatetime` | `*string` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. | +| `subscriptionIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`. | +| `pricePointIds` | [`*models.IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | +| `productFamilyIds` | `[]int` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | +| `include` | [`*models.ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription`. | +| `filterUseSiteExchangeRate` | `*bool` | Query, Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | +| `filterCurrencies` | `[]string` | Query, Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`. | +| `filterSubscriptionStates` | [`[]models.SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Query, Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`. | +| `filterSubscriptionDateField` | [`*models.SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. To use this filter you also have to include the following param in the request `include=subscription`. | +| `filterSubscriptionStartDate` | `*string` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | +| `filterSubscriptionStartDatetime` | `*string` | Query, 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`. | +| `filterSubscriptionEndDate` | `*string` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | +| `filterSubscriptionEndDatetime` | `*string` | Query, 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`. | + +## Response Type + +[`models.ListSubscriptionComponentsResponse`](../../doc/models/list-subscription-components-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -1575,6 +1575,6 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - +} +``` + diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index 6f85f3b6..98e31568 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -1,48 +1,48 @@ -# Subscription Group Invoice Account - -```go -subscriptionGroupInvoiceAccountController := client.SubscriptionGroupInvoiceAccountController() -``` - -## Class Name - -`SubscriptionGroupInvoiceAccountController` - -## Methods - +# Subscription Group Invoice Account + +```go +subscriptionGroupInvoiceAccountController := client.SubscriptionGroupInvoiceAccountController() +``` + +## Class Name + +`SubscriptionGroupInvoiceAccountController` + +## Methods + * [Create Subscription Group Prepayment](../../doc/controllers/subscription-group-invoice-account.md#create-subscription-group-prepayment) * [List Prepayments for Subscription Group](../../doc/controllers/subscription-group-invoice-account.md#list-prepayments-for-subscription-group) -* [Issue Subscription Group Service Credits](../../doc/controllers/subscription-group-invoice-account.md#issue-subscription-group-service-credits) -* [Deduct Subscription Group Service Credits](../../doc/controllers/subscription-group-invoice-account.md#deduct-subscription-group-service-credits) - - -# Create Subscription Group Prepayment - -A prepayment can be added for a subscription group identified by the group's `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. - -```go -CreateSubscriptionGroupPrepayment( - ctx context.Context, - uid string, +* [Issue Subscription Group Service Credit](../../doc/controllers/subscription-group-invoice-account.md#issue-subscription-group-service-credit) +* [Deduct Subscription Group Service Credit](../../doc/controllers/subscription-group-invoice-account.md#deduct-subscription-group-service-credit) + + +# Create Subscription Group Prepayment + +A prepayment can be added for a subscription group identified by the group's `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. + +```go +CreateSubscriptionGroupPrepayment( + ctx context.Context, + uid string, body *models.SubscriptionGroupPrepaymentRequest) ( models.ApiResponse[models.SubscriptionGroupPrepaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.SubscriptionGroupPrepaymentRequest`](../../doc/models/subscription-group-prepayment-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionGroupPrepaymentResponse`](../../doc/models/subscription-group-prepayment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.SubscriptionGroupPrepaymentRequest`](../../doc/models/subscription-group-prepayment-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionGroupPrepaymentResponse`](../../doc/models/subscription-group-prepayment-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -53,57 +53,57 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "id": 6049554, - "amount_in_cents": 10000, - "ending_balance_in_cents": 5000, - "entry_type": "Debit", - "memo": "Debit from invoice account." -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Prepayments for Subscription Group - -This request will list a subscription group's prepayments. - -```go -ListPrepaymentsForSubscriptionGroup( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "id": 6049554, + "amount_in_cents": 10000, + "ending_balance_in_cents": 5000, + "entry_type": "Debit", + "memo": "Debit from invoice account." +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Prepayments for Subscription Group + +This request will list a subscription group's prepayments. + +```go +ListPrepaymentsForSubscriptionGroup( ctx context.Context,input ListPrepaymentsForSubscriptionGroupInput) ( models.ApiResponse[models.ListSubscriptionGroupPrepaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `filterDateField` | [`*models.ListSubscriptionGroupPrepaymentDateField`](../../doc/models/list-subscription-group-prepayment-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `filter[date_field]=created_at`. | -| `filterEndDate` | `*time.Time` | Query, 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`. | -| `filterStartDate` | `*time.Time` | Query, 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`. | -| `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`models.ListSubscriptionGroupPrepaymentResponse`](../../doc/models/list-subscription-group-prepayment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `filterDateField` | [`*models.ListSubscriptionGroupPrepaymentDateField`](../../doc/models/list-subscription-group-prepayment-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `filter[date_field]=created_at`. | +| `filterEndDate` | `*time.Time` | Query, 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`. | +| `filterStartDate` | `*time.Time` | Query, 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`. | +| `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`models.ListSubscriptionGroupPrepaymentResponse`](../../doc/models/list-subscription-group-prepayment-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0"Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key') page := 2 @@ -116,65 +116,65 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "prepayments": [ - { - "prepayment": { - "id": 142, - "subscription_group_uid": "grp_b4qhx3bvx72t8", - "amount_in_cents": 10000, - "remaining_amount_in_cents": 10000, - "details": "test", - "external": true, - "memo": "test", - "payment_type": "cash", - "created_at": "2023-06-21T04:37:02-04:00" - } - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Issue Subscription Group Service Credits - -Credit can be issued for a subscription group identified by the group's `uid`. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. - -```go -IssueSubscriptionGroupServiceCredits( - ctx context.Context, - uid string, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "prepayments": [ + { + "prepayment": { + "id": 142, + "subscription_group_uid": "grp_b4qhx3bvx72t8", + "amount_in_cents": 10000, + "remaining_amount_in_cents": 10000, + "details": "test", + "external": true, + "memo": "test", + "payment_type": "cash", + "created_at": "2023-06-21T04:37:02-04:00" + } + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Issue Subscription Group Service Credit + +Credit can be issued for a subscription group identified by the group's `uid`. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. + +```go +IssueSubscriptionGroupServiceCredit( + ctx context.Context, + uid string, body *models.IssueServiceCreditRequest) ( models.ApiResponse[models.ServiceCreditResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.IssueServiceCreditRequest`](../../doc/models/issue-service-credit-request.md) | Body, Optional | - | - -## Response Type - -[`models.ServiceCreditResponse`](../../doc/models/service-credit-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.IssueServiceCreditRequest`](../../doc/models/issue-service-credit-request.md) | Body, Optional | - | + +## Response Type + +[`models.ServiceCreditResponse`](../../doc/models/service-credit-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -187,64 +187,64 @@ body := models.IssueServiceCreditRequest{ ServiceCredit: bodyServiceCredit, } -apiResponse, err := subscriptionGroupInvoiceAccountController.IssueSubscriptionGroupServiceCredits(ctx, uid, &body) +apiResponse, err := subscriptionGroupInvoiceAccountController.IssueSubscriptionGroupServiceCredit(ctx, uid, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "service_credit": { - "id": 101, - "amount_in_cents": 1000, - "ending_balance_in_cents": 2000, - "entry_type": "Credit", - "memo": "Credit to group account" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Deduct Subscription Group Service Credits - -Credit can be deducted for a subscription group identified by the group's `uid`. Credit will be deducted from the group in the amount specified in the request body. - -```go -DeductSubscriptionGroupServiceCredits( - ctx context.Context, - uid string, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "service_credit": { + "id": 101, + "amount_in_cents": 1000, + "ending_balance_in_cents": 2000, + "entry_type": "Credit", + "memo": "Credit to group account" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Deduct Subscription Group Service Credit + +Credit can be deducted for a subscription group identified by the group's `uid`. Credit will be deducted from the group in the amount specified in the request body. + +```go +DeductSubscriptionGroupServiceCredit( + ctx context.Context, + uid string, body *models.DeductServiceCreditRequest) ( models.ApiResponse[models.ServiceCredit], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.DeductServiceCreditRequest`](../../doc/models/deduct-service-credit-request.md) | Body, Optional | - | - -## Response Type - -[`models.ServiceCredit`](../../doc/models/service-credit.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.DeductServiceCreditRequest`](../../doc/models/deduct-service-credit-request.md) | Body, Optional | - | + +## Response Type + +[`models.ServiceCredit`](../../doc/models/service-credit.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -257,31 +257,31 @@ body := models.DeductServiceCreditRequest{ Deduction: bodyDeduction, } -apiResponse, err := subscriptionGroupInvoiceAccountController.DeductSubscriptionGroupServiceCredits(ctx, uid, &body) +apiResponse, err := subscriptionGroupInvoiceAccountController.DeductSubscriptionGroupServiceCredit(ctx, uid, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "id": 100, - "amount_in_cents": 1000, - "ending_balance_in_cents": 0, - "entry_type": "Debit", - "memo": "Debit from group account" -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "id": 100, + "amount_in_cents": 1000, + "ending_balance_in_cents": 0, + "entry_type": "Debit", + "memo": "Debit from group account" +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscription-group-status.md b/doc/controllers/subscription-group-status.md index b1d04a12..07f50deb 100644 --- a/doc/controllers/subscription-group-status.md +++ b/doc/controllers/subscription-group-status.md @@ -1,50 +1,50 @@ -# Subscription Group Status - -```go -subscriptionGroupStatusController := client.SubscriptionGroupStatusController() -``` - -## Class Name - -`SubscriptionGroupStatusController` - -## Methods - +# Subscription Group Status + +```go +subscriptionGroupStatusController := client.SubscriptionGroupStatusController() +``` + +## Class Name + +`SubscriptionGroupStatusController` + +## Methods + * [Cancel Subscriptions in Group](../../doc/controllers/subscription-group-status.md#cancel-subscriptions-in-group) * [Initiate Delayed Cancellation for Group](../../doc/controllers/subscription-group-status.md#initiate-delayed-cancellation-for-group) -* [Stop Delayed Cancellation for Group](../../doc/controllers/subscription-group-status.md#stop-delayed-cancellation-for-group) -* [Reactivate Subscription Group](../../doc/controllers/subscription-group-status.md#reactivate-subscription-group) - - -# Cancel Subscriptions in Group - +* [Cancel Delayed Cancellation for Group](../../doc/controllers/subscription-group-status.md#cancel-delayed-cancellation-for-group) +* [Reactivate Subscription Group](../../doc/controllers/subscription-group-status.md#reactivate-subscription-group) + + +# Cancel Subscriptions in Group + This endpoint will immediately cancel all subscriptions within the specified group. The group is identified by it's `uid` passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members as well must be on automatic billing or they must be prepaid. -In order to cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. - -```go -CancelSubscriptionsInGroup( - ctx context.Context, - uid string, +In order to cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. + +```go +CancelSubscriptionsInGroup( + ctx context.Context, + uid string, body *models.CancelGroupedSubscriptionsRequest) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.CancelGroupedSubscriptionsRequest`](../../doc/models/cancel-grouped-subscriptions-request.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.CancelGroupedSubscriptionsRequest`](../../doc/models/cancel-grouped-subscriptions-request.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -57,43 +57,43 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Initiate Delayed Cancellation for Group - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Initiate Delayed Cancellation for Group + This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by it's uid passed in the URL. -All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. - -```go -InitiateDelayedCancellationForGroup( - ctx context.Context, +All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. + +```go +InitiateDelayedCancellationForGroup( + ctx context.Context, uid string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -102,61 +102,61 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Stop Delayed Cancellation for Group - -Removing the delayed cancellation on a subscription group will ensure that the subscriptions do not get canceled at the end of the period. The request will reset the `cancel_at_end_of_period` flag to false on each member in the group. - -```go -StopDelayedCancellationForGroup( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Cancel Delayed Cancellation for Group + +Removing the delayed cancellation on a subscription group will ensure that the subscriptions do not get canceled at the end of the period. The request will reset the `cancel_at_end_of_period` flag to false on each member in the group. + +```go +CancelDelayedCancellationForGroup( + ctx context.Context, uid string) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() uid := "uid0" -resp, err := subscriptionGroupStatusController.StopDelayedCancellationForGroup(ctx, uid) +resp, err := subscriptionGroupStatusController.CancelDelayedCancellationForGroup(ctx, uid) if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Reactivate Subscription Group - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Reactivate Subscription Group + This endpoint will attempt to reactivate or resume a cancelled subscription group. Upon reactivation, any canceled invoices created after the beginning of the primary subscription's billing period will be reopened and payment will be attempted on them. If the subscription group is being reactivated (as opposed to resumed), new charges will also be assessed for the new billing period. Whether a subscription group is reactivated (a new billing period is created) or resumed (the current billing period is respected) will depend on the parameters that are sent with the request as well as the date of the request relative to the primary subscription's period. @@ -175,31 +175,31 @@ In this case, a subscription group can only be reactivated with a new billing pe Member subscriptions can have billing periods that are longer than the primary (e.g. a monthly primary with annual group members). If the primary subscription in a group cannot be reactivated within the current period, but other group members can be, passing `resume_members=true` will resume the existing billing period for eligible group members. The primary subscription will begin a new billing period. -For calendar billing subscriptions, the new billing period created will be a partial one, spanning from the date of reactivation to the next corresponding calendar renewal date. - -```go -ReactivateSubscriptionGroup( - ctx context.Context, - uid string, +For calendar billing subscriptions, the new billing period created will be a partial one, spanning from the date of reactivation to the next corresponding calendar renewal date. + +```go +ReactivateSubscriptionGroup( + ctx context.Context, + uid string, body *models.ReactivateSubscriptionGroupRequest) ( models.ApiResponse[models.ReactivateSubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.ReactivateSubscriptionGroupRequest`](../../doc/models/reactivate-subscription-group-request.md) | Body, Optional | - | - -## Response Type - -[`models.ReactivateSubscriptionGroupResponse`](../../doc/models/reactivate-subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.ReactivateSubscriptionGroupRequest`](../../doc/models/reactivate-subscription-group-request.md) | Body, Optional | - | + +## Response Type + +[`models.ReactivateSubscriptionGroupResponse`](../../doc/models/reactivate-subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -214,31 +214,31 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "grp_93wgm89cbjkw6", - "scheme": 1, - "customer_id": 1, - "payment_profile_id": 1, - "subscription_ids": [ - 1, - 2 - ], - "primary_subscription_id": 1, - "next_assessment_at": "2020-06-18T12:00:00-04:00", - "state": "active", - "cancel_at_end_of_period": false -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "grp_93wgm89cbjkw6", + "scheme": 1, + "customer_id": 1, + "payment_profile_id": 1, + "subscription_ids": [ + 1, + 2 + ], + "primary_subscription_id": 1, + "next_assessment_at": "2020-06-18T12:00:00-04:00", + "state": "active", + "cancel_at_end_of_period": false +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 176382cd..0c07d278 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -1,28 +1,28 @@ -# Subscription Groups - -```go -subscriptionGroupsController := client.SubscriptionGroupsController() -``` - -## Class Name - -`SubscriptionGroupsController` - -## Methods - +# Subscription Groups + +```go +subscriptionGroupsController := client.SubscriptionGroupsController() +``` + +## Class Name + +`SubscriptionGroupsController` + +## Methods + * [Signup With Subscription Group](../../doc/controllers/subscription-groups.md#signup-with-subscription-group) * [Create Subscription Group](../../doc/controllers/subscription-groups.md#create-subscription-group) * [List Subscription Groups](../../doc/controllers/subscription-groups.md#list-subscription-groups) * [Read Subscription Group](../../doc/controllers/subscription-groups.md#read-subscription-group) * [Update Subscription Group Members](../../doc/controllers/subscription-groups.md#update-subscription-group-members) * [Delete Subscription Group](../../doc/controllers/subscription-groups.md#delete-subscription-group) -* [Read Subscription Group by Subscription Id](../../doc/controllers/subscription-groups.md#read-subscription-group-by-subscription-id) -* [Create Subscription Group Hierarchy](../../doc/controllers/subscription-groups.md#create-subscription-group-hierarchy) -* [Remove Subscription From Group](../../doc/controllers/subscription-groups.md#remove-subscription-from-group) - - -# Signup With Subscription Group - +* [Find Subscription Group](../../doc/controllers/subscription-groups.md#find-subscription-group) +* [Add Subscription to Group](../../doc/controllers/subscription-groups.md#add-subscription-to-group) +* [Remove Subscription From Group](../../doc/controllers/subscription-groups.md#remove-subscription-from-group) + + +# Signup With Subscription Group + Create multiple subscriptions at once under the same customer and consolidate them into a subscription group. You must provide one and only one of the `payer_id`/`payer_reference`/`payer_attributes` for the customer attached to the group. @@ -31,29 +31,29 @@ You must provide one and only one of the `payment_profile_id`/`credit_card_attri Only one of the `subscriptions` can have `"primary": true` attribute set. -When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. - -```go -SignupWithSubscriptionGroup( - ctx context.Context, +When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. + +```go +SignupWithSubscriptionGroup( + ctx context.Context, body *models.SubscriptionGroupSignupRequest) ( models.ApiResponse[models.SubscriptionGroupSignupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.SubscriptionGroupSignupRequest`](../../doc/models/subscription-group-signup-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionGroupSignupResponse`](../../doc/models/subscription-group-signup-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.SubscriptionGroupSignupRequest`](../../doc/models/subscription-group-signup-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionGroupSignupResponse`](../../doc/models/subscription-group-signup-response.md) + +## Example Usage + +```go ctx := context.Background() bodySubscriptionGroupSubscriptions0 := models.SubscriptionGroupSignupItem{ @@ -87,41 +87,41 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionGroupSignupErrorResponseException`](../../doc/models/subscription-group-signup-error-response-exception.md) | - - -# Create Subscription Group - -Creates a subscription group with given members. - -```go -CreateSubscriptionGroup( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionGroupSignupErrorResponseException`](../../doc/models/subscription-group-signup-error-response-exception.md) | + + +# Create Subscription Group + +Creates a subscription group with given members. + +```go +CreateSubscriptionGroup( + ctx context.Context, body *models.CreateSubscriptionGroupRequest) ( models.ApiResponse[models.SubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateSubscriptionGroupRequest`](../../doc/models/create-subscription-group-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateSubscriptionGroupRequest`](../../doc/models/create-subscription-group-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() bodySubscriptionGroup := models.CreateSubscriptionGroup{ @@ -140,68 +140,68 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription_group": { - "customer_id": 1, - "payment_profile": { - "id": 1, - "first_name": "t", - "last_name": "t", - "masked_card_number": "XXXX-XXXX-XXXX-1" - }, - "payment_collection_method": "automatic", - "subscription_ids": [ - 1, - 2 - ], - "created_at": "2021-01-21T05:47:38-05:00" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | - - -# List Subscription Groups - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription_group": { + "customer_id": 1, + "payment_profile": { + "id": 1, + "first_name": "t", + "last_name": "t", + "masked_card_number": "XXXX-XXXX-XXXX-1" + }, + "payment_collection_method": "automatic", + "subscription_ids": [ + 1, + 2 + ], + "created_at": "2021-01-21T05:47:38-05:00" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleStringErrorResponseException`](../../doc/models/single-string-error-response-exception.md) | + + +# 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. #### Account Balance Information -Account balance information for the subscription groups is not returned by default. If this information is desired, the `include[]=account_balances` parameter must be provided with the request. - -```go -ListSubscriptionGroups( +Account balance information for the subscription groups is not returned by default. If this information is desired, the `include[]=account_balances` parameter must be provided with the request. + +```go +ListSubscriptionGroups( ctx context.Context,input ListSubscriptionGroupsInput) ( models.ApiResponse[models.ListSubscriptionGroupsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `include` | `*string` | Query, Optional | A list of additional information to include in the response. The following values are supported:

- `account_balances`: Account balance information for the subscription groups. Use in query: `include[]=account_balances` | - -## Response Type - -[`models.ListSubscriptionGroupsResponse`](../../doc/models/list-subscription-groups-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `include` | `*string` | Query, Optional | A list of additional information to include in the response. The following values are supported:

- `account_balances`: Account balance information for the subscription groups. Use in query: `include[]=account_balances` | + +## Response Type + +[`models.ListSubscriptionGroupsResponse`](../../doc/models/list-subscription-groups-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -213,77 +213,77 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription_groups": [ - { - "uid": "grp_952mvqcnk53wq", - "scheme": 1, - "customer_id": 88498000, - "payment_profile_id": 93063018, - "subscription_ids": [ - 42768907, - 82370782 - ], - "primary_subscription_id": 69844395, - "next_assessment_at": "Sun, 09 Aug 2020 15:59:06 EDT -04:00", - "state": "active", - "cancel_at_end_of_period": false, - "account_balances": { - "prepayments": { - "balance_in_cents": 0 - }, - "service_credits": { - "balance_in_cents": 0 - }, - "pending_discounts": { - "balance_in_cents": 0 - } - } - } - ], - "meta": { - "current_page": 1, - "total_count": 1 - } -} -``` - - -# Read Subscription Group - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription_groups": [ + { + "uid": "grp_952mvqcnk53wq", + "scheme": 1, + "customer_id": 88498000, + "payment_profile_id": 93063018, + "subscription_ids": [ + 42768907, + 82370782 + ], + "primary_subscription_id": 69844395, + "next_assessment_at": "Sun, 09 Aug 2020 15:59:06 EDT -04:00", + "state": "active", + "cancel_at_end_of_period": false, + "account_balances": { + "prepayments": { + "balance_in_cents": 0 + }, + "service_credits": { + "balance_in_cents": 0 + }, + "pending_discounts": { + "balance_in_cents": 0 + } + } + } + ], + "meta": { + "current_page": 1, + "total_count": 1 + } +} +``` + + +# Read Subscription Group + Use this endpoint to find subscription group details. #### Current Billing Amount in Cents -Current billing amount for the subscription group is not returned by default. If this information is desired, the `include[]=current_billing_amount_in_cents` parameter must be provided with the request. - -```go -ReadSubscriptionGroup( - ctx context.Context, +Current billing amount for the subscription group is not returned by default. If this information is desired, the `include[]=current_billing_amount_in_cents` parameter must be provided with the request. + +```go +ReadSubscriptionGroup( + ctx context.Context, uid string) ( models.ApiResponse[models.FullSubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -[`models.FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +[`models.FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -294,80 +294,80 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "grp_939ktzq8v4477", - "scheme": 1, - "customer_id": 400, - "payment_profile_id": 567, - "subscription_ids": [ - 101, - 102, - 103 - ], - "primary_subscription_id": 101, - "next_assessment_at": "2020-08-01T14:00:00-05:00", - "state": "active", - "cancel_at_end_of_period": false, - "current_billing_amount_in_cents": 11500, - "customer": { - "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", - "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" - }, - "account_balances": { - "prepayments": { - "balance_in_cents": 0 - }, - "service_credits": { - "balance_in_cents": 0 - }, - "open_invoices": { - "balance_in_cents": 4400 - }, - "pending_discounts": { - "balance_in_cents": 0 - } - } -} -``` - - -# Update Subscription Group Members - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "grp_939ktzq8v4477", + "scheme": 1, + "customer_id": 400, + "payment_profile_id": 567, + "subscription_ids": [ + 101, + 102, + 103 + ], + "primary_subscription_id": 101, + "next_assessment_at": "2020-08-01T14:00:00-05:00", + "state": "active", + "cancel_at_end_of_period": false, + "current_billing_amount_in_cents": 11500, + "customer": { + "first_name": "Mark", + "last_name": "Wannabewahlberg", + "organization": "The Funky Bunch", + "email": "markymark@example.com", + "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" + }, + "account_balances": { + "prepayments": { + "balance_in_cents": 0 + }, + "service_credits": { + "balance_in_cents": 0 + }, + "open_invoices": { + "balance_in_cents": 4400 + }, + "pending_discounts": { + "balance_in_cents": 0 + } + } +} +``` + + +# Update Subscription Group Members + Use this endpoint to update subscription group members. -`"member_ids": []` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from subscription group. To clean up members, just leave the array empty. - -```go -UpdateSubscriptionGroupMembers( - ctx context.Context, - uid string, +`"member_ids": []` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from subscription group. To clean up members, just leave the array empty. + +```go +UpdateSubscriptionGroupMembers( + ctx context.Context, + uid string, body *models.UpdateSubscriptionGroupRequest) ( models.ApiResponse[models.SubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | -| `body` | [`*models.UpdateSubscriptionGroupRequest`](../../doc/models/update-subscription-group-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | +| `body` | [`*models.UpdateSubscriptionGroupRequest`](../../doc/models/update-subscription-group-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -386,63 +386,63 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription_group": { - "customer_id": 1, - "payment_profile": { - "id": 1, - "first_name": "t", - "last_name": "t", - "masked_card_number": "XXXX-XXXX-XXXX-1" - }, - "payment_collection_method": "automatic", - "subscription_ids": [ - 1 - ], - "created_at": "2021-01-21T05:47:38-05:00" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionGroupUpdateErrorResponseException`](../../doc/models/subscription-group-update-error-response-exception.md) | - - -# Delete Subscription Group - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription_group": { + "customer_id": 1, + "payment_profile": { + "id": 1, + "first_name": "t", + "last_name": "t", + "masked_card_number": "XXXX-XXXX-XXXX-1" + }, + "payment_collection_method": "automatic", + "subscription_ids": [ + 1 + ], + "created_at": "2021-01-21T05:47:38-05:00" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionGroupUpdateErrorResponseException`](../../doc/models/subscription-group-update-error-response-exception.md) | + + +# Delete Subscription Group + Use this endpoint to delete subscription group. -Only groups without members can be deleted - -```go -DeleteSubscriptionGroup( - ctx context.Context, +Only groups without members can be deleted + +```go +DeleteSubscriptionGroup( + ctx context.Context, uid string) ( models.ApiResponse[models.DeleteSubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Template, Required | The uid of the subscription group | - -## Response Type - -[`models.DeleteSubscriptionGroupResponse`](../../doc/models/delete-subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string` | Template, Required | The uid of the subscription group | + +## Response Type + +[`models.DeleteSubscriptionGroupResponse`](../../doc/models/delete-subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() uid := "uid0" @@ -453,115 +453,115 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "grp_99w5xp9y5xycy", - "deleted": true -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Read Subscription Group by Subscription Id - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "grp_99w5xp9y5xycy", + "deleted": true +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Find Subscription Group + Use this endpoint to find subscription group associated with subscription. -If the subscription is not in a group endpoint will return 404 code. - -```go -ReadSubscriptionGroupBySubscriptionId( - ctx context.Context, +If the subscription is not in a group endpoint will return 404 code. + +```go +FindSubscriptionGroup( + ctx context.Context, subscriptionId string) ( models.ApiResponse[models.FullSubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Query, Required | The Chargify id of the subscription associated with the subscription group | - -## Response Type - -[`models.FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Query, Required | The Chargify id of the subscription associated with the subscription group | + +## Response Type + +[`models.FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := "subscription_id0" -apiResponse, err := subscriptionGroupsController.ReadSubscriptionGroupBySubscriptionId(ctx, subscriptionId) +apiResponse, err := subscriptionGroupsController.FindSubscriptionGroup(ctx, subscriptionId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "uid": "grp_939ktzq8v4477", - "scheme": 1, - "customer_id": 400, - "payment_profile_id": 567, - "subscription_ids": [ - 101, - 102, - 103 - ], - "primary_subscription_id": 101, - "next_assessment_at": "2020-08-01T14:00:00-05:00", - "state": "active", - "cancel_at_end_of_period": false, - "customer": { - "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", - "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" - }, - "account_balances": { - "prepayments": { - "balance_in_cents": 0 - }, - "service_credits": { - "balance_in_cents": 0 - }, - "open_invoices": { - "balance_in_cents": 4400 - }, - "pending_discounts": { - "balance_in_cents": 0 - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Create Subscription Group Hierarchy - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "uid": "grp_939ktzq8v4477", + "scheme": 1, + "customer_id": 400, + "payment_profile_id": 567, + "subscription_ids": [ + 101, + 102, + 103 + ], + "primary_subscription_id": 101, + "next_assessment_at": "2020-08-01T14:00:00-05:00", + "state": "active", + "cancel_at_end_of_period": false, + "customer": { + "first_name": "Mark", + "last_name": "Wannabewahlberg", + "organization": "The Funky Bunch", + "email": "markymark@example.com", + "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" + }, + "account_balances": { + "prepayments": { + "balance_in_cents": 0 + }, + "service_credits": { + "balance_in_cents": 0 + }, + "open_invoices": { + "balance_in_cents": 4400 + }, + "pending_discounts": { + "balance_in_cents": 0 + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Add Subscription to Group + For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) 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. @@ -575,31 +575,31 @@ Rather than specifying a customer, the `target` parameter could instead simply h * `"eldest"` which indicates the subscription will be paid for by the root-level customer in the subscribing customer's hierarchy. To create a new subscription into a subscription group, please reference the following: -[Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) - -```go -CreateSubscriptionGroupHierarchy( - ctx context.Context, - subscriptionId int, +[Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) + +```go +AddSubscriptionToGroup( + ctx context.Context, + subscriptionId int, body *models.AddSubscriptionToAGroup) ( models.ApiResponse[models.SubscriptionGroupResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.AddSubscriptionToAGroup`](../../doc/models/add-subscription-to-a-group.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.AddSubscriptionToAGroup`](../../doc/models/add-subscription-to-a-group.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -607,64 +607,64 @@ body := models.AddSubscriptionToAGroup{ Group: models.ToPointer(interface{}("[target, DotLiquid.Hash][billing, DotLiquid.Hash]")), } -apiResponse, err := subscriptionGroupsController.CreateSubscriptionGroupHierarchy(ctx, subscriptionId, &body) +apiResponse, err := subscriptionGroupsController.AddSubscriptionToGroup(ctx, subscriptionId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription_group": { - "customer_id": 130690, - "payment_profile": { - "id": 32055, - "first_name": "Marty", - "last_name": "McFly", - "masked_card_number": "XXXX-XXXX-XXXX-1111" - }, - "subscription_ids": [ - 32988, - 33060, - 32986 - ], - "created_at": "2018-08-30T17:14:30-04:00" - } -} -``` - - -# Remove Subscription From Group - -For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) features, it is possible to remove existing subscription from subscription group. - -```go -RemoveSubscriptionFromGroup( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription_group": { + "customer_id": 130690, + "payment_profile": { + "id": 32055, + "first_name": "Marty", + "last_name": "McFly", + "masked_card_number": "XXXX-XXXX-XXXX-1111" + }, + "subscription_ids": [ + 32988, + 33060, + 32986 + ], + "created_at": "2018-08-30T17:14:30-04:00" + } +} +``` + + +# Remove Subscription From Group + +For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) features, it is possible to remove existing subscription from subscription group. + +```go +RemoveSubscriptionFromGroup( + ctx context.Context, subscriptionId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -673,13 +673,13 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index c5e9d9ce..cbb5dc2c 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -1,48 +1,48 @@ -# Subscription Invoice Account - -```go -subscriptionInvoiceAccountController := client.SubscriptionInvoiceAccountController() -``` - -## Class Name - -`SubscriptionInvoiceAccountController` - -## Methods - +# Subscription Invoice Account + +```go +subscriptionInvoiceAccountController := client.SubscriptionInvoiceAccountController() +``` + +## Class Name + +`SubscriptionInvoiceAccountController` + +## Methods + * [Read Account Balances](../../doc/controllers/subscription-invoice-account.md#read-account-balances) * [Create Prepayment](../../doc/controllers/subscription-invoice-account.md#create-prepayment) * [List Prepayments](../../doc/controllers/subscription-invoice-account.md#list-prepayments) * [Issue Service Credit](../../doc/controllers/subscription-invoice-account.md#issue-service-credit) * [Deduct Service Credit](../../doc/controllers/subscription-invoice-account.md#deduct-service-credit) -* [Refund Prepayment](../../doc/controllers/subscription-invoice-account.md#refund-prepayment) - - -# Read Account Balances - -Returns the `balance_in_cents` of the Subscription's Pending Discount, Service Credit, and Prepayment accounts, as well as the sum of the Subscription's open, payable invoices. - -```go -ReadAccountBalances( - ctx context.Context, +* [Refund Prepayment](../../doc/controllers/subscription-invoice-account.md#refund-prepayment) + + +# Read Account Balances + +Returns the `balance_in_cents` of the Subscription's Pending Discount, Service Credit, and Prepayment accounts, as well as the sum of the Subscription's open, payable invoices. + +```go +ReadAccountBalances( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.AccountBalances], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.AccountBalances`](../../doc/models/account-balances.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.AccountBalances`](../../doc/models/account-balances.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -53,43 +53,43 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Create Prepayment - +} +``` + + +# Create Prepayment + ## Create Prepayment In order to specify a prepayment made against a subscription, specify the `amount, memo, details, 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. -Please note that you **can't** pass `amount_in_cents`. - -```go -CreatePrepayment( - ctx context.Context, - subscriptionId int, +Please note that you **can't** pass `amount_in_cents`. + +```go +CreatePrepayment( + ctx context.Context, + subscriptionId int, body *models.CreatePrepaymentRequest) ( models.ApiResponse[models.CreatePrepaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.CreatePrepaymentRequest`](../../doc/models/create-prepayment-request.md) | Body, Optional | - | - -## Response Type - -[`models.CreatePrepaymentResponse`](../../doc/models/create-prepayment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.CreatePrepaymentRequest`](../../doc/models/create-prepayment-request.md) | Body, Optional | - | + +## Response Type + +[`models.CreatePrepaymentResponse`](../../doc/models/create-prepayment-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -111,55 +111,55 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "prepayment": { - "id": 1, - "subscription_id": 1, - "amount_in_cents": 10000, - "memo": "John Doe - Prepayment", - "created_at": "2020-07-31T05:52:32-04:00", - "starting_balance_in_cents": 0, - "ending_balance_in_cents": -10000 - } -} -``` - - -# List Prepayments - -This request will list a subscription's prepayments. - -```go -ListPrepayments( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "prepayment": { + "id": 1, + "subscription_id": 1, + "amount_in_cents": 10000, + "memo": "John Doe - Prepayment", + "created_at": "2020-07-31T05:52:32-04:00", + "starting_balance_in_cents": 0, + "ending_balance_in_cents": -10000 + } +} +``` + + +# List Prepayments + +This request will list a subscription's prepayments. + +```go +ListPrepayments( ctx context.Context,input ListPrepaymentsInput) ( models.ApiResponse[models.PrepaymentsResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `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`. | -| `perPage` | `*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`. | -| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. created_at - Time when prepayment was created. application_at - Time when prepayment was applied to invoice. Use in query `filter[date_field]=created_at`. | -| `filterStartDate` | `*time.Time` | Query, 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`. | -| `filterEndDate` | `*time.Time` | Query, 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`. | - -## Response Type - -[`models.PrepaymentsResponse`](../../doc/models/prepayments-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `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`. | +| `perPage` | `*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`. | +| `filterDateField` | [`*models.BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. created_at - Time when prepayment was created. application_at - Time when prepayment was applied to invoice. Use in query `filter[date_field]=created_at`. | +| `filterStartDate` | `*time.Time` | Query, 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`. | +| `filterEndDate` | `*time.Time` | Query, 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`. | + +## Response Type + +[`models.PrepaymentsResponse`](../../doc/models/prepayments-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 page := 2 @@ -172,64 +172,64 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "prepayments": [ - { - "id": 17, - "subscription_id": 3558750, - "amount_in_cents": 2000, - "remaining_amount_in_cents": 1100, - "refunded_amount_in_cents": 0, - "external": true, - "memo": "test", - "details": "test details", - "payment_type": "cash", - "created_at": "2022-01-18T22:45:41+11:00" - } - ] -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Issue Service Credit - -Credit will be added to the subscription in the amount specified in the request body. The credit is subsequently applied to the next generated invoice. - -```go -IssueServiceCredit( - ctx context.Context, - subscriptionId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "prepayments": [ + { + "id": 17, + "subscription_id": 3558750, + "amount_in_cents": 2000, + "remaining_amount_in_cents": 1100, + "refunded_amount_in_cents": 0, + "external": true, + "memo": "test", + "details": "test details", + "payment_type": "cash", + "created_at": "2022-01-18T22:45:41+11:00" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Issue Service Credit + +Credit will be added to the subscription in the amount specified in the request body. The credit is subsequently applied to the next generated invoice. + +```go +IssueServiceCredit( + ctx context.Context, + subscriptionId int, body *models.IssueServiceCreditRequest) ( models.ApiResponse[models.ServiceCredit], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.IssueServiceCreditRequest`](../../doc/models/issue-service-credit-request.md) | Body, Optional | - | - -## Response Type - -[`models.ServiceCredit`](../../doc/models/service-credit.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.IssueServiceCreditRequest`](../../doc/models/issue-service-credit-request.md) | Body, Optional | - | + +## Response Type + +[`models.ServiceCredit`](../../doc/models/service-credit.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -249,49 +249,49 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "id": 101, - "amount_in_cents": 1000, - "ending_balance_in_cents": 2000, - "entry_type": "Credit", - "memo": "Credit to group account" -} -``` - - -# Deduct Service Credit - -Credit will be removed from the subscription in the amount specified in the request body. The credit amount being deducted must be equal to or less than the current credit balance. - -```go -DeductServiceCredit( - ctx context.Context, - subscriptionId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "id": 101, + "amount_in_cents": 1000, + "ending_balance_in_cents": 2000, + "entry_type": "Credit", + "memo": "Credit to group account" +} +``` + + +# Deduct Service Credit + +Credit will be removed from the subscription in the amount specified in the request body. The credit amount being deducted must be equal to or less than the current credit balance. + +```go +DeductServiceCredit( + ctx context.Context, + subscriptionId int, body *models.DeductServiceCreditRequest) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.DeductServiceCreditRequest`](../../doc/models/deduct-service-credit-request.md) | Body, Optional | - | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.DeductServiceCreditRequest`](../../doc/models/deduct-service-credit-request.md) | Body, Optional | - | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -309,47 +309,47 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Refund Prepayment - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Refund Prepayment + This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. -The amount may be passed either as a decimal, with `amount`, or an integer in cents, with `amount_in_cents`. - -```go -RefundPrepayment( - ctx context.Context, - subscriptionId int, - prepaymentId string, +The amount may be passed either as a decimal, with `amount`, or an integer in cents, with `amount_in_cents`. + +```go +RefundPrepayment( + ctx context.Context, + subscriptionId int, + prepaymentId string, body *models.RefundPrepaymentRequest) ( models.ApiResponse[models.PrepaymentResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `prepaymentId` | `string` | Template, Required | id of prepayment | -| `body` | [`*models.RefundPrepaymentRequest`](../../doc/models/refund-prepayment-request.md) | Body, Optional | - | - -## Response Type - -[`models.PrepaymentResponse`](../../doc/models/prepayment-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `prepaymentId` | `string` | Template, Required | id of prepayment | +| `body` | [`*models.RefundPrepaymentRequest`](../../doc/models/refund-prepayment-request.md) | Body, Optional | - | + +## Response Type + +[`models.PrepaymentResponse`](../../doc/models/prepayment-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 prepaymentId := "prepayment_id8" @@ -361,14 +361,14 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Bad Request | [`RefundPrepaymentBaseErrorsResponseException`](../../doc/models/refund-prepayment-base-errors-response-exception.md) | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity | [`RefundPrepaymentAggregatedErrorsResponseException`](../../doc/models/refund-prepayment-aggregated-errors-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`RefundPrepaymentBaseErrorsResponseException`](../../doc/models/refund-prepayment-base-errors-response-exception.md) | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity | [`RefundPrepaymentAggregatedErrorsResponseException`](../../doc/models/refund-prepayment-aggregated-errors-response-exception.md) | + diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 0ae28ace..8dbd2262 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -1,24 +1,24 @@ -# Subscription Notes - -```go -subscriptionNotesController := client.SubscriptionNotesController() -``` - -## Class Name - -`SubscriptionNotesController` - -## Methods - +# Subscription Notes + +```go +subscriptionNotesController := client.SubscriptionNotesController() +``` + +## Class Name + +`SubscriptionNotesController` + +## Methods + * [Create Subscription Note](../../doc/controllers/subscription-notes.md#create-subscription-note) * [List Subscription Notes](../../doc/controllers/subscription-notes.md#list-subscription-notes) * [Read Subscription Note](../../doc/controllers/subscription-notes.md#read-subscription-note) * [Update Subscription Note](../../doc/controllers/subscription-notes.md#update-subscription-note) -* [Delete Subscription Note](../../doc/controllers/subscription-notes.md#delete-subscription-note) - - -# Create Subscription Note - +* [Delete Subscription Note](../../doc/controllers/subscription-notes.md#delete-subscription-note) + + +# Create Subscription Note + Use the following method to create a note for a subscription. ## How to Use Subscription Notes @@ -27,31 +27,31 @@ Notes allow you to record information about a particular Subscription in a free If you have structured data such as birth date, color, etc., consider using Metadata instead. -Full documentation on how to use Notes in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181-Subscription-Summary#notes). - -```go -CreateSubscriptionNote( - ctx context.Context, - subscriptionId int, +Full documentation on how to use Notes in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181-Subscription-Summary#notes). + +```go +CreateSubscriptionNote( + ctx context.Context, + subscriptionId int, body *models.UpdateSubscriptionNoteRequest) ( models.ApiResponse[models.SubscriptionNoteResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | - -## Response Type - -[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | + +## Response Type + +[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -71,36 +71,36 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# List Subscription Notes - -Use this method to retrieve a list of Notes associated with a Subscription. The response will be an array of Notes. - -```go -ListSubscriptionNotes( +} +``` + + +# List Subscription Notes + +Use this method to retrieve a list of Notes associated with a Subscription. The response will be an array of Notes. + +```go +ListSubscriptionNotes( ctx context.Context,input ListSubscriptionNotesInput) ( models.ApiResponse[[]models.SubscriptionNoteResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `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`. | -| `perPage` | `*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`. | - -## Response Type - -[`[]models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `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`. | +| `perPage` | `*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`. | + +## Response Type + +[`[]models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 page := 2 @@ -113,64 +113,64 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "note": { - "body": "Test note.", - "created_at": "2015-06-15T13:26:47-04:00", - "id": 5, - "sticky": false, - "subscription_id": 100046, - "updated_at": "2015-06-15T13:28:12-04:00" - } - }, - { - "note": { - "body": "Another test note.", - "created_at": "2015-06-15T12:04:46-04:00", - "id": 4, - "sticky": false, - "subscription_id": 100046, - "updated_at": "2015-06-15T13:26:33-04:00" - } - } -] -``` - - -# Read Subscription Note - -Once you have obtained the ID of the note you wish to read, use this method to show a particular note attached to a subscription. - -```go -ReadSubscriptionNote( - ctx context.Context, - subscriptionId int, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "note": { + "body": "Test note.", + "created_at": "2015-06-15T13:26:47-04:00", + "id": 5, + "sticky": false, + "subscription_id": 100046, + "updated_at": "2015-06-15T13:28:12-04:00" + } + }, + { + "note": { + "body": "Another test note.", + "created_at": "2015-06-15T12:04:46-04:00", + "id": 4, + "sticky": false, + "subscription_id": 100046, + "updated_at": "2015-06-15T13:26:33-04:00" + } + } +] +``` + + +# Read Subscription Note + +Once you have obtained the ID of the note you wish to read, use this method to show a particular note attached to a subscription. + +```go +ReadSubscriptionNote( + ctx context.Context, + subscriptionId int, noteId int) ( models.ApiResponse[models.SubscriptionNoteResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `noteId` | `int` | Template, Required | The Chargify id of the note | - -## Response Type - -[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `noteId` | `int` | Template, Required | The Chargify id of the note | + +## Response Type + +[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 noteId := 66 @@ -182,54 +182,54 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "note": { - "body": "Test note.", - "created_at": "2015-06-15T13:26:47-04:00", - "id": 5, - "sticky": false, - "subscription_id": 100046, - "updated_at": "2015-06-15T13:28:12-04:00" - } -} -``` - - -# Update Subscription Note - -Use the following method to update a note for a Subscription. - -```go -UpdateSubscriptionNote( - ctx context.Context, - subscriptionId int, - noteId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "note": { + "body": "Test note.", + "created_at": "2015-06-15T13:26:47-04:00", + "id": 5, + "sticky": false, + "subscription_id": 100046, + "updated_at": "2015-06-15T13:28:12-04:00" + } +} +``` + + +# Update Subscription Note + +Use the following method to update a note for a Subscription. + +```go +UpdateSubscriptionNote( + ctx context.Context, + subscriptionId int, + noteId int, body *models.UpdateSubscriptionNoteRequest) ( models.ApiResponse[models.SubscriptionNoteResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `noteId` | `int` | Template, Required | The Chargify id of the note | -| `body` | [`*models.UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | - -## Response Type - -[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `noteId` | `int` | Template, Required | The Chargify id of the note | +| `body` | [`*models.UpdateSubscriptionNoteRequest`](../../doc/models/update-subscription-note-request.md) | Body, Optional | Updatable fields for Subscription Note | + +## Response Type + +[`models.SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 noteId := 66 @@ -250,37 +250,37 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Delete Subscription Note - -Use the following method to delete a note for a Subscription. - -```go -DeleteSubscriptionNote( - ctx context.Context, - subscriptionId int, +} +``` + + +# Delete Subscription Note + +Use the following method to delete a note for a Subscription. + +```go +DeleteSubscriptionNote( + ctx context.Context, + subscriptionId int, noteId int) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `noteId` | `int` | Template, Required | The Chargify id of the note | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `noteId` | `int` | Template, Required | The Chargify id of the note | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 noteId := 66 @@ -290,6 +290,6 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - +} +``` + diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 6567ba9e..b81b429c 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -1,21 +1,21 @@ -# Subscription Products - -```go -subscriptionProductsController := client.SubscriptionProductsController() -``` - -## Class Name - -`SubscriptionProductsController` - -## Methods - +# Subscription Products + +```go +subscriptionProductsController := client.SubscriptionProductsController() +``` + +## Class Name + +`SubscriptionProductsController` + +## Methods + * [Migrate Subscription Product](../../doc/controllers/subscription-products.md#migrate-subscription-product) -* [Preview Subscription Product Migration](../../doc/controllers/subscription-products.md#preview-subscription-product-migration) - - -# Migrate Subscription Product - +* [Preview Subscription Product Migration](../../doc/controllers/subscription-products.md#preview-subscription-product-migration) + + +# Migrate Subscription 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. ## Valid Subscriptions @@ -71,31 +71,31 @@ You may wish to redirect customers to different pages depending on whether their 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not. - -```go -MigrateSubscriptionProduct( - ctx context.Context, - subscriptionId int, +8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not. + +```go +MigrateSubscriptionProduct( + ctx context.Context, + subscriptionId int, body *models.SubscriptionProductMigrationRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.SubscriptionProductMigrationRequest`](../../doc/models/subscription-product-migration-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.SubscriptionProductMigrationRequest`](../../doc/models/subscription-product-migration-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -116,171 +116,171 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 15054201, - "state": "trialing", - "trial_started_at": "2016-11-03T13:43:36-04:00", - "trial_ended_at": "2016-11-10T12:43:36-05:00", - "activated_at": "2016-11-02T10:20:57-04:00", - "created_at": "2016-11-02T10:20:55-04:00", - "updated_at": "2016-11-03T13:43:36-04:00", - "expires_at": null, - "balance_in_cents": -13989, - "current_period_ends_at": "2016-11-10T12:43:36-05:00", - "next_assessment_at": "2016-11-10T12:43:36-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": null, - "cancellation_method": null, - "current_period_started_at": "2016-11-03T13:43:35-04:00", - "previous_state": "active", - "signup_payment_id": 160680121, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 14000, - "product_price_in_cents": 1000, - "product_version_number": 6, - "payment_type": "credit_card", - "referral_code": "ghnhvy", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "customer": { - "id": 14543792, - "first_name": "Frankie", - "last_name": "Test", - "organization": null, - "email": "testfrankie111@test.com", - "created_at": "2016-11-02T10:20:55-04:00", - "updated_at": "2016-11-02T10:20:58-04:00", - "reference": null, - "address": null, - "address_2": null, - "city": null, - "state": null, - "zip": null, - "country": null, - "phone": "5555551212", - "portal_invite_last_sent_at": "2016-11-02T10:20:58-04:00", - "portal_invite_last_accepted_at": null, - "verified": false, - "portal_customer_created_at": "2016-11-02T10:20:58-04:00", - "cc_emails": null - }, - "product": { - "id": 3861800, - "name": "Trial Product", - "handle": "trial-product", - "description": "Trial period with payment expected at end of trial.", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2016-07-08T09:53:55-04:00", - "updated_at": "2016-09-05T13:00:36-04:00", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": 0, - "trial_interval": 7, - "trial_interval_unit": "day", - "archived_at": null, - "require_credit_card": true, - "return_params": "", - "taxable": false, - "update_return_url": "", - "initial_charge_after_trial": false, - "version_number": 6, - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 294791, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/xv52yrcc3byx/trial-product" - } - ] - }, - "credit_card": { - "id": 10088716, - "first_name": "F", - "last_name": "NB", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2017, - "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": "Apt. 10", - "payment_type": "credit_card" - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Preview Subscription Product Migration - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 15054201, + "state": "trialing", + "trial_started_at": "2016-11-03T13:43:36-04:00", + "trial_ended_at": "2016-11-10T12:43:36-05:00", + "activated_at": "2016-11-02T10:20:57-04:00", + "created_at": "2016-11-02T10:20:55-04:00", + "updated_at": "2016-11-03T13:43:36-04:00", + "expires_at": null, + "balance_in_cents": -13989, + "current_period_ends_at": "2016-11-10T12:43:36-05:00", + "next_assessment_at": "2016-11-10T12:43:36-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": null, + "cancellation_method": null, + "current_period_started_at": "2016-11-03T13:43:35-04:00", + "previous_state": "active", + "signup_payment_id": 160680121, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 14000, + "product_price_in_cents": 1000, + "product_version_number": 6, + "payment_type": "credit_card", + "referral_code": "ghnhvy", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "customer": { + "id": 14543792, + "first_name": "Frankie", + "last_name": "Test", + "organization": null, + "email": "testfrankie111@test.com", + "created_at": "2016-11-02T10:20:55-04:00", + "updated_at": "2016-11-02T10:20:58-04:00", + "reference": null, + "address": null, + "address_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": "5555551212", + "portal_invite_last_sent_at": "2016-11-02T10:20:58-04:00", + "portal_invite_last_accepted_at": null, + "verified": false, + "portal_customer_created_at": "2016-11-02T10:20:58-04:00", + "cc_emails": null + }, + "product": { + "id": 3861800, + "name": "Trial Product", + "handle": "trial-product", + "description": "Trial period with payment expected at end of trial.", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2016-07-08T09:53:55-04:00", + "updated_at": "2016-09-05T13:00:36-04:00", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": 0, + "trial_interval": 7, + "trial_interval_unit": "day", + "archived_at": null, + "require_credit_card": true, + "return_params": "", + "taxable": false, + "update_return_url": "", + "initial_charge_after_trial": false, + "version_number": 6, + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 294791, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/xv52yrcc3byx/trial-product" + } + ] + }, + "credit_card": { + "id": 10088716, + "first_name": "F", + "last_name": "NB", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 1, + "expiration_year": 2017, + "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": "Apt. 10", + "payment_type": "credit_card" + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Preview Subscription Product Migration + ## Previewing a future date It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a `proration_date` along with the request (eg: `"proration_date": "2020-12-18T18:25:43.511Z"`). -This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now. - -```go -PreviewSubscriptionProductMigration( - ctx context.Context, - subscriptionId int, +This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now. + +```go +PreviewSubscriptionProductMigration( + ctx context.Context, + subscriptionId int, body *models.SubscriptionMigrationPreviewRequest) ( models.ApiResponse[models.SubscriptionMigrationPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.SubscriptionMigrationPreviewRequest`](../../doc/models/subscription-migration-preview-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionMigrationPreviewResponse`](../../doc/models/subscription-migration-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.SubscriptionMigrationPreviewRequest`](../../doc/models/subscription-migration-preview-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionMigrationPreviewResponse`](../../doc/models/subscription-migration-preview-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -299,25 +299,25 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "migration": { - "prorated_adjustment_in_cents": 0, - "charge_in_cents": 5000, - "payment_due_in_cents": 0, - "credit_applied_in_cents": 0 - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "migration": { + "prorated_adjustment_in_cents": 0, + "charge_in_cents": 5000, + "payment_due_in_cents": 0, + "credit_applied_in_cents": 0 + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index d9bec8ad..7b74e620 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -1,15 +1,15 @@ -# Subscription Status - -```go -subscriptionStatusController := client.SubscriptionStatusController() -``` - -## Class Name - -`SubscriptionStatusController` - -## Methods - +# Subscription Status + +```go +subscriptionStatusController := client.SubscriptionStatusController() +``` + +## Class Name + +`SubscriptionStatusController` + +## Methods + * [Retry Subscription](../../doc/controllers/subscription-status.md#retry-subscription) * [Cancel Subscription](../../doc/controllers/subscription-status.md#cancel-subscription) * [Resume Subscription](../../doc/controllers/subscription-status.md#resume-subscription) @@ -17,13 +17,13 @@ subscriptionStatusController := client.SubscriptionStatusController() * [Update Automatic Subscription Resumption](../../doc/controllers/subscription-status.md#update-automatic-subscription-resumption) * [Reactivate Subscription](../../doc/controllers/subscription-status.md#reactivate-subscription) * [Initiate Delayed Cancellation](../../doc/controllers/subscription-status.md#initiate-delayed-cancellation) -* [Stop Delayed Cancellation](../../doc/controllers/subscription-status.md#stop-delayed-cancellation) +* [Cancel Delayed Cancellation](../../doc/controllers/subscription-status.md#cancel-delayed-cancellation) * [Cancel Dunning](../../doc/controllers/subscription-status.md#cancel-dunning) -* [Preview Renewal](../../doc/controllers/subscription-status.md#preview-renewal) - - -# Retry Subscription - +* [Preview Renewal](../../doc/controllers/subscription-status.md#preview-renewal) + + +# Retry Subscription + Chargify offers the ability to retry collecting the balance due on a past due Subscription without waiting for the next scheduled attempt. ## Successful Reactivation @@ -32,29 +32,29 @@ The response will be `200 OK` with the updated Subscription. ## Failed Reactivation -The response will be `422 "Unprocessable Entity`. - -```go -RetrySubscription( - ctx context.Context, +The response will be `422 "Unprocessable Entity`. + +```go +RetrySubscription( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -65,180 +65,180 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 46330, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2018-10-22T13:10:46-06:00", - "created_at": "2018-10-22T13:10:46-06:00", - "updated_at": "2021-06-10T09:23:43-06:00", - "expires_at": null, - "balance_in_cents": 18600, - "current_period_ends_at": "2021-06-22T13:10:46-06:00", - "next_assessment_at": "2021-06-22T13:10:46-06:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": null, - "payment_collection_method": "automatic", - "snap_day": null, - "cancellation_method": null, - "product_price_point_id": 3464, - "next_product_price_point_id": null, - "receives_invoice_emails": null, - "net_terms": null, - "locale": null, - "currency": "USD", - "reference": null, - "scheduled_cancellation_at": null, - "current_period_started_at": "2021-05-22T13:10:46-06:00", - "previous_state": "past_due", - "signup_payment_id": 651268, - "signup_revenue": "6.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 600, - "product_price_in_cents": 600, - "product_version_number": 501, - "payment_type": null, - "referral_code": "rzqvrx", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "coupon_codes": [], - "offer_id": null, - "credit_balance_in_cents": 0, - "prepayment_balance_in_cents": 0, - "payer_id": 142365, - "stored_credential_transaction_id": null, - "next_product_handle": null, - "on_hold_at": null, - "prepaid_dunning": false, - "customer": { - "id": 142365, - "first_name": "Lavern", - "last_name": "Fahey", - "organization": null, - "email": "millie2@example.com", - "created_at": "2018-10-22T13:10:46-06:00", - "updated_at": "2018-10-22T13:10:46-06:00", - "reference": null, - "address": null, - "address_2": null, - "city": null, - "state": null, - "zip": null, - "country": null, - "phone": null, - "portal_invite_last_sent_at": null, - "portal_invite_last_accepted_at": null, - "verified": false, - "portal_customer_created_at": "2018-10-22T13:10:46-06:00", - "vat_number": null, - "cc_emails": "john@example.com, sue@example.com", - "tax_exempt": false, - "parent_id": null, - "locale": null - }, - "product": { - "id": 8080, - "name": "Pro Versions", - "handle": null, - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "month", - "created_at": "2019-02-15T10:15:00-07:00", - "updated_at": "2019-02-15T10:30:34-07:00", - "price_in_cents": 600, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": "", - "require_shipping_address": false, - "request_billing_address": false, - "require_billing_address": false, - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "default_product_price_point_id": 3464, - "version_number": 501, - "update_return_params": "", - "product_price_point_id": 3464, - "product_price_point_name": "Default", - "product_price_point_handle": "uuid:5305c3f0-1375-0137-5619-065dfbfdc636", - "product_family": { - "id": 37, - "name": "Acme Projects", - "description": null, - "handle": "acme-projects", - "accounting_code": null, - "created_at": "2013-02-20T15:05:51-07:00", - "updated_at": "2013-02-20T15:05:51-07:00" - }, - "public_signup_pages": [ - { - "id": 1540, - "return_url": null, - "return_params": "", - "url": "https://acme-test.staging-chargifypay.com/subscribe/2f6y53rrqgsf" - } - ] - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Cancel Subscription - -The DELETE action causes the cancellation of the Subscription. This means, the method sets the Subscription state to "canceled". - -```go -CancelSubscription( - ctx context.Context, - subscriptionId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 46330, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2018-10-22T13:10:46-06:00", + "created_at": "2018-10-22T13:10:46-06:00", + "updated_at": "2021-06-10T09:23:43-06:00", + "expires_at": null, + "balance_in_cents": 18600, + "current_period_ends_at": "2021-06-22T13:10:46-06:00", + "next_assessment_at": "2021-06-22T13:10:46-06:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": null, + "payment_collection_method": "automatic", + "snap_day": null, + "cancellation_method": null, + "product_price_point_id": 3464, + "next_product_price_point_id": null, + "receives_invoice_emails": null, + "net_terms": null, + "locale": null, + "currency": "USD", + "reference": null, + "scheduled_cancellation_at": null, + "current_period_started_at": "2021-05-22T13:10:46-06:00", + "previous_state": "past_due", + "signup_payment_id": 651268, + "signup_revenue": "6.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 600, + "product_price_in_cents": 600, + "product_version_number": 501, + "payment_type": null, + "referral_code": "rzqvrx", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "coupon_codes": [], + "offer_id": null, + "credit_balance_in_cents": 0, + "prepayment_balance_in_cents": 0, + "payer_id": 142365, + "stored_credential_transaction_id": null, + "next_product_handle": null, + "on_hold_at": null, + "prepaid_dunning": false, + "customer": { + "id": 142365, + "first_name": "Lavern", + "last_name": "Fahey", + "organization": null, + "email": "millie2@example.com", + "created_at": "2018-10-22T13:10:46-06:00", + "updated_at": "2018-10-22T13:10:46-06:00", + "reference": null, + "address": null, + "address_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "portal_invite_last_sent_at": null, + "portal_invite_last_accepted_at": null, + "verified": false, + "portal_customer_created_at": "2018-10-22T13:10:46-06:00", + "vat_number": null, + "cc_emails": "john@example.com, sue@example.com", + "tax_exempt": false, + "parent_id": null, + "locale": null + }, + "product": { + "id": 8080, + "name": "Pro Versions", + "handle": null, + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "month", + "created_at": "2019-02-15T10:15:00-07:00", + "updated_at": "2019-02-15T10:30:34-07:00", + "price_in_cents": 600, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": "", + "require_shipping_address": false, + "request_billing_address": false, + "require_billing_address": false, + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "default_product_price_point_id": 3464, + "version_number": 501, + "update_return_params": "", + "product_price_point_id": 3464, + "product_price_point_name": "Default", + "product_price_point_handle": "uuid:5305c3f0-1375-0137-5619-065dfbfdc636", + "product_family": { + "id": 37, + "name": "Acme Projects", + "description": null, + "handle": "acme-projects", + "accounting_code": null, + "created_at": "2013-02-20T15:05:51-07:00", + "updated_at": "2013-02-20T15:05:51-07:00" + }, + "public_signup_pages": [ + { + "id": 1540, + "return_url": null, + "return_params": "", + "url": "https://acme-test.staging-chargifypay.com/subscribe/2f6y53rrqgsf" + } + ] + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Cancel Subscription + +The DELETE action causes the cancellation of the Subscription. This means, the method sets the Subscription state to "canceled". + +```go +CancelSubscription( + ctx context.Context, + subscriptionId int, body *models.CancellationRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -249,180 +249,180 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 15254809, - "state": "canceled", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2016-11-15T15:33:44-05:00", - "created_at": "2016-11-15T15:33:44-05:00", - "updated_at": "2016-11-15T17:13:06-05:00", - "expires_at": null, - "balance_in_cents": 0, - "current_period_ends_at": "2017-08-29T12:00:00-04:00", - "next_assessment_at": "2017-08-29T12:00:00-04:00", - "canceled_at": "2016-11-15T17:13:06-05:00", - "cancellation_message": "Canceling the subscription via the API", - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": null, - "cancellation_method": "merchant_api", - "current_period_started_at": "2016-11-15T15:33:44-05:00", - "previous_state": "active", - "signup_payment_id": 0, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 0, - "product_price_in_cents": 1000, - "product_version_number": 7, - "payment_type": "credit_card", - "referral_code": "tg8qbq", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "customer": { - "id": 14731081, - "first_name": "John", - "last_name": "Doe", - "organization": "Acme Widgets", - "email": "john.doe@example.com", - "created_at": "2016-11-15T15:33:44-05:00", - "updated_at": "2016-11-15T15:33:45-05:00", - "reference": "123", - "address": null, - "address_2": null, - "city": null, - "state": null, - "zip": null, - "country": null, - "phone": null, - "portal_invite_last_sent_at": "2016-11-15T15:33:45-05:00", - "portal_invite_last_accepted_at": null, - "verified": false, - "portal_customer_created_at": "2016-11-15T15:33:45-05:00", - "cc_emails": null - }, - "product": { - "id": 3792003, - "name": "$10 Basic Plan", - "handle": "basic", - "description": "lorem ipsum", - "accounting_code": "basic", - "request_credit_card": false, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2016-03-24T13:38:39-04:00", - "updated_at": "2016-11-03T13:03:05-04:00", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "day", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "initial_charge_after_trial": false, - "version_number": 7, - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "description": "", - "handle": "billing-plans", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 281054, - "return_url": "http://www.example.com?successfulsignup", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" - }, - { - "id": 281240, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" - }, - { - "id": 282694, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" - } - ] - }, - "credit_card": { - "id": 10202898, - "first_name": "John", - "last_name": "Doe", - "masked_card_number": "XXXX-XXXX-XXXX-1111", - "card_type": "visa", - "expiration_month": 12, - "expiration_year": 2020, - "customer_id": 14731081, - "current_vault": "authorizenet", - "vault_token": "12345", - "billing_address": null, - "billing_city": null, - "billing_state": null, - "billing_zip": null, - "billing_country": null, - "customer_vault_token": "67890", - "billing_address_2": null, - "payment_type": "credit_card" - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | `ApiError` | - - -# Resume Subscription - -Resume a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. - -```go -ResumeSubscription( - ctx context.Context, - subscriptionId int, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 15254809, + "state": "canceled", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2016-11-15T15:33:44-05:00", + "created_at": "2016-11-15T15:33:44-05:00", + "updated_at": "2016-11-15T17:13:06-05:00", + "expires_at": null, + "balance_in_cents": 0, + "current_period_ends_at": "2017-08-29T12:00:00-04:00", + "next_assessment_at": "2017-08-29T12:00:00-04:00", + "canceled_at": "2016-11-15T17:13:06-05:00", + "cancellation_message": "Canceling the subscription via the API", + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": null, + "cancellation_method": "merchant_api", + "current_period_started_at": "2016-11-15T15:33:44-05:00", + "previous_state": "active", + "signup_payment_id": 0, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 0, + "product_price_in_cents": 1000, + "product_version_number": 7, + "payment_type": "credit_card", + "referral_code": "tg8qbq", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "customer": { + "id": 14731081, + "first_name": "John", + "last_name": "Doe", + "organization": "Acme Widgets", + "email": "john.doe@example.com", + "created_at": "2016-11-15T15:33:44-05:00", + "updated_at": "2016-11-15T15:33:45-05:00", + "reference": "123", + "address": null, + "address_2": null, + "city": null, + "state": null, + "zip": null, + "country": null, + "phone": null, + "portal_invite_last_sent_at": "2016-11-15T15:33:45-05:00", + "portal_invite_last_accepted_at": null, + "verified": false, + "portal_customer_created_at": "2016-11-15T15:33:45-05:00", + "cc_emails": null + }, + "product": { + "id": 3792003, + "name": "$10 Basic Plan", + "handle": "basic", + "description": "lorem ipsum", + "accounting_code": "basic", + "request_credit_card": false, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2016-03-24T13:38:39-04:00", + "updated_at": "2016-11-03T13:03:05-04:00", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "day", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "initial_charge_after_trial": false, + "version_number": 7, + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "description": "", + "handle": "billing-plans", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 281054, + "return_url": "http://www.example.com?successfulsignup", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" + }, + { + "id": 281240, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" + }, + { + "id": 282694, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" + } + ] + }, + "credit_card": { + "id": 10202898, + "first_name": "John", + "last_name": "Doe", + "masked_card_number": "XXXX-XXXX-XXXX-1111", + "card_type": "visa", + "expiration_month": 12, + "expiration_year": 2020, + "customer_id": 14731081, + "current_vault": "authorizenet", + "vault_token": "12345", + "billing_address": null, + "billing_city": null, + "billing_state": null, + "billing_zip": null, + "billing_country": null, + "customer_vault_token": "67890", + "billing_address_2": null, + "payment_type": "credit_card" + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | `ApiError` | + + +# Resume Subscription + +Resume a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. + +```go +ResumeSubscription( + ctx context.Context, + subscriptionId int, calendarBillingResumptionCharge *models.ResumptionCharge) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `calendarBillingResumptionCharge` | [`*models.ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `calendarBillingResumptionCharge` | [`*models.ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222Liquid error: Value cannot be null. (Parameter 'key') @@ -433,156 +433,156 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 18220670, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2017-06-27T13:45:15-05:00", - "created_at": "2017-06-27T13:45:13-05:00", - "updated_at": "2017-06-30T09:26:50-05:00", - "expires_at": null, - "balance_in_cents": 10000, - "current_period_ends_at": "2017-06-30T12:00:00-05:00", - "next_assessment_at": "2017-06-30T12:00:00-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": "end", - "cancellation_method": null, - "current_period_started_at": "2017-06-27T13:45:13-05:00", - "previous_state": "active", - "signup_payment_id": 191819284, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 0, - "product_price_in_cents": 0, - "product_version_number": 1, - "payment_type": null, - "referral_code": "d3pw7f", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "current_billing_amount_in_cents": 10000, - "customer": { - "id": 17780587, - "first_name": "Catie", - "last_name": "Test", - "organization": "Acme, Inc.", - "email": "catie@example.com", - "created_at": "2017-06-27T13:01:05-05:00", - "updated_at": "2017-06-30T09:23:10-05:00", - "reference": "123ABC", - "address": "123 Anywhere Street", - "address_2": "Apartment #10", - "city": "Los Angeles", - "state": "CA", - "zip": "90210", - "country": "US", - "phone": "555-555-5555", - "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", - "portal_invite_last_accepted_at": null, - "verified": true, - "portal_customer_created_at": "2017-06-27T13:01:08-05:00", - "cc_emails": "support@example.com", - "tax_exempt": true - }, - "product": { - "id": 4470347, - "name": "Zero Dollar Product", - "handle": "zero-dollar-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-03-23T10:54:12-05:00", - "updated_at": "2017-04-20T15:18:46-05:00", - "price_in_cents": 0, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 997233, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 316810, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" - } - ] - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Pause Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 18220670, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2017-06-27T13:45:15-05:00", + "created_at": "2017-06-27T13:45:13-05:00", + "updated_at": "2017-06-30T09:26:50-05:00", + "expires_at": null, + "balance_in_cents": 10000, + "current_period_ends_at": "2017-06-30T12:00:00-05:00", + "next_assessment_at": "2017-06-30T12:00:00-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": "end", + "cancellation_method": null, + "current_period_started_at": "2017-06-27T13:45:13-05:00", + "previous_state": "active", + "signup_payment_id": 191819284, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 0, + "product_price_in_cents": 0, + "product_version_number": 1, + "payment_type": null, + "referral_code": "d3pw7f", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "current_billing_amount_in_cents": 10000, + "customer": { + "id": 17780587, + "first_name": "Catie", + "last_name": "Test", + "organization": "Acme, Inc.", + "email": "catie@example.com", + "created_at": "2017-06-27T13:01:05-05:00", + "updated_at": "2017-06-30T09:23:10-05:00", + "reference": "123ABC", + "address": "123 Anywhere Street", + "address_2": "Apartment #10", + "city": "Los Angeles", + "state": "CA", + "zip": "90210", + "country": "US", + "phone": "555-555-5555", + "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", + "portal_invite_last_accepted_at": null, + "verified": true, + "portal_customer_created_at": "2017-06-27T13:01:08-05:00", + "cc_emails": "support@example.com", + "tax_exempt": true + }, + "product": { + "id": 4470347, + "name": "Zero Dollar Product", + "handle": "zero-dollar-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-03-23T10:54:12-05:00", + "updated_at": "2017-04-20T15:18:46-05:00", + "price_in_cents": 0, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 997233, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 316810, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" + } + ] + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Pause Subscription + This will place the subscription in the on_hold state and it will not renew. ## Limitations -You may not place a subscription on hold if the `next_billing` date is within 24 hours. - -```go -PauseSubscription( - ctx context.Context, - subscriptionId int, +You may not place a subscription on hold if the `next_billing` date is within 24 hours. + +```go +PauseSubscription( + ctx context.Context, + subscriptionId int, body *models.PauseRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -605,158 +605,158 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 18220670, - "state": "on_hold", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2017-06-27T13:45:15-05:00", - "created_at": "2017-06-27T13:45:13-05:00", - "updated_at": "2017-06-30T09:26:50-05:00", - "expires_at": null, - "balance_in_cents": 10000, - "current_period_ends_at": "2017-06-30T12:00:00-05:00", - "next_assessment_at": "2017-06-30T12:00:00-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": "end", - "cancellation_method": null, - "current_period_started_at": "2017-06-27T13:45:13-05:00", - "previous_state": "active", - "signup_payment_id": 191819284, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 0, - "product_price_in_cents": 0, - "product_version_number": 1, - "payment_type": null, - "referral_code": "d3pw7f", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "current_billing_amount_in_cents": 10000, - "customer": { - "id": 17780587, - "first_name": "Catie", - "last_name": "Test", - "organization": "Acme, Inc.", - "email": "catie@example.com", - "created_at": "2017-06-27T13:01:05-05:00", - "updated_at": "2017-06-30T09:23:10-05:00", - "reference": "123ABC", - "address": "123 Anywhere Street", - "address_2": "Apartment #10", - "city": "Los Angeles", - "state": "CA", - "zip": "90210", - "country": "US", - "phone": "555-555-5555", - "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", - "portal_invite_last_accepted_at": null, - "verified": true, - "portal_customer_created_at": "2017-06-27T13:01:08-05:00", - "cc_emails": "support@example.com", - "tax_exempt": true - }, - "product": { - "id": 4470347, - "name": "Zero Dollar Product", - "handle": "zero-dollar-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-03-23T10:54:12-05:00", - "updated_at": "2017-04-20T15:18:46-05:00", - "price_in_cents": 0, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 997233, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 316810, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" - } - ] - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Update Automatic Subscription Resumption - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 18220670, + "state": "on_hold", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2017-06-27T13:45:15-05:00", + "created_at": "2017-06-27T13:45:13-05:00", + "updated_at": "2017-06-30T09:26:50-05:00", + "expires_at": null, + "balance_in_cents": 10000, + "current_period_ends_at": "2017-06-30T12:00:00-05:00", + "next_assessment_at": "2017-06-30T12:00:00-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": "end", + "cancellation_method": null, + "current_period_started_at": "2017-06-27T13:45:13-05:00", + "previous_state": "active", + "signup_payment_id": 191819284, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 0, + "product_price_in_cents": 0, + "product_version_number": 1, + "payment_type": null, + "referral_code": "d3pw7f", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "current_billing_amount_in_cents": 10000, + "customer": { + "id": 17780587, + "first_name": "Catie", + "last_name": "Test", + "organization": "Acme, Inc.", + "email": "catie@example.com", + "created_at": "2017-06-27T13:01:05-05:00", + "updated_at": "2017-06-30T09:23:10-05:00", + "reference": "123ABC", + "address": "123 Anywhere Street", + "address_2": "Apartment #10", + "city": "Los Angeles", + "state": "CA", + "zip": "90210", + "country": "US", + "phone": "555-555-5555", + "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", + "portal_invite_last_accepted_at": null, + "verified": true, + "portal_customer_created_at": "2017-06-27T13:01:08-05:00", + "cc_emails": "support@example.com", + "tax_exempt": true + }, + "product": { + "id": 4470347, + "name": "Zero Dollar Product", + "handle": "zero-dollar-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-03-23T10:54:12-05:00", + "updated_at": "2017-04-20T15:18:46-05:00", + "price_in_cents": 0, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 997233, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 316810, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" + } + ] + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Update Automatic Subscription Resumption + Once a subscription has been paused / put on hold, you can update the date which was specified to automatically resume the subscription. To update a subscription's resume date, use this method to change or update the `automatically_resume_at` date. ### Remove the resume date -Alternately, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. - -```go -UpdateAutomaticSubscriptionResumption( - ctx context.Context, - subscriptionId int, +Alternately, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. + +```go +UpdateAutomaticSubscriptionResumption( + ctx context.Context, + subscriptionId int, body *models.PauseRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -779,140 +779,140 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 20359140, - "state": "on_hold", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2018-01-05T17:15:50-06:00", - "created_at": "2018-01-05T17:15:49-06:00", - "updated_at": "2018-01-09T10:26:14-06:00", - "expires_at": null, - "balance_in_cents": 0, - "current_period_ends_at": "2023-01-05T17:15:00-06:00", - "next_assessment_at": "2023-01-05T17:15:00-06:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": null, - "cancellation_method": null, - "current_period_started_at": "2018-01-05T17:15:49-06:00", - "previous_state": "active", - "signup_payment_id": 219829722, - "signup_revenue": "100.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 10009991, - "product_price_in_cents": 10000, - "product_version_number": 1, - "payment_type": "credit_card", - "referral_code": "8y7jqr", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": "2019-01-20T00:00:00-06:00", - "coupon_codes": [], - "customer": { - "id": 19948683, - "first_name": "Vanessa", - "last_name": "Test", - "organization": "", - "email": "vanessa@example.com", - "created_at": "2018-01-05T17:15:49-06:00", - "updated_at": "2018-01-05T17:15:51-06:00", - "reference": null, - "address": "123 Anywhere Ln", - "address_2": "", - "city": "Boston", - "state": "MA", - "zip": "02120", - "country": "US", - "phone": "555-555-1212", - "portal_invite_last_sent_at": "2018-01-05T17:15:51-06:00", - "portal_invite_last_accepted_at": null, - "verified": null, - "portal_customer_created_at": "2018-01-05T17:15:51-06:00", - "cc_emails": null, - "tax_exempt": false - }, - "product": { - "id": 4535643, - "name": "Annual Product", - "handle": "annual-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-08-25T10:25:31-05:00", - "updated_at": "2017-08-25T10:25:31-05:00", - "price_in_cents": 10000, - "interval": 12, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 1025627, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [] - }, - "credit_card": { - "id": 13826563, - "first_name": "Bomb 3", - "last_name": "Test", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2028, - "customer_id": 19948683, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Anywhere Lane", - "billing_city": "Boston", - "billing_state": "Ma", - "billing_zip": "02120", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card" - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Reactivate Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 20359140, + "state": "on_hold", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2018-01-05T17:15:50-06:00", + "created_at": "2018-01-05T17:15:49-06:00", + "updated_at": "2018-01-09T10:26:14-06:00", + "expires_at": null, + "balance_in_cents": 0, + "current_period_ends_at": "2023-01-05T17:15:00-06:00", + "next_assessment_at": "2023-01-05T17:15:00-06:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": null, + "cancellation_method": null, + "current_period_started_at": "2018-01-05T17:15:49-06:00", + "previous_state": "active", + "signup_payment_id": 219829722, + "signup_revenue": "100.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 10009991, + "product_price_in_cents": 10000, + "product_version_number": 1, + "payment_type": "credit_card", + "referral_code": "8y7jqr", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": "2019-01-20T00:00:00-06:00", + "coupon_codes": [], + "customer": { + "id": 19948683, + "first_name": "Vanessa", + "last_name": "Test", + "organization": "", + "email": "vanessa@example.com", + "created_at": "2018-01-05T17:15:49-06:00", + "updated_at": "2018-01-05T17:15:51-06:00", + "reference": null, + "address": "123 Anywhere Ln", + "address_2": "", + "city": "Boston", + "state": "MA", + "zip": "02120", + "country": "US", + "phone": "555-555-1212", + "portal_invite_last_sent_at": "2018-01-05T17:15:51-06:00", + "portal_invite_last_accepted_at": null, + "verified": null, + "portal_customer_created_at": "2018-01-05T17:15:51-06:00", + "cc_emails": null, + "tax_exempt": false + }, + "product": { + "id": 4535643, + "name": "Annual Product", + "handle": "annual-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-08-25T10:25:31-05:00", + "updated_at": "2017-08-25T10:25:31-05:00", + "price_in_cents": 10000, + "interval": 12, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 1025627, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [] + }, + "credit_card": { + "id": 13826563, + "first_name": "Bomb 3", + "last_name": "Test", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 1, + "expiration_year": 2028, + "customer_id": 19948683, + "current_vault": "bogus", + "vault_token": "1", + "billing_address": "123 Anywhere Lane", + "billing_city": "Boston", + "billing_state": "Ma", + "billing_zip": "02120", + "billing_country": "US", + "customer_vault_token": null, + "billing_address_2": "", + "payment_type": "credit_card" + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Reactivate Subscription + Chargify offers the ability to reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://chargify.zendesk.com/hc/en-us/articles/4407898737691). **Please note: The term @@ -1071,31 +1071,31 @@ PUT request sent to: + The subscription will transition to active + The next billing date should not have changed -+ Any product-related charges should have been collected - -```go -ReactivateSubscription( - ctx context.Context, - subscriptionId int, ++ Any product-related charges should have been collected + +```go +ReactivateSubscription( + ctx context.Context, + subscriptionId int, body *models.ReactivateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.ReactivateSubscriptionRequest`](../../doc/models/reactivate-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.ReactivateSubscriptionRequest`](../../doc/models/reactivate-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1119,157 +1119,157 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 18220670, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2017-06-27T13:45:15-05:00", - "created_at": "2017-06-27T13:45:13-05:00", - "updated_at": "2017-06-30T09:26:50-05:00", - "expires_at": null, - "balance_in_cents": 10000, - "current_period_ends_at": "2017-06-30T12:00:00-05:00", - "next_assessment_at": "2017-06-30T12:00:00-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": "end", - "cancellation_method": null, - "current_period_started_at": "2017-06-27T13:45:13-05:00", - "previous_state": "active", - "signup_payment_id": 191819284, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 0, - "product_price_in_cents": 0, - "product_version_number": 1, - "payment_type": null, - "referral_code": "d3pw7f", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "current_billing_amount_in_cents": 10000, - "customer": { - "id": 17780587, - "first_name": "Catie", - "last_name": "Test", - "organization": "Acme, Inc.", - "email": "catie@example.com", - "created_at": "2017-06-27T13:01:05-05:00", - "updated_at": "2017-06-30T09:23:10-05:00", - "reference": "123ABC", - "address": "123 Anywhere Street", - "address_2": "Apartment #10", - "city": "Los Angeles", - "state": "CA", - "zip": "90210", - "country": "US", - "phone": "555-555-5555", - "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", - "portal_invite_last_accepted_at": null, - "verified": true, - "portal_customer_created_at": "2017-06-27T13:01:08-05:00", - "cc_emails": "support@example.com", - "tax_exempt": true, - "vat_number": "012345678" - }, - "product": { - "id": 4470347, - "name": "Zero Dollar Product", - "handle": "zero-dollar-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-03-23T10:54:12-05:00", - "updated_at": "2017-04-20T15:18:46-05:00", - "price_in_cents": 0, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 997233, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 316810, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" - } - ] - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Initiate Delayed Cancellation - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 18220670, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2017-06-27T13:45:15-05:00", + "created_at": "2017-06-27T13:45:13-05:00", + "updated_at": "2017-06-30T09:26:50-05:00", + "expires_at": null, + "balance_in_cents": 10000, + "current_period_ends_at": "2017-06-30T12:00:00-05:00", + "next_assessment_at": "2017-06-30T12:00:00-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": "end", + "cancellation_method": null, + "current_period_started_at": "2017-06-27T13:45:13-05:00", + "previous_state": "active", + "signup_payment_id": 191819284, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 0, + "product_price_in_cents": 0, + "product_version_number": 1, + "payment_type": null, + "referral_code": "d3pw7f", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "current_billing_amount_in_cents": 10000, + "customer": { + "id": 17780587, + "first_name": "Catie", + "last_name": "Test", + "organization": "Acme, Inc.", + "email": "catie@example.com", + "created_at": "2017-06-27T13:01:05-05:00", + "updated_at": "2017-06-30T09:23:10-05:00", + "reference": "123ABC", + "address": "123 Anywhere Street", + "address_2": "Apartment #10", + "city": "Los Angeles", + "state": "CA", + "zip": "90210", + "country": "US", + "phone": "555-555-5555", + "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", + "portal_invite_last_accepted_at": null, + "verified": true, + "portal_customer_created_at": "2017-06-27T13:01:08-05:00", + "cc_emails": "support@example.com", + "tax_exempt": true, + "vat_number": "012345678" + }, + "product": { + "id": 4470347, + "name": "Zero Dollar Product", + "handle": "zero-dollar-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-03-23T10:54:12-05:00", + "updated_at": "2017-04-20T15:18:46-05:00", + "price_in_cents": 0, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 997233, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 316810, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" + } + ] + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Initiate Delayed Cancellation + Chargify offers the ability to cancel a subscription at the end of the current billing period. This period is set by its current product. Requesting to cancel the subscription at the end of the period sets the `cancel_at_end_of_period` flag to true. -Note that you cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. - -```go -InitiateDelayedCancellation( - ctx context.Context, - subscriptionId int, +Note that you cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. + +```go +InitiateDelayedCancellation( + ctx context.Context, + subscriptionId int, body *models.CancellationRequest) ( models.ApiResponse[models.DelayedCancellationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | - -## Response Type - -[`models.DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.CancellationRequest`](../../doc/models/cancellation-request.md) | Body, Optional | - | + +## Response Type + +[`models.DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1280,96 +1280,96 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Stop Delayed Cancellation - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Cancel Delayed Cancellation + Removing the delayed cancellation on a subscription will ensure that it doesn't get canceled at the end of the period that it is in. The request will reset the `cancel_at_end_of_period` flag to `false`. -This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful. - -```go -StopDelayedCancellation( - ctx context.Context, +This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful. + +```go +CancelDelayedCancellation( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.DelayedCancellationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 -apiResponse, err := subscriptionStatusController.StopDelayedCancellation(ctx, subscriptionId) +apiResponse, err := subscriptionStatusController.CancelDelayedCancellation(ctx, subscriptionId) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "message": "This subscription will no longer be canceled" -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | - - -# Cancel Dunning - -If a subscription is currently in dunning, the subscription will be set to active and the active Dunner will be resolved. - -```go -CancelDunning( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +{ + "message": "This subscription will no longer be canceled" +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + + +# Cancel Dunning + +If a subscription is currently in dunning, the subscription will be set to active and the active Dunner will be resolved. + +```go +CancelDunning( + ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1380,12 +1380,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Preview Renewal - +} +``` + + +# Preview Renewal + The Chargify API allows you to preview a renewal by posting to the renewals endpoint. 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, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). @@ -1407,31 +1407,31 @@ Optionally, **you may provide your own custom quantities** for any component to ## Subscription Side Effects -You can request a `POST` to obtain this data from the endpoint without any side effects. Plain and simple, this will preview data, not log any changes against a subscription. - -```go -PreviewRenewal( - ctx context.Context, - subscriptionId int, +You can request a `POST` to obtain this data from the endpoint without any side effects. Plain and simple, this will preview data, not log any changes against a subscription. + +```go +PreviewRenewal( + ctx context.Context, + subscriptionId int, body *models.RenewalPreviewRequest) ( models.ApiResponse[models.RenewalPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.RenewalPreviewRequest`](../../doc/models/renewal-preview-request.md) | Body, Optional | - | - -## Response Type - -[`models.RenewalPreviewResponse`](../../doc/models/renewal-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.RenewalPreviewRequest`](../../doc/models/renewal-preview-request.md) | Body, Optional | - | + +## Response Type + +[`models.RenewalPreviewResponse`](../../doc/models/renewal-preview-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1464,57 +1464,57 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "renewal_preview": { - "next_assessment_at": "2017-03-13T12:50:55-04:00", - "subtotal_in_cents": 6000, - "total_tax_in_cents": 0, - "total_discount_in_cents": 0, - "total_in_cents": 6000, - "existing_balance_in_cents": 0, - "total_amount_due_in_cents": 6000, - "uncalculated_taxes": false, - "line_items": [ - { - "transaction_type": "charge", - "kind": "baseline", - "amount_in_cents": 5000, - "memo": "Gold Product (03/13/2017 - 04/13/2017)", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "product_id": 1, - "product_handle": "gold-product", - "product_name": "Gold Product", - "period_range_start": "01/10/2024", - "period_range_end": "02/10/2024" - }, - { - "transaction_type": "charge", - "kind": "quantity_based_component", - "amount_in_cents": 1000, - "memo": "Quantity Component: 10 Quantity Components", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 104, - "component_handle": "quantity-component", - "component_name": "Quantity Component", - "period_range_start": "01/10/2024", - "period_range_end": "02/10/2024" - } - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "renewal_preview": { + "next_assessment_at": "2017-03-13T12:50:55-04:00", + "subtotal_in_cents": 6000, + "total_tax_in_cents": 0, + "total_discount_in_cents": 0, + "total_in_cents": 6000, + "existing_balance_in_cents": 0, + "total_amount_due_in_cents": 6000, + "uncalculated_taxes": false, + "line_items": [ + { + "transaction_type": "charge", + "kind": "baseline", + "amount_in_cents": 5000, + "memo": "Gold Product (03/13/2017 - 04/13/2017)", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "product_id": 1, + "product_handle": "gold-product", + "product_name": "Gold Product", + "period_range_start": "01/10/2024", + "period_range_end": "02/10/2024" + }, + { + "transaction_type": "charge", + "kind": "quantity_based_component", + "amount_in_cents": 1000, + "memo": "Quantity Component: 10 Quantity Components", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 104, + "component_handle": "quantity-component", + "component_name": "Quantity Component", + "period_range_start": "01/10/2024", + "period_range_end": "02/10/2024" + } + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index eac271eb..0da9db56 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -1,31 +1,31 @@ -# Subscriptions - -```go -subscriptionsController := client.SubscriptionsController() -``` - -## Class Name - -`SubscriptionsController` - -## Methods - +# Subscriptions + +```go +subscriptionsController := client.SubscriptionsController() +``` + +## Class Name + +`SubscriptionsController` + +## Methods + * [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) * [List Subscriptions](../../doc/controllers/subscriptions.md#list-subscriptions) * [Update Subscription](../../doc/controllers/subscriptions.md#update-subscription) * [Read Subscription](../../doc/controllers/subscriptions.md#read-subscription) * [Override Subscription](../../doc/controllers/subscriptions.md#override-subscription) -* [Read Subscription by Reference](../../doc/controllers/subscriptions.md#read-subscription-by-reference) +* [Find Subscription](../../doc/controllers/subscriptions.md#find-subscription) * [Purge Subscription](../../doc/controllers/subscriptions.md#purge-subscription) -* [Create Prepaid Subscription](../../doc/controllers/subscriptions.md#create-prepaid-subscription) +* [Update Prepaid Subscription Configuration](../../doc/controllers/subscriptions.md#update-prepaid-subscription-configuration) * [Preview Subscription](../../doc/controllers/subscriptions.md#preview-subscription) -* [Apply Coupon to Subscription](../../doc/controllers/subscriptions.md#apply-coupon-to-subscription) -* [Delete Coupon From Subscription](../../doc/controllers/subscriptions.md#delete-coupon-from-subscription) -* [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) - - -# Create Subscription - +* [Apply Coupons to Subscription](../../doc/controllers/subscriptions.md#apply-coupons-to-subscription) +* [Remove Coupon From Subscription](../../doc/controllers/subscriptions.md#remove-coupon-from-subscription) +* [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) + + +# Create Subscription + Full documentation on how subscriptions operate within Chargify can be located under the following topics: + [Subscriptions Reference](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577172749-Subscription-Introduction) @@ -635,29 +635,29 @@ Each of them is required. "ip_address": "1.2.3.4" } } -``` - -```go -CreateSubscription( - ctx context.Context, +``` + +```go +CreateSubscription( + ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() bodySubscriptionCustomerAttributes := models.CustomerAttributes{ @@ -707,157 +707,157 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 15236915, - "state": "active", - "balance_in_cents": 0, - "total_revenue_in_cents": 14000, - "product_price_in_cents": 1000, - "product_version_number": 7, - "current_period_ends_at": "2016-11-15T14:48:10-05:00", - "next_assessment_at": "2016-11-15T14:48:10-05:00", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2016-11-14T14:48:12-05:00", - "expires_at": null, - "created_at": "2016-11-14T14:48:10-05:00", - "updated_at": "2016-11-14T15:24:41-05:00", - "cancellation_message": null, - "cancellation_method": "merchant_api", - "cancel_at_end_of_period": null, - "canceled_at": null, - "current_period_started_at": "2016-11-14T14:48:10-05:00", - "previous_state": "active", - "signup_payment_id": 162269766, - "signup_revenue": "260.00", - "delayed_cancel_at": null, - "coupon_code": "5SNN6HFK3GBH", - "payment_collection_method": "automatic", - "snap_day": null, - "reason_code": null, - "receives_invoice_emails": false, - "customer": { - "first_name": "Curtis", - "last_name": "Test", - "email": "curtis@example.com", - "cc_emails": "jeff@example.com", - "organization": "", - "reference": null, - "id": 14714298, - "created_at": "2016-11-14T14:48:10-05:00", - "updated_at": "2016-11-14T14:48:13-05:00", - "address": "123 Anywhere Street", - "address_2": "", - "city": "Boulder", - "state": "CO", - "zip": "80302", - "country": "US", - "phone": "", - "verified": false, - "portal_customer_created_at": "2016-11-14T14:48:13-05:00", - "portal_invite_last_sent_at": "2016-11-14T14:48:13-05:00", - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "vat_number": "012345678" - }, - "product": { - "id": 3792003, - "name": "$10 Basic Plan", - "handle": "basic", - "description": "lorem ipsum", - "accounting_code": "basic", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "day", - "initial_charge_in_cents": null, - "expiration_interval": null, - "expiration_interval_unit": "never", - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "initial_charge_after_trial": false, - "return_params": "", - "request_credit_card": false, - "require_credit_card": false, - "created_at": "2016-03-24T13:38:39-04:00", - "updated_at": "2016-11-03T13:03:05-04:00", - "archived_at": null, - "update_return_url": "", - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "handle": "billing-plans", - "accounting_code": null, - "description": "" - }, - "public_signup_pages": [ - { - "id": 281054, - "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" - }, - { - "id": 281240, - "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" - }, - { - "id": 282694, - "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" - } - ], - "taxable": false, - "version_number": 7, - "product_price_point_name": "Default" - }, - "credit_card": { - "id": 10191713, - "payment_type": "credit_card", - "first_name": "Curtis", - "last_name": "Test", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2026, - "billing_address": "123 Anywhere Street", - "billing_address_2": "", - "billing_city": "Boulder", - "billing_state": null, - "billing_country": "", - "billing_zip": "80302", - "current_vault": "bogus", - "vault_token": "1", - "customer_vault_token": null, - "customer_id": 14714298 - }, - "payment_type": "credit_card", - "referral_code": "w7kjc9", - "next_product_id": null, - "coupon_use_count": 1, - "coupon_uses_allowed": 1, - "next_product_handle": null, - "stored_credential_transaction_id": 125566112256688, - "dunning_communication_delay_enabled": true, - "dunning_communication_delay_time_zone": "Eastern Time (US & Canada)" - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Subscriptions - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 15236915, + "state": "active", + "balance_in_cents": 0, + "total_revenue_in_cents": 14000, + "product_price_in_cents": 1000, + "product_version_number": 7, + "current_period_ends_at": "2016-11-15T14:48:10-05:00", + "next_assessment_at": "2016-11-15T14:48:10-05:00", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2016-11-14T14:48:12-05:00", + "expires_at": null, + "created_at": "2016-11-14T14:48:10-05:00", + "updated_at": "2016-11-14T15:24:41-05:00", + "cancellation_message": null, + "cancellation_method": "merchant_api", + "cancel_at_end_of_period": null, + "canceled_at": null, + "current_period_started_at": "2016-11-14T14:48:10-05:00", + "previous_state": "active", + "signup_payment_id": 162269766, + "signup_revenue": "260.00", + "delayed_cancel_at": null, + "coupon_code": "5SNN6HFK3GBH", + "payment_collection_method": "automatic", + "snap_day": null, + "reason_code": null, + "receives_invoice_emails": false, + "customer": { + "first_name": "Curtis", + "last_name": "Test", + "email": "curtis@example.com", + "cc_emails": "jeff@example.com", + "organization": "", + "reference": null, + "id": 14714298, + "created_at": "2016-11-14T14:48:10-05:00", + "updated_at": "2016-11-14T14:48:13-05:00", + "address": "123 Anywhere Street", + "address_2": "", + "city": "Boulder", + "state": "CO", + "zip": "80302", + "country": "US", + "phone": "", + "verified": false, + "portal_customer_created_at": "2016-11-14T14:48:13-05:00", + "portal_invite_last_sent_at": "2016-11-14T14:48:13-05:00", + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "vat_number": "012345678" + }, + "product": { + "id": 3792003, + "name": "$10 Basic Plan", + "handle": "basic", + "description": "lorem ipsum", + "accounting_code": "basic", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "day", + "initial_charge_in_cents": null, + "expiration_interval": null, + "expiration_interval_unit": "never", + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "initial_charge_after_trial": false, + "return_params": "", + "request_credit_card": false, + "require_credit_card": false, + "created_at": "2016-03-24T13:38:39-04:00", + "updated_at": "2016-11-03T13:03:05-04:00", + "archived_at": null, + "update_return_url": "", + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "handle": "billing-plans", + "accounting_code": null, + "description": "" + }, + "public_signup_pages": [ + { + "id": 281054, + "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" + }, + { + "id": 281240, + "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" + }, + { + "id": 282694, + "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" + } + ], + "taxable": false, + "version_number": 7, + "product_price_point_name": "Default" + }, + "credit_card": { + "id": 10191713, + "payment_type": "credit_card", + "first_name": "Curtis", + "last_name": "Test", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 1, + "expiration_year": 2026, + "billing_address": "123 Anywhere Street", + "billing_address_2": "", + "billing_city": "Boulder", + "billing_state": null, + "billing_country": "", + "billing_zip": "80302", + "current_vault": "bogus", + "vault_token": "1", + "customer_vault_token": null, + "customer_id": 14714298 + }, + "payment_type": "credit_card", + "referral_code": "w7kjc9", + "next_product_id": null, + "coupon_use_count": 1, + "coupon_uses_allowed": 1, + "next_product_handle": null, + "stored_credential_transaction_id": 125566112256688, + "dunning_communication_delay_enabled": true, + "dunning_communication_delay_time_zone": "Eastern Time (US & Canada)" + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Subscriptions + This method will return an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. ## Search for a subscription @@ -866,42 +866,42 @@ Use the query strings below to search for a subscription using the criteria avai ## Self-Service Page token -Self-Service Page token for the subscriptions is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. - -```go -ListSubscriptions( +Self-Service Page token for the subscriptions is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. + +```go +ListSubscriptions( ctx context.Context,input ListSubscriptionsInput) ( models.ApiResponse[[]models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `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`. | -| `perPage` | `*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`. | -| `state` | [`*models.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.) | -| `productPricePointId` | `*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.) | -| `dateField` | [`*models.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 | -| `startDate` | `*time.Time` | 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`. | -| `endDate` | `*time.Time` | 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`. | -| `startDatetime` | `*time.Time` | 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`. | -| `endDatetime` | `*time.Time` | 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` | `map[string]string` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | -| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`*models.SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort | -| `include` | [`[]models.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 - -[`[]models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `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`. | +| `perPage` | `*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`. | +| `state` | [`*models.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.) | +| `productPricePointId` | `*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.) | +| `dateField` | [`*models.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 | +| `startDate` | `*time.Time` | 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`. | +| `endDate` | `*time.Time` | 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`. | +| `startDatetime` | `*time.Time` | 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`. | +| `endDatetime` | `*time.Time` | 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` | `map[string]string` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | +| `direction` | [`*models.SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | +| `sort` | [`*models.SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort | +| `include` | [`[]models.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 + +[`[]models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -930,12 +930,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Update Subscription - +} +``` + + +# Update Subscription + The subscription endpoint allows you to instantly update one or many attributes about a subscription in a single call. ## Update Subscription Payment Method @@ -976,31 +976,31 @@ 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_date` and immediately `READ/GET` the subscription data, it will still contain evidence of the existing `snap_date`. This is due to the fact that a product change is instantanous and only affects the product associated with a subscription. After the `next_billing` date arrives, the `snap_day` associated with the subscription will return to `null.` Another way of looking at this is that you willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. - -```go -UpdateSubscription( - ctx context.Context, - subscriptionId int, +Note: If you change the product associated with a subscription that contains a `snap_date` and immediately `READ/GET` the subscription data, it will still contain evidence of the existing `snap_date`. This is due to the fact that a product change is instantanous and only affects the product associated with a subscription. After the `next_billing` date arrives, the `snap_day` associated with the subscription will return to `null.` Another way of looking at this is that you willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. + +```go +UpdateSubscription( + ctx context.Context, + subscriptionId int, body *models.UpdateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.UpdateSubscriptionRequest`](../../doc/models/update-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.UpdateSubscriptionRequest`](../../doc/models/update-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1026,157 +1026,157 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 18220670, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2017-06-27T13:45:15-05:00", - "created_at": "2017-06-27T13:45:13-05:00", - "updated_at": "2017-06-30T09:26:50-05:00", - "expires_at": null, - "balance_in_cents": 10000, - "current_period_ends_at": "2017-06-30T12:00:00-05:00", - "next_assessment_at": "2017-06-30T12:00:00-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "automatic", - "snap_day": "end", - "cancellation_method": null, - "current_period_started_at": "2017-06-27T13:45:13-05:00", - "previous_state": "active", - "signup_payment_id": 191819284, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": null, - "total_revenue_in_cents": 0, - "product_price_in_cents": 0, - "product_version_number": 1, - "payment_type": null, - "referral_code": "d3pw7f", - "coupon_use_count": null, - "coupon_uses_allowed": null, - "reason_code": null, - "automatically_resume_at": null, - "current_billing_amount_in_cents": 10000, - "receives_invoice_emails": false, - "customer": { - "id": 17780587, - "first_name": "Catie", - "last_name": "Test", - "organization": "Acme, Inc.", - "email": "catie@example.com", - "created_at": "2017-06-27T13:01:05-05:00", - "updated_at": "2017-06-30T09:23:10-05:00", - "reference": "123ABC", - "address": "123 Anywhere Street", - "address_2": "Apartment #10", - "city": "Los Angeles", - "state": "CA", - "zip": "90210", - "country": "US", - "phone": "555-555-5555", - "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", - "portal_invite_last_accepted_at": null, - "verified": true, - "portal_customer_created_at": "2017-06-27T13:01:08-05:00", - "cc_emails": "support@example.com", - "tax_exempt": true - }, - "product": { - "id": 4470347, - "name": "Zero Dollar Product", - "handle": "zero-dollar-product", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-03-23T10:54:12-05:00", - "updated_at": "2017-04-20T15:18:46-05:00", - "price_in_cents": 0, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": null, - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": false, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 1, - "update_return_params": "", - "product_family": { - "id": 997233, - "name": "Acme Products", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 316810, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" - } - ] - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# Read Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 18220670, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2017-06-27T13:45:15-05:00", + "created_at": "2017-06-27T13:45:13-05:00", + "updated_at": "2017-06-30T09:26:50-05:00", + "expires_at": null, + "balance_in_cents": 10000, + "current_period_ends_at": "2017-06-30T12:00:00-05:00", + "next_assessment_at": "2017-06-30T12:00:00-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "automatic", + "snap_day": "end", + "cancellation_method": null, + "current_period_started_at": "2017-06-27T13:45:13-05:00", + "previous_state": "active", + "signup_payment_id": 191819284, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": null, + "total_revenue_in_cents": 0, + "product_price_in_cents": 0, + "product_version_number": 1, + "payment_type": null, + "referral_code": "d3pw7f", + "coupon_use_count": null, + "coupon_uses_allowed": null, + "reason_code": null, + "automatically_resume_at": null, + "current_billing_amount_in_cents": 10000, + "receives_invoice_emails": false, + "customer": { + "id": 17780587, + "first_name": "Catie", + "last_name": "Test", + "organization": "Acme, Inc.", + "email": "catie@example.com", + "created_at": "2017-06-27T13:01:05-05:00", + "updated_at": "2017-06-30T09:23:10-05:00", + "reference": "123ABC", + "address": "123 Anywhere Street", + "address_2": "Apartment #10", + "city": "Los Angeles", + "state": "CA", + "zip": "90210", + "country": "US", + "phone": "555-555-5555", + "portal_invite_last_sent_at": "2017-06-27T13:45:16-05:00", + "portal_invite_last_accepted_at": null, + "verified": true, + "portal_customer_created_at": "2017-06-27T13:01:08-05:00", + "cc_emails": "support@example.com", + "tax_exempt": true + }, + "product": { + "id": 4470347, + "name": "Zero Dollar Product", + "handle": "zero-dollar-product", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-03-23T10:54:12-05:00", + "updated_at": "2017-04-20T15:18:46-05:00", + "price_in_cents": 0, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": null, + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": false, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 1, + "update_return_params": "", + "product_family": { + "id": 997233, + "name": "Acme Products", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 316810, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargify.com/subscribe/69x825m78v3d/zero-dollar-product" + } + ] + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# Read Subscription + Use this endpoint to find subscription details. ## 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. - -```go -ReadSubscription( - ctx context.Context, - subscriptionId int, +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. + +```go +ReadSubscription( + ctx context.Context, + subscriptionId int, include []models.SubscriptionInclude) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `include` | [`[]models.SubscriptionInclude`](../../doc/models/subscription-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=coupons&include[]=self_service_page_token`. | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `include` | [`[]models.SubscriptionInclude`](../../doc/models/subscription-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=coupons&include[]=self_service_page_token`. | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222Liquid error: Value cannot be null. (Parameter 'key') @@ -1187,151 +1187,151 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 15236915, - "state": "active", - "balance_in_cents": 0, - "total_revenue_in_cents": 14000, - "product_price_in_cents": 1000, - "product_version_number": 7, - "current_period_ends_at": "2016-11-15T14:48:10-05:00", - "next_assessment_at": "2016-11-15T14:48:10-05:00", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2016-11-14T14:48:12-05:00", - "expires_at": null, - "created_at": "2016-11-14T14:48:10-05:00", - "updated_at": "2016-11-14T15:24:41-05:00", - "cancellation_message": null, - "cancellation_method": null, - "cancel_at_end_of_period": null, - "canceled_at": null, - "current_period_started_at": "2016-11-14T14:48:10-05:00", - "previous_state": "active", - "signup_payment_id": 162269766, - "signup_revenue": "260.00", - "delayed_cancel_at": null, - "coupon_code": "5SNN6HFK3GBH", - "payment_collection_method": "automatic", - "snap_day": null, - "reason_code": null, - "receives_invoice_emails": false, - "net_terms": 0, - "customer": { - "first_name": "Curtis", - "last_name": "Test", - "email": "curtis@example.com", - "cc_emails": "jeff@example.com", - "organization": "", - "reference": null, - "id": 14714298, - "created_at": "2016-11-14T14:48:10-05:00", - "updated_at": "2016-11-14T14:48:13-05:00", - "address": "123 Anywhere Street", - "address_2": "", - "city": "Boulder", - "state": "CO", - "zip": "80302", - "country": "US", - "phone": "", - "verified": false, - "portal_customer_created_at": "2016-11-14T14:48:13-05:00", - "portal_invite_last_sent_at": "2016-11-14T14:48:13-05:00", - "portal_invite_last_accepted_at": null, - "tax_exempt": false, - "vat_number": "012345678" - }, - "product": { - "id": 3792003, - "name": "$10 Basic Plan", - "handle": "basic", - "description": "lorem ipsum", - "accounting_code": "basic", - "price_in_cents": 1000, - "interval": 1, - "interval_unit": "day", - "initial_charge_in_cents": null, - "expiration_interval": null, - "expiration_interval_unit": "never", - "trial_price_in_cents": null, - "trial_interval": null, - "trial_interval_unit": "month", - "initial_charge_after_trial": false, - "return_params": "", - "request_credit_card": false, - "require_credit_card": false, - "created_at": "2016-03-24T13:38:39-04:00", - "updated_at": "2016-11-03T13:03:05-04:00", - "archived_at": null, - "update_return_url": "", - "update_return_params": "", - "product_family": { - "id": 527890, - "name": "Acme Projects", - "handle": "billing-plans", - "accounting_code": null, - "description": "" - }, - "public_signup_pages": [ - { - "id": 281054, - "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" - }, - { - "id": 281240, - "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" - }, - { - "id": 282694, - "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" - } - ], - "taxable": false, - "version_number": 7, - "product_price_point_name": "Default" - }, - "credit_card": { - "id": 10191713, - "payment_type": "credit_card", - "first_name": "Curtis", - "last_name": "Test", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2026, - "billing_address": "123 Anywhere Street", - "billing_address_2": "", - "billing_city": "Boulder", - "billing_state": null, - "billing_country": "", - "billing_zip": "80302", - "current_vault": "bogus", - "vault_token": "1", - "customer_vault_token": null, - "customer_id": 14714298 - }, - "payment_type": "credit_card", - "referral_code": "w7kjc9", - "next_product_id": null, - "coupon_use_count": 1, - "coupon_uses_allowed": 1, - "stored_credential_transaction_id": 166411599220288, - "on_hold_at": null, - "scheduled_cancellation_at": "2016-11-14T14:48:13-05:00" - } -} -``` - - -# Override Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 15236915, + "state": "active", + "balance_in_cents": 0, + "total_revenue_in_cents": 14000, + "product_price_in_cents": 1000, + "product_version_number": 7, + "current_period_ends_at": "2016-11-15T14:48:10-05:00", + "next_assessment_at": "2016-11-15T14:48:10-05:00", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2016-11-14T14:48:12-05:00", + "expires_at": null, + "created_at": "2016-11-14T14:48:10-05:00", + "updated_at": "2016-11-14T15:24:41-05:00", + "cancellation_message": null, + "cancellation_method": null, + "cancel_at_end_of_period": null, + "canceled_at": null, + "current_period_started_at": "2016-11-14T14:48:10-05:00", + "previous_state": "active", + "signup_payment_id": 162269766, + "signup_revenue": "260.00", + "delayed_cancel_at": null, + "coupon_code": "5SNN6HFK3GBH", + "payment_collection_method": "automatic", + "snap_day": null, + "reason_code": null, + "receives_invoice_emails": false, + "net_terms": 0, + "customer": { + "first_name": "Curtis", + "last_name": "Test", + "email": "curtis@example.com", + "cc_emails": "jeff@example.com", + "organization": "", + "reference": null, + "id": 14714298, + "created_at": "2016-11-14T14:48:10-05:00", + "updated_at": "2016-11-14T14:48:13-05:00", + "address": "123 Anywhere Street", + "address_2": "", + "city": "Boulder", + "state": "CO", + "zip": "80302", + "country": "US", + "phone": "", + "verified": false, + "portal_customer_created_at": "2016-11-14T14:48:13-05:00", + "portal_invite_last_sent_at": "2016-11-14T14:48:13-05:00", + "portal_invite_last_accepted_at": null, + "tax_exempt": false, + "vat_number": "012345678" + }, + "product": { + "id": 3792003, + "name": "$10 Basic Plan", + "handle": "basic", + "description": "lorem ipsum", + "accounting_code": "basic", + "price_in_cents": 1000, + "interval": 1, + "interval_unit": "day", + "initial_charge_in_cents": null, + "expiration_interval": null, + "expiration_interval_unit": "never", + "trial_price_in_cents": null, + "trial_interval": null, + "trial_interval_unit": "month", + "initial_charge_after_trial": false, + "return_params": "", + "request_credit_card": false, + "require_credit_card": false, + "created_at": "2016-03-24T13:38:39-04:00", + "updated_at": "2016-11-03T13:03:05-04:00", + "archived_at": null, + "update_return_url": "", + "update_return_params": "", + "product_family": { + "id": 527890, + "name": "Acme Projects", + "handle": "billing-plans", + "accounting_code": null, + "description": "" + }, + "public_signup_pages": [ + { + "id": 281054, + "url": "https://general-goods.chargify.com/subscribe/kqvmfrbgd89q/basic" + }, + { + "id": 281240, + "url": "https://general-goods.chargify.com/subscribe/dkffht5dxfd8/basic" + }, + { + "id": 282694, + "url": "https://general-goods.chargify.com/subscribe/jwffwgdd95s8/basic" + } + ], + "taxable": false, + "version_number": 7, + "product_price_point_name": "Default" + }, + "credit_card": { + "id": 10191713, + "payment_type": "credit_card", + "first_name": "Curtis", + "last_name": "Test", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 1, + "expiration_year": 2026, + "billing_address": "123 Anywhere Street", + "billing_address_2": "", + "billing_city": "Boulder", + "billing_state": null, + "billing_country": "", + "billing_zip": "80302", + "current_vault": "bogus", + "vault_token": "1", + "customer_vault_token": null, + "customer_id": 14714298 + }, + "payment_type": "credit_card", + "referral_code": "w7kjc9", + "next_product_id": null, + "coupon_use_count": 1, + "coupon_uses_allowed": 1, + "stored_credential_transaction_id": 166411599220288, + "on_hold_at": null, + "scheduled_cancellation_at": "2016-11-14T14:48:13-05:00" + } +} +``` + + +# Override Subscription + This API endpoint allows you to set certain subscription fields that are usually managed for you automatically. Some of the fields can be set via the normal Subscriptions Update API, but others can only be set using this endpoint. This endpoint is provided for cases where you need to “align” Chargify data with data that happened in your system, perhaps before you started using Chargify. For example, you may choose to import your historical subscription data, and would like the activation and cancellation dates in Chargify to match your existing historical dates. Chargify does not backfill historical events (i.e. from the Events API), but some static data can be changed via this API. @@ -1350,31 +1350,31 @@ When passing `current_period_starts_at` some validations are made: 2. The value passed must be a valid date/time. We recommend using the iso 8601 format. 3. The value passed must be before the current date/time. -If unpermitted parameters are sent, a 400 HTTP response is sent along with a string giving the reason for the problem. - -```go -OverrideSubscription( - ctx context.Context, - subscriptionId int, +If unpermitted parameters are sent, a 400 HTTP response is sent along with a string giving the reason for the problem. + +```go +OverrideSubscription( + ctx context.Context, + subscriptionId int, body *models.OverrideSubscriptionRequest) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.OverrideSubscriptionRequest`](../../doc/models/override-subscription-request.md) | Body, Optional | Only these fields are available to be set. | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.OverrideSubscriptionRequest`](../../doc/models/override-subscription-request.md) | Body, Optional | Only these fields are available to be set. | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1406,56 +1406,56 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | - - -# Read Subscription by Reference - -Use this endpoint to find a subscription by its reference. - -```go -ReadSubscriptionByReference( - ctx context.Context, +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SingleErrorResponseException`](../../doc/models/single-error-response-exception.md) | + + +# Find Subscription + +Use this endpoint to find a subscription by its reference. + +```go +FindSubscription( + ctx context.Context, reference *string) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `reference` | `*string` | Query, Optional | Subscription reference | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `reference` | `*string` | Query, Optional | Subscription reference | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() -apiResponse, err := subscriptionsController.ReadSubscriptionByReference(ctx, nil) +apiResponse, err := subscriptionsController.FindSubscription(ctx, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - - -# Purge Subscription - +} +``` + + +# Purge Subscription + For sites in test mode, you may purge individual subscriptions. 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` @@ -1464,33 +1464,33 @@ If you need to remove subscriptions from a live site, please contact support to ### Delete customer and payment profile -The query params will be: `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile` - -```go -PurgeSubscription( - ctx context.Context, - subscriptionId int, - ack int, +The query params will be: `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile` + +```go +PurgeSubscription( + ctx context.Context, + subscriptionId int, + ack int, cascade []models.SubscriptionPurgeType) ( http.Response, - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `ack` | `int` | Query, Required | id of the customer. | -| `cascade` | [`[]models.SubscriptionPurgeType`](../../doc/models/subscription-purge-type.md) | Query, Optional | Options are "customer" or "payment_profile".
Use in query: `cascade[]=customer&cascade[]=payment_profile`. | - -## Response Type - -`` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `ack` | `int` | Query, Required | id of the customer. | +| `cascade` | [`[]models.SubscriptionPurgeType`](../../doc/models/subscription-purge-type.md) | Query, Optional | Options are "customer" or "payment_profile".
Use in query: `cascade[]=customer&cascade[]=payment_profile`. | + +## Response Type + +`` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 ack := 252Liquid error: Value cannot be null. (Parameter 'key') @@ -1500,37 +1500,37 @@ if err != nil { log.Fatalln(err) } else { fmt.Println(resp.StatusCode) -} -``` - - -# Create Prepaid Subscription - -Use this endpoint to update a subscription's prepaid configuration. - -```go -CreatePrepaidSubscription( - ctx context.Context, - subscriptionId int, +} +``` + + +# Update Prepaid Subscription Configuration + +Use this endpoint to update a subscription's prepaid configuration. + +```go +UpdatePrepaidSubscriptionConfiguration( + ctx context.Context, + subscriptionId int, body *models.UpsertPrepaidConfigurationRequest) ( models.ApiResponse[models.PrepaidConfigurationResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.UpsertPrepaidConfigurationRequest`](../../doc/models/upsert-prepaid-configuration-request.md) | Body, Optional | - | - -## Response Type - -[`models.PrepaidConfigurationResponse`](../../doc/models/prepaid-configuration-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.UpsertPrepaidConfigurationRequest`](../../doc/models/upsert-prepaid-configuration-request.md) | Body, Optional | - | + +## Response Type + +[`models.PrepaidConfigurationResponse`](../../doc/models/prepaid-configuration-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1545,33 +1545,33 @@ body := models.UpsertPrepaidConfigurationRequest{ PrepaidConfiguration: bodyPrepaidConfiguration, } -apiResponse, err := subscriptionsController.CreatePrepaidSubscription(ctx, subscriptionId, &body) +apiResponse, err := subscriptionsController.UpdatePrepaidSubscriptionConfiguration(ctx, subscriptionId, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "prepaid_configuration": { - "id": 55, - "initial_funding_amount_in_cents": 2500, - "auto_replenish": true, - "replenish_to_amount_in_cents": 50000, - "replenish_threshold_amount_in_cents": 10000 - } -} -``` - - -# Preview Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "prepaid_configuration": { + "id": 55, + "initial_funding_amount_in_cents": 2500, + "auto_replenish": true, + "replenish_to_amount_in_cents": 50000, + "replenish_threshold_amount_in_cents": 10000 + } +} +``` + + +# Preview Subscription + The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For more information, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). @@ -1596,29 +1596,29 @@ You can pass shipping and billing addresses and still decide not to calculate ta ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax, please feel free to leave off the billing information. - -```go -PreviewSubscription( - ctx context.Context, +If you'd like to calculate subscriptions that do not include tax, please feel free to leave off the billing information. + +```go +PreviewSubscription( + ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionPreviewResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionPreviewResponse`](../../doc/models/subscription-preview-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionPreviewResponse`](../../doc/models/subscription-preview-response.md) + +## Example Usage + +```go ctx := context.Background() bodySubscription := models.CreateSubscription{ @@ -1636,165 +1636,165 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription_preview": { - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "charge", - "kind": "baseline", - "amount_in_cents": 5000, - "memo": "Gold Product (08/21/2018 - 09/21/2018)", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "product_id": 1, - "product_handle": "gold-product", - "product_name": "Gold Product", - "period_range_start": "13 Oct 2023", - "period_range_end": "13 Nov 2023" - }, - { - "transaction_type": "charge", - "kind": "component", - "amount_in_cents": 28000, - "memo": "Component name: 14 Unit names", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 462149, - "component_handle": "handle", - "component_name": "Component name" - }, - { - "transaction_type": "charge", - "kind": "component", - "amount_in_cents": 2000, - "memo": "Fractional Metered Components: 20.0 Fractional Metereds", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 426665, - "component_handle": "handle", - "component_name": "Fractional Metered Components" - }, - { - "transaction_type": "charge", - "kind": "component", - "amount_in_cents": 0, - "memo": "On/Off Component", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 426670, - "component_handle": "handle", - "component_name": "On/Off Component" - }, - { - "transaction_type": "adjustment", - "kind": "coupon", - "amount_in_cents": 0, - "memo": "Coupon: 1DOLLAR - You only get $1.00 off", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0 - } - ], - "total_in_cents": 35000, - "total_discount_in_cents": 0, - "total_tax_in_cents": 0, - "subtotal_in_cents": 35000, - "start_date": "2018-08-21T21:25:21Z", - "end_date": "2018-09-21T21:25:21Z", - "period_type": "recurring", - "existing_balance_in_cents": 0 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "charge", - "kind": "baseline", - "amount_in_cents": 5000, - "memo": "Gold Product (09/21/2018 - 10/21/2018)", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "product_id": 1, - "product_handle": "gold-product", - "product_name": "Gold Product" - }, - { - "transaction_type": "charge", - "kind": "component", - "amount_in_cents": 28000, - "memo": "Component name: 14 Unit names", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 462149, - "component_handle": "handle", - "component_name": "Component name" - }, - { - "transaction_type": "charge", - "kind": "component", - "amount_in_cents": 0, - "memo": "On/Off Component", - "discount_amount_in_cents": 0, - "taxable_amount_in_cents": 0, - "component_id": 426670, - "component_handle": "handle", - "component_name": "On/Off Component" - } - ], - "total_in_cents": 33000, - "total_discount_in_cents": 0, - "total_tax_in_cents": 0, - "subtotal_in_cents": 33000, - "start_date": "2018-09-21T21:25:21Z", - "end_date": "2018-10-21T21:25:21Z", - "period_type": "recurring", - "existing_balance_in_cents": 0 - } - } -} -``` - - -# Apply Coupon to Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription_preview": { + "current_billing_manifest": { + "line_items": [ + { + "transaction_type": "charge", + "kind": "baseline", + "amount_in_cents": 5000, + "memo": "Gold Product (08/21/2018 - 09/21/2018)", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "product_id": 1, + "product_handle": "gold-product", + "product_name": "Gold Product", + "period_range_start": "13 Oct 2023", + "period_range_end": "13 Nov 2023" + }, + { + "transaction_type": "charge", + "kind": "component", + "amount_in_cents": 28000, + "memo": "Component name: 14 Unit names", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 462149, + "component_handle": "handle", + "component_name": "Component name" + }, + { + "transaction_type": "charge", + "kind": "component", + "amount_in_cents": 2000, + "memo": "Fractional Metered Components: 20.0 Fractional Metereds", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 426665, + "component_handle": "handle", + "component_name": "Fractional Metered Components" + }, + { + "transaction_type": "charge", + "kind": "component", + "amount_in_cents": 0, + "memo": "On/Off Component", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 426670, + "component_handle": "handle", + "component_name": "On/Off Component" + }, + { + "transaction_type": "adjustment", + "kind": "coupon", + "amount_in_cents": 0, + "memo": "Coupon: 1DOLLAR - You only get $1.00 off", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0 + } + ], + "total_in_cents": 35000, + "total_discount_in_cents": 0, + "total_tax_in_cents": 0, + "subtotal_in_cents": 35000, + "start_date": "2018-08-21T21:25:21Z", + "end_date": "2018-09-21T21:25:21Z", + "period_type": "recurring", + "existing_balance_in_cents": 0 + }, + "next_billing_manifest": { + "line_items": [ + { + "transaction_type": "charge", + "kind": "baseline", + "amount_in_cents": 5000, + "memo": "Gold Product (09/21/2018 - 10/21/2018)", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "product_id": 1, + "product_handle": "gold-product", + "product_name": "Gold Product" + }, + { + "transaction_type": "charge", + "kind": "component", + "amount_in_cents": 28000, + "memo": "Component name: 14 Unit names", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 462149, + "component_handle": "handle", + "component_name": "Component name" + }, + { + "transaction_type": "charge", + "kind": "component", + "amount_in_cents": 0, + "memo": "On/Off Component", + "discount_amount_in_cents": 0, + "taxable_amount_in_cents": 0, + "component_id": 426670, + "component_handle": "handle", + "component_name": "On/Off Component" + } + ], + "total_in_cents": 33000, + "total_discount_in_cents": 0, + "total_tax_in_cents": 0, + "subtotal_in_cents": 33000, + "start_date": "2018-09-21T21:25:21Z", + "end_date": "2018-10-21T21:25:21Z", + "period_type": "recurring", + "existing_balance_in_cents": 0 + } + } +} +``` + + +# Apply Coupons to Subscription + An existing subscription can accommodate multiple discounts/coupon codes. This is only applicable if each coupon is stackable. For more information on stackable coupons, we recommend reviewing our [coupon documentation.](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#stackable-coupons) ## Query Parameters vs Request Body Parameters Passing in a coupon code as a query parameter will add the code to the subscription, completely replacing all existing coupon codes on the subscription. -For this reason, using this query parameter on this endpoint has been deprecated in favor of using the request body parameters as described below. When passing in request body parameters, the list of coupon codes will simply be added to any existing list of codes on the subscription. - -```go -ApplyCouponToSubscription( - ctx context.Context, - subscriptionId int, - code *string, +For this reason, using this query parameter on this endpoint has been deprecated in favor of using the request body parameters as described below. When passing in request body parameters, the list of coupon codes will simply be added to any existing list of codes on the subscription. + +```go +ApplyCouponsToSubscription( + ctx context.Context, + subscriptionId int, + code *string, body *models.AddCouponsRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `code` | `*string` | Query, Optional | A code for the coupon that would be applied to a subscription | -| `body` | [`*models.AddCouponsRequest`](../../doc/models/add-coupons-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `code` | `*string` | Query, Optional | A code for the coupon that would be applied to a subscription | +| `body` | [`*models.AddCouponsRequest`](../../doc/models/add-coupons-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -1802,230 +1802,230 @@ body := models.AddCouponsRequest{ Codes: []string{"COUPON_1", "COUPON_2"}, } -apiResponse, err := subscriptionsController.ApplyCouponToSubscription(ctx, subscriptionId, nil, &body) +apiResponse, err := subscriptionsController.ApplyCouponsToSubscription(ctx, subscriptionId, nil, &body) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "subscription": { - "id": 21607180, - "state": "active", - "trial_started_at": null, - "trial_ended_at": null, - "activated_at": "2018-04-20T14:20:57-05:00", - "created_at": "2018-04-20T14:20:57-05:00", - "updated_at": "2018-05-11T13:53:44-05:00", - "expires_at": null, - "balance_in_cents": 49000, - "current_period_ends_at": "2018-05-12T11:33:03-05:00", - "next_assessment_at": "2018-05-12T11:33:03-05:00", - "canceled_at": null, - "cancellation_message": null, - "next_product_id": null, - "cancel_at_end_of_period": false, - "payment_collection_method": "remittance", - "snap_day": null, - "cancellation_method": null, - "current_period_started_at": "2018-05-11T11:33:03-05:00", - "previous_state": "active", - "signup_payment_id": 237154761, - "signup_revenue": "0.00", - "delayed_cancel_at": null, - "coupon_code": "COUPONA", - "total_revenue_in_cents": 52762, - "product_price_in_cents": 100000, - "product_version_number": 2, - "payment_type": "credit_card", - "referral_code": "x45nc8", - "coupon_use_count": 0, - "coupon_uses_allowed": 1, - "reason_code": null, - "automatically_resume_at": null, - "coupon_codes": [ - "COUPONA", - "COUPONB" - ], - "customer": { - "id": 21259051, - "first_name": "K", - "last_name": "C", - "organization": "", - "email": "example@chargify.com", - "created_at": "2018-04-20T14:20:57-05:00", - "updated_at": "2018-04-23T15:29:28-05:00", - "reference": null, - "address": "", - "address_2": "", - "city": "", - "state": "", - "zip": "", - "country": "", - "phone": "", - "portal_invite_last_sent_at": "2018-04-20T14:20:59-05:00", - "portal_invite_last_accepted_at": null, - "verified": false, - "portal_customer_created_at": "2018-04-20T14:20:59-05:00", - "cc_emails": "", - "tax_exempt": false - }, - "product": { - "id": 4581816, - "name": "Basic", - "handle": "basic", - "description": "", - "accounting_code": "", - "request_credit_card": true, - "expiration_interval": null, - "expiration_interval_unit": "never", - "created_at": "2017-11-02T15:00:11-05:00", - "updated_at": "2018-04-10T09:02:59-05:00", - "price_in_cents": 100000, - "interval": 1, - "interval_unit": "month", - "initial_charge_in_cents": 100000, - "trial_price_in_cents": 1000, - "trial_interval": 10, - "trial_interval_unit": "month", - "archived_at": null, - "require_credit_card": true, - "return_params": "", - "taxable": false, - "update_return_url": "", - "tax_code": "", - "initial_charge_after_trial": false, - "version_number": 2, - "update_return_params": "", - "product_family": { - "id": 1025627, - "name": "My Product Family", - "description": "", - "handle": "acme-products", - "accounting_code": null - }, - "public_signup_pages": [ - { - "id": 333589, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargifypay.com/subscribe/hbwtd98j3hk2/basic" - }, - { - "id": 335926, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargifypay.com/subscribe/g366zy67c7rm/basic" - }, - { - "id": 345555, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargifypay.com/subscribe/txqyyqk7d8rz/basic" - }, - { - "id": 345556, - "return_url": "", - "return_params": "", - "url": "https://general-goods.chargifypay.com/subscribe/2zss3qpf4249/basic" - } - ] - }, - "credit_card": { - "id": 14839830, - "first_name": "John", - "last_name": "Doe", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2028, - "customer_id": 21259051, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": null, - "billing_city": null, - "billing_state": null, - "billing_zip": "99999", - "billing_country": null, - "customer_vault_token": null, - "billing_address_2": null, - "payment_type": "credit_card" - } - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionAddCouponErrorException`](../../doc/models/subscription-add-coupon-error-exception.md) | - - -# Delete Coupon From Subscription - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "subscription": { + "id": 21607180, + "state": "active", + "trial_started_at": null, + "trial_ended_at": null, + "activated_at": "2018-04-20T14:20:57-05:00", + "created_at": "2018-04-20T14:20:57-05:00", + "updated_at": "2018-05-11T13:53:44-05:00", + "expires_at": null, + "balance_in_cents": 49000, + "current_period_ends_at": "2018-05-12T11:33:03-05:00", + "next_assessment_at": "2018-05-12T11:33:03-05:00", + "canceled_at": null, + "cancellation_message": null, + "next_product_id": null, + "cancel_at_end_of_period": false, + "payment_collection_method": "remittance", + "snap_day": null, + "cancellation_method": null, + "current_period_started_at": "2018-05-11T11:33:03-05:00", + "previous_state": "active", + "signup_payment_id": 237154761, + "signup_revenue": "0.00", + "delayed_cancel_at": null, + "coupon_code": "COUPONA", + "total_revenue_in_cents": 52762, + "product_price_in_cents": 100000, + "product_version_number": 2, + "payment_type": "credit_card", + "referral_code": "x45nc8", + "coupon_use_count": 0, + "coupon_uses_allowed": 1, + "reason_code": null, + "automatically_resume_at": null, + "coupon_codes": [ + "COUPONA", + "COUPONB" + ], + "customer": { + "id": 21259051, + "first_name": "K", + "last_name": "C", + "organization": "", + "email": "example@chargify.com", + "created_at": "2018-04-20T14:20:57-05:00", + "updated_at": "2018-04-23T15:29:28-05:00", + "reference": null, + "address": "", + "address_2": "", + "city": "", + "state": "", + "zip": "", + "country": "", + "phone": "", + "portal_invite_last_sent_at": "2018-04-20T14:20:59-05:00", + "portal_invite_last_accepted_at": null, + "verified": false, + "portal_customer_created_at": "2018-04-20T14:20:59-05:00", + "cc_emails": "", + "tax_exempt": false + }, + "product": { + "id": 4581816, + "name": "Basic", + "handle": "basic", + "description": "", + "accounting_code": "", + "request_credit_card": true, + "expiration_interval": null, + "expiration_interval_unit": "never", + "created_at": "2017-11-02T15:00:11-05:00", + "updated_at": "2018-04-10T09:02:59-05:00", + "price_in_cents": 100000, + "interval": 1, + "interval_unit": "month", + "initial_charge_in_cents": 100000, + "trial_price_in_cents": 1000, + "trial_interval": 10, + "trial_interval_unit": "month", + "archived_at": null, + "require_credit_card": true, + "return_params": "", + "taxable": false, + "update_return_url": "", + "tax_code": "", + "initial_charge_after_trial": false, + "version_number": 2, + "update_return_params": "", + "product_family": { + "id": 1025627, + "name": "My Product Family", + "description": "", + "handle": "acme-products", + "accounting_code": null + }, + "public_signup_pages": [ + { + "id": 333589, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargifypay.com/subscribe/hbwtd98j3hk2/basic" + }, + { + "id": 335926, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargifypay.com/subscribe/g366zy67c7rm/basic" + }, + { + "id": 345555, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargifypay.com/subscribe/txqyyqk7d8rz/basic" + }, + { + "id": 345556, + "return_url": "", + "return_params": "", + "url": "https://general-goods.chargifypay.com/subscribe/2zss3qpf4249/basic" + } + ] + }, + "credit_card": { + "id": 14839830, + "first_name": "John", + "last_name": "Doe", + "masked_card_number": "XXXX-XXXX-XXXX-1", + "card_type": "bogus", + "expiration_month": 1, + "expiration_year": 2028, + "customer_id": 21259051, + "current_vault": "bogus", + "vault_token": "1", + "billing_address": null, + "billing_city": null, + "billing_state": null, + "billing_zip": "99999", + "billing_country": null, + "customer_vault_token": null, + "billing_address_2": null, + "payment_type": "credit_card" + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionAddCouponErrorException`](../../doc/models/subscription-add-coupon-error-exception.md) | + + +# Remove Coupon From Subscription + Use this endpoint to remove a coupon from an existing subscription. -For more information on the expected behaviour of removing a coupon from a subscription, please see our documentation [here.](https://chargify.zendesk.com/hc/en-us/articles/4407896488987#removing-a-coupon) - -```go -DeleteCouponFromSubscription( - ctx context.Context, - subscriptionId int, +For more information on the expected behaviour of removing a coupon from a subscription, please see our documentation [here.](https://chargify.zendesk.com/hc/en-us/articles/4407896488987#removing-a-coupon) + +```go +RemoveCouponFromSubscription( + ctx context.Context, + subscriptionId int, couponCode *string) ( models.ApiResponse[string], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `couponCode` | `*string` | Query, Optional | The coupon code | - -## Response Type - -`string` - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `couponCode` | `*string` | Query, Optional | The coupon code | + +## Response Type + +`string` + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 -apiResponse, err := subscriptionsController.DeleteCouponFromSubscription(ctx, subscriptionId, nil) +apiResponse, err := subscriptionsController.RemoveCouponFromSubscription(ctx, subscriptionId, nil) if err != nil { log.Fatalln(err) } else { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response - -``` -"Coupon successfully removed" -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionRemoveCouponErrorsException`](../../doc/models/subscription-remove-coupon-errors-exception.md) | - - -# Activate Subscription - +} +``` + +## Example Response + +``` +"Coupon successfully removed" +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`SubscriptionRemoveCouponErrorsException`](../../doc/models/subscription-remove-coupon-errors-exception.md) | + + +# Activate Subscription + Chargify offers the ability to activate 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](#). @@ -2068,31 +2068,31 @@ 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-chargify.zendesk.com/hc/en-us/articles/5404494617357#trialing-subscriptions-0-0). -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. - -```go -ActivateSubscription( - ctx context.Context, - subscriptionId int, +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. + +```go +ActivateSubscription( + ctx context.Context, + subscriptionId int, body *models.ActivateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `body` | [`*models.ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | - -## Response Type - -[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | +| `body` | [`*models.ActivateSubscriptionRequest`](../../doc/models/activate-subscription-request.md) | Body, Optional | - | + +## Response Type + +[`models.SubscriptionResponse`](../../doc/models/subscription-response.md) + +## Example Usage + +```go ctx := context.Background() subscriptionId := 222 @@ -2103,12 +2103,12 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 400 | Bad Request | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 080b24ed..aac561f8 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -1,25 +1,25 @@ -# Webhooks - -```go -webhooksController := client.WebhooksController() -``` - -## Class Name - -`WebhooksController` - -## Methods - +# Webhooks + +```go +webhooksController := client.WebhooksController() +``` + +## Class Name + +`WebhooksController` + +## Methods + * [List Webhooks](../../doc/controllers/webhooks.md#list-webhooks) * [Enable Webhooks](../../doc/controllers/webhooks.md#enable-webhooks) * [Replay Webhooks](../../doc/controllers/webhooks.md#replay-webhooks) * [Create Endpoint](../../doc/controllers/webhooks.md#create-endpoint) * [List Endpoints](../../doc/controllers/webhooks.md#list-endpoints) -* [Update Endpoint](../../doc/controllers/webhooks.md#update-endpoint) - - -# List Webhooks - +* [Update Endpoint](../../doc/controllers/webhooks.md#update-endpoint) + + +# List Webhooks + ## Webhooks Intro The Webhooks API allows you to view a list of all webhooks and to selectively resend individual or groups of webhooks. Webhooks will be sent on endpoints specified by you. Endpoints can be added via API or Web UI. There is also an option to enable / disable webhooks via API request. @@ -33,34 +33,34 @@ We recommend that you review Chargify's webhook documentation located in our hel ## List Webhooks for a Site -This method allows you to fetch data about webhooks. You can pass query parameters if you want to filter webhooks. - -```go -ListWebhooks( +This method allows you to fetch data about webhooks. You can pass query parameters if you want to filter webhooks. + +```go +ListWebhooks( ctx context.Context,input ListWebhooksInput) ( models.ApiResponse[[]models.WebhookResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `status` | [`*models.WebhookStatus`](../../doc/models/webhook-status.md) | Query, Optional | Webhooks with matching status would be returned. | -| `sinceDate` | `*string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified. | -| `untilDate` | `*string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one 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`. | -| `perPage` | `*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`. | -| `order` | [`*models.WebhookOrder`](../../doc/models/webhook-order.md) | Query, Optional | The order in which the Webhooks are returned. | -| `subscription` | `*int` | Query, Optional | The Chargify id of a subscription you'd like to filter for | - -## Response Type - -[`[]models.WebhookResponse`](../../doc/models/webhook-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`*models.WebhookStatus`](../../doc/models/webhook-status.md) | Query, Optional | Webhooks with matching status would be returned. | +| `sinceDate` | `*string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified. | +| `untilDate` | `*string` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one 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`. | +| `perPage` | `*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`. | +| `order` | [`*models.WebhookOrder`](../../doc/models/webhook-order.md) | Query, Optional | The order in which the Webhooks are returned. | +| `subscription` | `*int` | Query, Optional | The Chargify id of a subscription you'd like to filter for | + +## Response Type + +[`[]models.WebhookResponse`](../../doc/models/webhook-response.md) + +## Example Usage + +```go ctx := context.Background() page := 2 perPage := 50 @@ -72,74 +72,74 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "webhook": { - "event": "statement_settled", - "id": 141765032, - "created_at": "2016-11-08T16:22:26-05:00", - "last_error": "404 Resource Not Found (retry 5 of 5)", - "last_error_at": "2016-11-08T16:43:54-05:00", - "accepted_at": null, - "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", - "signature": "7c606ec4628ce75ec46e284097ce163a", - "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" - } - }, - { - "webhook": { - "event": "payment_success", - "id": 141765008, - "created_at": "2016-11-08T16:22:25-05:00", - "last_error": "404 Resource Not Found (retry 5 of 5)", - "last_error_at": "2016-11-08T16:43:54-05:00", - "accepted_at": null, - "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", - "signature": "fbcf2f6be579f9658cff90c4373e0ca2", - "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" - } - } -] -``` - - -# Enable Webhooks - -This method allows you to enable webhooks via API for your site - -```go -EnableWebhooks( - ctx context.Context, +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "webhook": { + "event": "statement_settled", + "id": 141765032, + "created_at": "2016-11-08T16:22:26-05:00", + "last_error": "404 Resource Not Found (retry 5 of 5)", + "last_error_at": "2016-11-08T16:43:54-05:00", + "accepted_at": null, + "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", + "signature": "7c606ec4628ce75ec46e284097ce163a", + "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" + } + }, + { + "webhook": { + "event": "payment_success", + "id": 141765008, + "created_at": "2016-11-08T16:22:25-05:00", + "last_error": "404 Resource Not Found (retry 5 of 5)", + "last_error_at": "2016-11-08T16:43:54-05:00", + "accepted_at": null, + "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", + "signature": "fbcf2f6be579f9658cff90c4373e0ca2", + "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" + } + } +] +``` + + +# Enable Webhooks + +This method allows you to enable webhooks via API for your site + +```go +EnableWebhooks( + ctx context.Context, body *models.EnableWebhooksRequest) ( models.ApiResponse[models.EnableWebhooksResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.EnableWebhooksRequest`](../../doc/models/enable-webhooks-request.md) | Body, Optional | - | - -## Response Type - -[`models.EnableWebhooksResponse`](../../doc/models/enable-webhooks-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.EnableWebhooksRequest`](../../doc/models/enable-webhooks-request.md) | Body, Optional | - | + +## Response Type + +[`models.EnableWebhooksResponse`](../../doc/models/enable-webhooks-response.md) + +## Example Usage + +```go ctx := context.Background() body := models.EnableWebhooksRequest{ @@ -153,45 +153,45 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "webhooks_enabled": true -} -``` - - -# Replay Webhooks - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "webhooks_enabled": true +} +``` + + +# Replay Webhooks + Posting to the replay endpoint does not immediately resend the webhooks. They are added to a queue and will be sent as soon as possible, depending on available system resources. -You may submit an array of up to 1000 webhook IDs to replay in the request. - -```go -ReplayWebhooks( - ctx context.Context, +You may submit an array of up to 1000 webhook IDs to replay in the request. + +```go +ReplayWebhooks( + ctx context.Context, body *models.ReplayWebhooksRequest) ( models.ApiResponse[models.ReplayWebhooksResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.ReplayWebhooksRequest`](../../doc/models/replay-webhooks-request.md) | Body, Optional | - | - -## Response Type - -[`models.ReplayWebhooksResponse`](../../doc/models/replay-webhooks-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.ReplayWebhooksRequest`](../../doc/models/replay-webhooks-request.md) | Body, Optional | - | + +## Response Type + +[`models.ReplayWebhooksResponse`](../../doc/models/replay-webhooks-response.md) + +## Example Usage + +```go ctx := context.Background() body := models.ReplayWebhooksRequest{ @@ -205,46 +205,46 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "status": "ok" -} -``` - - -# Create Endpoint - +} +``` + +## Example Response *(as JSON)* + +```json +{ + "status": "ok" +} +``` + + +# Create Endpoint + The Chargify API allows you to create an endpoint and assign a list of webhooks subscriptions (events) to it. You can check available events here. -[Event keys](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#example-payloads) - -```go -CreateEndpoint( - ctx context.Context, +[Event keys](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#example-payloads) + +```go +CreateEndpoint( + ctx context.Context, body *models.UpdateEndpointRequest) ( models.ApiResponse[models.EndpointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `body` | [`*models.UpdateEndpointRequest`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | - -## Response Type - -[`models.EndpointResponse`](../../doc/models/endpoint-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`*models.UpdateEndpointRequest`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | + +## Response Type + +[`models.EndpointResponse`](../../doc/models/endpoint-response.md) + +## Example Usage + +```go ctx := context.Background() bodyEndpoint := models.UpdateEndpoint{ @@ -263,51 +263,51 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -{ - "endpoint": { - "id": 1, - "url": "https://your.site/webhooks", - "site_id": 1, - "status": "enabled", - "webhook_subscriptions": [ - "payment_success", - "payment_failure" - ] - } -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - - -# List Endpoints - -This method returns created endpoints for site. - -```go -ListEndpoints( +} +``` + +## Example Response *(as JSON)* + +```json +{ + "endpoint": { + "id": 1, + "url": "https://your.site/webhooks", + "site_id": 1, + "status": "enabled", + "webhook_subscriptions": [ + "payment_success", + "payment_failure" + ] + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + +# List Endpoints + +This method returns created endpoints for site. + +```go +ListEndpoints( ctx context.Context) ( models.ApiResponse[[]models.Endpoint], - error) -``` - -## Response Type - -[`[]models.Endpoint`](../../doc/models/endpoint.md) - -## Example Usage - -```go + error) +``` + +## Response Type + +[`[]models.Endpoint`](../../doc/models/endpoint.md) + +## Example Usage + +```go ctx := context.Background() apiResponse, err := webhooksController.ListEndpoints(ctx) if err != nil { @@ -316,40 +316,40 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Example Response *(as JSON)* - -```json -[ - { - "id": 11, - "url": "https://foobar.com/webhooks", - "site_id": 1, - "status": "enabled", - "webhook_subscriptions": [ - "payment_success", - "payment_failure" - ] - }, - { - "id": 12, - "url": "https:/example.com/webhooks", - "site_id": 1, - "status": "enabled", - "webhook_subscriptions": [ - "payment_success", - "payment_failure", - "refund_failure" - ] - } -] -``` - - -# Update Endpoint - +} +``` + +## Example Response *(as JSON)* + +```json +[ + { + "id": 11, + "url": "https://foobar.com/webhooks", + "site_id": 1, + "status": "enabled", + "webhook_subscriptions": [ + "payment_success", + "payment_failure" + ] + }, + { + "id": 12, + "url": "https:/example.com/webhooks", + "site_id": 1, + "status": "enabled", + "webhook_subscriptions": [ + "payment_success", + "payment_failure", + "refund_failure" + ] + } +] +``` + + +# Update Endpoint + You can update an Endpoint via the API with a PUT request to the resource endpoint. You can change the `url` of your endpoint which consumes webhooks or list of `webhook_subscriptions`. @@ -358,31 +358,31 @@ Check available [Event keys](https://maxio-chargify.zendesk.com/hc/en-us/article Always send a complete list of events which you want subscribe/watch. Sending an PUT request for existing endpoint with empty list of `webhook_subscriptions` will end with unsubscribe from all events. -If you want unsubscribe from specific event, just send a list of `webhook_subscriptions` without the specific event key. - -```go -UpdateEndpoint( - ctx context.Context, - endpointId int, +If you want unsubscribe from specific event, just send a list of `webhook_subscriptions` without the specific event key. + +```go +UpdateEndpoint( + ctx context.Context, + endpointId int, body *models.UpdateEndpointRequest) ( models.ApiResponse[models.EndpointResponse], - error) -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `endpointId` | `int` | Template, Required | The Chargify id for the endpoint that should be updated | -| `body` | [`*models.UpdateEndpointRequest`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | - -## Response Type - -[`models.EndpointResponse`](../../doc/models/endpoint-response.md) - -## Example Usage - -```go + error) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `endpointId` | `int` | Template, Required | The Chargify id for the endpoint that should be updated | +| `body` | [`*models.UpdateEndpointRequest`](../../doc/models/update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | + +## Response Type + +[`models.EndpointResponse`](../../doc/models/endpoint-response.md) + +## Example Usage + +```go ctx := context.Background() endpointId := 42 @@ -402,13 +402,13 @@ if err != nil { // Printing the result and response fmt.Println(apiResponse.Data) fmt.Println(apiResponse.Response.StatusCode) -} -``` - -## Errors - -| HTTP Status Code | Error Description | Exception Class | -| --- | --- | --- | -| 404 | Not Found | `ApiError` | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | - +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + diff --git a/doc/http-configuration.md b/doc/http-configuration.md index cec2beb8..2a1c5bac 100644 --- a/doc/http-configuration.md +++ b/doc/http-configuration.md @@ -1,23 +1,23 @@ - -# HttpConfiguration - -The following parameters are configurable for the HttpConfiguration: - -## Properties - -| Name | Type | Description | -| --- | --- | --- | -| `timeout` | `float64` | Timeout in milliseconds.
*Default*: `30` | -| `transport` | `http.RoundTripper` | Establishes network connection and caches them for reuse.
*Default*: `http.DefaultTransport` | -| `retryConfiguration` | [`advancedbilling.RetryConfiguration`](retry-configuration.md) | Configurations to retry requests.
*Default*: `DefaultRetryConfiguration()` | - -The httpConfiguration can be initialized as follows: - + +# HttpConfiguration + +The following parameters are configurable for the HttpConfiguration: + +## Properties + +| Name | Type | Description | +| --- | --- | --- | +| `timeout` | `float64` | Timeout in milliseconds.
*Default*: `30` | +| `transport` | `http.RoundTripper` | Establishes network connection and caches them for reuse.
*Default*: `http.DefaultTransport` | +| `retryConfiguration` | [`advancedbilling.RetryConfiguration`](retry-configuration.md) | Configurations to retry requests.
*Default*: `DefaultRetryConfiguration()` | + +The httpConfiguration can be initialized as follows: + ```go httpConfiguration := CreateHttpConfiguration( advancedbilling.WithTimeout(30), advancedbilling.WithTransport(http.DefaultTransport), advancedbilling.WithRetryConfiguration(DefaultRetryConfiguration()), ) -``` - +``` + diff --git a/doc/models/account-balance.md b/doc/models/account-balance.md index b59fc7d5..40830491 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -1,21 +1,21 @@ - -# Account Balance - -## Structure - -`AccountBalance` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `BalanceInCents` | `*int64` | Optional | The balance in cents. | - -## Example (as JSON) - -```json -{ - "balance_in_cents": 16 -} -``` - + +# Account Balance + +## Structure + +`AccountBalance` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `BalanceInCents` | `*int64` | Optional | The balance in cents. | + +## Example (as JSON) + +```json +{ + "balance_in_cents": 16 +} +``` + diff --git a/doc/models/account-balances.md b/doc/models/account-balances.md index 42446bf7..3febc339 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -1,35 +1,35 @@ - -# Account Balances - -## Structure - -`AccountBalances` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `OpenInvoices` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | -| `PendingDiscounts` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | -| `ServiceCredits` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | -| `Prepayments` | [`*models.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 - }, - "pending_discounts": { - "balance_in_cents": 88 - }, - "service_credits": { - "balance_in_cents": 84 - }, - "prepayments": { - "balance_in_cents": 192 - } -} -``` - + +# Account Balances + +## Structure + +`AccountBalances` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `OpenInvoices` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | +| `PendingDiscounts` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | +| `ServiceCredits` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | +| `Prepayments` | [`*models.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 + }, + "pending_discounts": { + "balance_in_cents": 88 + }, + "service_credits": { + "balance_in_cents": 84 + }, + "prepayments": { + "balance_in_cents": 192 + } +} +``` + diff --git a/doc/models/ach-agreement.md b/doc/models/ach-agreement.md index 59f2b799..7b29d88b 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -1,29 +1,29 @@ - -# ACH Agreement - -(Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. - -## Structure - -`ACHAgreement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AgreementTerms` | `*string` | Optional | (Required when providing ACH agreement params) The ACH authorization agreement terms. | -| `AuthorizerFirstName` | `*string` | Optional | (Required when providing ACH agreement params) The first name of the person authorizing the ACH agreement. | -| `AuthorizerLastName` | `*string` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | -| `IpAddress` | `*string` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | - -## Example (as JSON) - -```json -{ - "agreement_terms": "agreement_terms4", - "authorizer_first_name": "authorizer_first_name2", - "authorizer_last_name": "authorizer_last_name2", - "ip_address": "ip_address2" -} -``` - + +# ACH Agreement + +(Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. + +## Structure + +`ACHAgreement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AgreementTerms` | `*string` | Optional | (Required when providing ACH agreement params) The ACH authorization agreement terms. | +| `AuthorizerFirstName` | `*string` | Optional | (Required when providing ACH agreement params) The first name of the person authorizing the ACH agreement. | +| `AuthorizerLastName` | `*string` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | +| `IpAddress` | `*string` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | + +## Example (as JSON) + +```json +{ + "agreement_terms": "agreement_terms4", + "authorizer_first_name": "authorizer_first_name2", + "authorizer_last_name": "authorizer_last_name2", + "ip_address": "ip_address2" +} +``` + diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index 6bf946f7..2bb74dbe 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -1,21 +1,21 @@ - -# Activate Subscription Request - -## Structure - -`ActivateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `RevertOnFailure` | `Optional[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`) | - -## Example (as JSON) - -```json -{ - "revert_on_failure": false -} -``` - + +# Activate Subscription Request + +## Structure + +`ActivateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `RevertOnFailure` | `Optional[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`) | + +## Example (as JSON) + +```json +{ + "revert_on_failure": false +} +``` + diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index e63e4a78..ccc59332 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -1,24 +1,24 @@ - -# Add Coupons Request - -## Structure - -`AddCouponsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Codes` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "codes": [ - "codes0", - "codes1" - ] -} -``` - + +# Add Coupons Request + +## Structure + +`AddCouponsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Codes` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "codes": [ + "codes0", + "codes1" + ] +} +``` + diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index ea7be555..7c632805 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -1,24 +1,24 @@ - -# Add Subscription to a Group - -## Structure - -`AddSubscriptionToAGroup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Group` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "group": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Add Subscription to a Group + +## Structure + +`AddSubscriptionToAGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Group` | `*interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "group": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/address-change.md b/doc/models/address-change.md new file mode 100644 index 00000000..45a27cd9 --- /dev/null +++ b/doc/models/address-change.md @@ -0,0 +1,35 @@ + +# Address Change + +## Structure + +`AddressChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Before` | [`models.InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | +| `After` | [`models.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" + } +} +``` + diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index f7826189..b3752aa2 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -1,32 +1,32 @@ - -# Agreement Acceptance - -Required when creating a subscription with Maxio Payments. - -## Structure - -`AgreementAcceptance` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `IpAddress` | `*string` | Optional | Required when providing agreement acceptance params. | -| `TermsUrl` | `*string` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | -| `PrivacyPolicyUrl` | `*string` | Optional | - | -| `ReturnRefundPolicyUrl` | `*string` | Optional | - | -| `DeliveryPolicyUrl` | `*string` | Optional | - | -| `SecureCheckoutPolicyUrl` | `*string` | Optional | - | - -## Example (as JSON) - -```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" -} -``` - + +# Agreement Acceptance + +Required when creating a subscription with Maxio Payments. + +## Structure + +`AgreementAcceptance` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `IpAddress` | `*string` | Optional | Required when providing agreement acceptance params. | +| `TermsUrl` | `*string` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | +| `PrivacyPolicyUrl` | `*string` | Optional | - | +| `ReturnRefundPolicyUrl` | `*string` | Optional | - | +| `DeliveryPolicyUrl` | `*string` | Optional | - | +| `SecureCheckoutPolicyUrl` | `*string` | Optional | - | + +## Example (as JSON) + +```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" +} +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index f4f336df..f2184255 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -1,50 +1,49 @@ - -# Allocate Components - -## Structure - -`AllocateComponents` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProrationUpgradeScheme` | `*string` | Optional | - | -| `ProrationDowngradeScheme` | `*string` | Optional | - | -| `Allocations` | [`[]models.CreateAllocation`](../../doc/models/create-allocation.md) | Optional | - | -| `AccrueCharge` | `*bool` | Optional | - | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PaymentCollectionMethod` | [`*models.PaymentCollectionMethod1`](../../doc/models/payment-collection-method-1.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription
**Default**: `"automatic"` | -| `InitiateDunning` | `*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 -{ - "payment_collection_method": "automatic", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "allocations": [ - { - "quantity": 26.48, - "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false - }, - { - "quantity": 26.48, - "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false - } - ], - "accrue_charge": false, - "upgrade_charge": "full" -} -``` - + +# Allocate Components + +## Structure + +`AllocateComponents` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProrationUpgradeScheme` | `*string` | Optional | - | +| `ProrationDowngradeScheme` | `*string` | Optional | - | +| `Allocations` | [`[]models.CreateAllocation`](../../doc/models/create-allocation.md) | Optional | - | +| `AccrueCharge` | `*bool` | Optional | - | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PaymentCollectionMethod` | [`*models.CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | +| `InitiateDunning` | `*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, + "component_id": 242, + "memo": "memo6", + "proration_downgrade_scheme": "proration_downgrade_scheme0", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "accrue_charge": false + }, + { + "quantity": 26.48, + "component_id": 242, + "memo": "memo6", + "proration_downgrade_scheme": "proration_downgrade_scheme0", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "accrue_charge": false + } + ], + "accrue_charge": false, + "upgrade_charge": "full" +} +``` + diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 3262da86..d7f0de6d 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -1,21 +1,21 @@ - -# Allocation Expiration Date - -## Structure - -`AllocationExpirationDate` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ExpiresAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "expires_at": "expires_at0" -} -``` - + +# Allocation Expiration Date + +## Structure + +`AllocationExpirationDate` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ExpiresAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "expires_at": "expires_at0" +} +``` + diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 2e124430..57ca4e0b 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -1,14 +1,14 @@ - -# Allocation Preview Direction - -## Enumeration - -`AllocationPreviewDirection` - -## Fields - -| Name | -| --- | -| `UPGRADE` | -| `DOWNGRADE` | - + +# Allocation Preview Direction + +## Enumeration + +`AllocationPreviewDirection` + +## Fields + +| Name | +| --- | +| `UPGRADE` | +| `DOWNGRADE` | + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 1bddb423..15828fba 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -1,48 +1,48 @@ - -# Allocation Preview Item - -## Structure - -`AllocationPreviewItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `Quantity` | `*interface{}` | Optional | - | -| `PreviousQuantity` | `*interface{}` | Optional | - | -| `Memo` | `Optional[string]` | Optional | - | -| `Timestamp` | `Optional[string]` | Optional | - | -| `ProrationUpgradeScheme` | `*string` | Optional | - | -| `ProrationDowngradeScheme` | `*string` | Optional | - | -| `AccrueCharge` | `*bool` | Optional | - | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePointId` | `*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. | -| `IntervalUnit` | [`*models.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. | -| `PreviousPricePointId` | `*int` | Optional | - | -| `PricePointHandle` | `*string` | Optional | - | -| `PricePointName` | `*string` | Optional | - | -| `ComponentHandle` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": { - "key1": "val1", - "key2": "val2" - }, - "previous_quantity": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo6" -} -``` - + +# Allocation Preview Item + +## Structure + +`AllocationPreviewItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `Quantity` | `*interface{}` | Optional | - | +| `PreviousQuantity` | `*interface{}` | Optional | - | +| `Memo` | `Optional[string]` | Optional | - | +| `Timestamp` | `Optional[string]` | Optional | - | +| `ProrationUpgradeScheme` | `*string` | Optional | - | +| `ProrationDowngradeScheme` | `*string` | Optional | - | +| `AccrueCharge` | `*bool` | Optional | - | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePointId` | `*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. | +| `IntervalUnit` | [`*models.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. | +| `PreviousPricePointId` | `*int` | Optional | - | +| `PricePointHandle` | `*string` | Optional | - | +| `PricePointName` | `*string` | Optional | - | +| `ComponentHandle` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "component_id": 54, + "subscription_id": 54, + "quantity": { + "key1": "val1", + "key2": "val2" + }, + "previous_quantity": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo6" +} +``` + diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md index da6c7110..608e758a 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -1,18 +1,18 @@ - -# Allocation Preview Line Item Kind - -A handle for the line item kind for allocation preview - -## Enumeration - -`AllocationPreviewLineItemKind` - -## Fields - -| Name | -| --- | -| `QUANTITYBASEDCOMPONENT` | -| `ONOFFCOMPONENT` | -| `COUPON` | -| `TAX` | - + +# Allocation Preview Line Item Kind + +A handle for the line item kind for allocation preview + +## Enumeration + +`AllocationPreviewLineItemKind` + +## Fields + +| Name | +| --- | +| `QUANTITYBASEDCOMPONENT` | +| `ONOFFCOMPONENT` | +| `COUPON` | +| `TAX` | + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 2f210c9e..cee46163 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -1,33 +1,33 @@ - -# Allocation Preview Line Item - -## Structure - -`AllocationPreviewLineItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | -| `Kind` | [`*models.AllocationPreviewLineItemKind`](../../doc/models/allocation-preview-line-item-kind.md) | Optional | A handle for the line item kind for allocation preview | -| `AmountInCents` | `*int64` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `DiscountAmountInCents` | `*int64` | Optional | - | -| `TaxableAmountInCents` | `*int64` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `ComponentHandle` | `*string` | Optional | - | -| `Direction` | [`*models.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 -} -``` - + +# Allocation Preview Line Item + +## Structure + +`AllocationPreviewLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `Kind` | [`*models.AllocationPreviewLineItemKind`](../../doc/models/allocation-preview-line-item-kind.md) | Optional | A handle for the line item kind for allocation preview | +| `AmountInCents` | `*int64` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `DiscountAmountInCents` | `*int64` | Optional | - | +| `TaxableAmountInCents` | `*int64` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `ComponentHandle` | `*string` | Optional | - | +| `Direction` | [`*models.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 +} +``` + diff --git a/doc/models/allocation-preview-response.md b/doc/models/allocation-preview-response.md index a81499e7..022d10f6 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -1,27 +1,27 @@ - -# Allocation Preview Response - -## Structure - -`AllocationPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AllocationPreview` | [`models.AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | - -## Example (as JSON) - -```json -{ - "allocation_preview": { - "start_date": "start_date0", - "end_date": "end_date6", - "subtotal_in_cents": 240, - "total_tax_in_cents": 108, - "total_discount_in_cents": 142 - } -} -``` - + +# Allocation Preview Response + +## Structure + +`AllocationPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AllocationPreview` | [`models.AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | + +## Example (as JSON) + +```json +{ + "allocation_preview": { + "start_date": "start_date0", + "end_date": "end_date6", + "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 9975a4ac..bebac8a9 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -1,37 +1,37 @@ - -# Allocation Preview - -## Structure - -`AllocationPreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `StartDate` | `*string` | Optional | - | -| `EndDate` | `*string` | Optional | - | -| `SubtotalInCents` | `*int64` | Optional | - | -| `TotalTaxInCents` | `*int64` | Optional | - | -| `TotalDiscountInCents` | `*int64` | Optional | - | -| `TotalInCents` | `*int64` | Optional | - | -| `Direction` | [`*models.AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | - | -| `ProrationScheme` | `*string` | Optional | - | -| `LineItems` | [`[]models.AllocationPreviewLineItem`](../../doc/models/allocation-preview-line-item.md) | Optional | - | -| `AccrueCharge` | `*bool` | Optional | - | -| `Allocations` | [`[]models.AllocationPreviewItem`](../../doc/models/allocation-preview-item.md) | Optional | - | -| `PeriodType` | `*string` | Optional | - | -| `ExistingBalanceInCents` | `*int64` | Optional | An integer representing the amount of the subscription's current balance | - -## Example (as JSON) - -```json -{ - "start_date": "start_date2", - "end_date": "end_date8", - "subtotal_in_cents": 4, - "total_tax_in_cents": 128, - "total_discount_in_cents": 122 -} -``` - + +# Allocation Preview + +## Structure + +`AllocationPreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `StartDate` | `*string` | Optional | - | +| `EndDate` | `*string` | Optional | - | +| `SubtotalInCents` | `*int64` | Optional | - | +| `TotalTaxInCents` | `*int64` | Optional | - | +| `TotalDiscountInCents` | `*int64` | Optional | - | +| `TotalInCents` | `*int64` | Optional | - | +| `Direction` | [`*models.AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | - | +| `ProrationScheme` | `*string` | Optional | - | +| `LineItems` | [`[]models.AllocationPreviewLineItem`](../../doc/models/allocation-preview-line-item.md) | Optional | - | +| `AccrueCharge` | `*bool` | Optional | - | +| `Allocations` | [`[]models.AllocationPreviewItem`](../../doc/models/allocation-preview-item.md) | Optional | - | +| `PeriodType` | `*string` | Optional | - | +| `ExistingBalanceInCents` | `*int64` | Optional | An integer representing the amount of the subscription's current balance | + +## Example (as JSON) + +```json +{ + "start_date": "start_date2", + "end_date": "end_date8", + "subtotal_in_cents": 4, + "total_tax_in_cents": 128, + "total_discount_in_cents": 122 +} +``` + diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index 120078d5..4cffa68a 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -1,30 +1,30 @@ - -# Allocation Response - -## Structure - -`AllocationResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Allocation` | [`*models.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": { - "key1": "val1", - "key2": "val2" - } - } -} -``` - + +# Allocation Response + +## Structure + +`AllocationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Allocation` | [`*models.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": { + "key1": "val1", + "key2": "val2" + } + } +} +``` + diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index 602995ea..4b00ed81 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -1,25 +1,25 @@ - -# Allocation Settings - -## Structure - -`AllocationSettings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `AccrueCharge` | `*string` | Optional | Either "true" or "false". | - -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} -``` - + +# Allocation Settings + +## Structure + +`AllocationSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `AccrueCharge` | `*string` | Optional | Either "true" or "false". | + +## Example (as JSON) + +```json +{ + "upgrade_charge": "none", + "downgrade_credit": "prorated", + "accrue_charge": "accrue_charge0" +} +``` + diff --git a/doc/models/allocation.md b/doc/models/allocation.md index 365e37ad..42a78021 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -1,49 +1,49 @@ - -# Allocation - -## Structure - -`Allocation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AllocationId` | `*int` | Optional | The allocation unique id | -| `ComponentId` | `*int` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | -| `ComponentHandle` | `Optional[string]` | Optional | The handle of the component. This references a component that you have created in your Product setup | -| `SubscriptionId` | `*int` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | -| `Quantity` | `*interface{}` | Optional | The allocated quantity set in to effect by the allocation. String for components supporting fractional quantities | -| `PreviousQuantity` | `*interface{}` | Optional | The allocated quantity that was in effect before this allocation was created. String for components supporting fractional quantities | -| `Memo` | `Optional[string]` | Optional | The memo passed when the allocation was created | -| `Timestamp` | `*time.Time` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | -| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this allocation was created | -| `ProrationUpgradeScheme` | `*string` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | -| `ProrationDowngradeScheme` | `*string` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | -| `PricePointId` | `*int` | Optional | - | -| `PricePointName` | `*string` | Optional | - | -| `PricePointHandle` | `*string` | 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. | -| `IntervalUnit` | [`*models.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. | -| `PreviousPricePointId` | `*int` | Optional | - | -| `AccrueCharge` | `*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. | -| `InitiateDunning` | `*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. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `Payment` | [`Optional[models.PaymentForAllocation]`](../../doc/models/payment-for-allocation.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Allocation + +## Structure + +`Allocation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AllocationId` | `*int` | Optional | The allocation unique id | +| `ComponentId` | `*int` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | +| `ComponentHandle` | `Optional[string]` | Optional | The handle of the component. This references a component that you have created in your Product setup | +| `SubscriptionId` | `*int` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | +| `Quantity` | `*interface{}` | Optional | The allocated quantity set in to effect by the allocation. String for components supporting fractional quantities | +| `PreviousQuantity` | `*interface{}` | Optional | The allocated quantity that was in effect before this allocation was created. String for components supporting fractional quantities | +| `Memo` | `Optional[string]` | Optional | The memo passed when the allocation was created | +| `Timestamp` | `*time.Time` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this allocation was created | +| `ProrationUpgradeScheme` | `*string` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | +| `ProrationDowngradeScheme` | `*string` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | +| `PricePointId` | `*int` | Optional | - | +| `PricePointName` | `*string` | Optional | - | +| `PricePointHandle` | `*string` | 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. | +| `IntervalUnit` | [`*models.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. | +| `PreviousPricePointId` | `*int` | Optional | - | +| `AccrueCharge` | `*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. | +| `InitiateDunning` | `*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. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `Payment` | [`Optional[models.PaymentForAllocation]`](../../doc/models/payment-for-allocation.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "allocation_id": 102, + "component_id": 144, + "component_handle": "component_handle0", + "subscription_id": 144, + "quantity": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/applied-credit-note-data.md b/doc/models/applied-credit-note-data.md index e16b48f8..5362fb18 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -1,23 +1,23 @@ - -# Applied Credit Note Data - -## Structure - -`AppliedCreditNoteData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | The UID of the credit note | -| `Number` | `*string` | Optional | The number of the credit note | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "number": "number0" -} -``` - + +# Applied Credit Note Data + +## Structure + +`AppliedCreditNoteData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | The UID of the credit note | +| `Number` | `*string` | Optional | The number of the credit note | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "number": "number0" +} +``` + diff --git a/doc/models/attribute-error.md b/doc/models/attribute-error.md index 0f9510f4..19b143d4 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -1,24 +1,24 @@ - -# Attribute Error - -## Structure - -`AttributeError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Attribute` | `[]string` | Required | - | - -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" - ] -} -``` - + +# Attribute Error + +## Structure + +`AttributeError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Attribute` | `[]string` | Required | - | + +## Example (as JSON) + +```json +{ + "attribute": [ + "attribute6", + "attribute7" + ] +} +``` + diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index c467ad11..639b1bf0 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -1,14 +1,14 @@ - -# Auto Invite - -## Enumeration - -`AutoInvite` - -## Fields - -| Name | Description | -| --- | --- | -| `NO` | Do not send the invitation email. | -| `YES` | Automatically send the invitation email. | - + +# Auto Invite + +## Enumeration + +`AutoInvite` + +## Fields + +| Name | Description | +| --- | --- | +| `NO` | Do not send the invitation email. | +| `YES` | Automatically send the invitation email. | + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index 1396455a..c1ef8f4e 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -1,21 +1,21 @@ - -# Auto Resume - -## Structure - -`AutoResume` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AutomaticallyResumeAt` | `Optional[time.Time]` | Optional | - | - -## Example (as JSON) - -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} -``` - + +# Auto Resume + +## Structure + +`AutoResume` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AutomaticallyResumeAt` | `Optional[time.Time]` | Optional | - | + +## Example (as JSON) + +```json +{ + "automatically_resume_at": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index c89e0445..ddd3423b 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -1,37 +1,36 @@ - -# Bank Account Attributes - -## Structure - -`BankAccountAttributes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyToken` | `*string` | Optional | - | -| `BankName` | `*string` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `BankRoutingNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `BankAccountNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | -| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking
**Default**: `"checking"` | -| `BankBranchCode` | `*string` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `BankIban` | `*string` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | -| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | **Default**: `"credit_card"` | -| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | -| `VaultToken` | `*string` | Optional | - | -| `CustomerVaultToken` | `*string` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | - -## Example (as JSON) - -```json -{ - "bank_account_type": "checking", - "payment_type": "credit_card", - "chargify_token": "chargify_token0", - "bank_name": "bank_name2", - "bank_routing_number": "bank_routing_number8", - "bank_account_number": "bank_account_number4" -} -``` - + +# Bank Account Attributes + +## Structure + +`BankAccountAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyToken` | `*string` | Optional | - | +| `BankName` | `*string` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | +| `BankRoutingNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `BankAccountNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | +| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | +| `BankBranchCode` | `*string` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `BankIban` | `*string` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | +| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | - | +| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | +| `VaultToken` | `*string` | Optional | - | +| `CustomerVaultToken` | `*string` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | + +## Example (as JSON) + +```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" +} +``` + diff --git a/doc/models/bank-account-holder-type.md b/doc/models/bank-account-holder-type.md index 129dc3bc..ebb220db 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -1,16 +1,16 @@ - -# Bank Account Holder Type - -Defaults to personal - -## Enumeration - -`BankAccountHolderType` - -## Fields - -| Name | -| --- | -| `PERSONAL` | -| `BUSINESS` | - + +# Bank Account Holder Type + +Defaults to personal + +## Enumeration + +`BankAccountHolderType` + +## Fields + +| Name | +| --- | +| `PERSONAL` | +| `BUSINESS` | + diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 8bfcf37c..161bfcce 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -1,51 +1,49 @@ - -# Bank Account Payment Profile - -## Structure - -`BankAccountPaymentProfile` - -## Fields - -| 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 | -| `FirstName` | `*string` | Optional | The first name of the bank account holder | -| `LastName` | `*string` | Optional | The last name of the bank account holder | -| `CustomerId` | `*int` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | -| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | -| `VaultToken` | `*string` | Optional | The “token” provided by your vault storage for an already stored payment profile | -| `BillingAddress` | `Optional[string]` | Optional | The current billing street address for the bank account | -| `BillingCity` | `Optional[string]` | Optional | The current billing address city for the bank account | -| `BillingState` | `Optional[string]` | Optional | The current billing address state for the bank account | -| `BillingZip` | `Optional[string]` | Optional | The current billing address zip code for the bank account | -| `BillingCountry` | `Optional[string]` | Optional | The current billing address country for the bank account | -| `CustomerVaultToken` | `Optional[string]` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | -| `BillingAddress2` | `Optional[string]` | Optional | The current billing street address, second line, for the bank account | -| `BankName` | `*string` | Optional | The bank where the account resides | -| `MaskedBankRoutingNumber` | `string` | Required | 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 | -| `MaskedBankAccountNumber` | `string` | Required | A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’) | -| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking
**Default**: `"checking"` | -| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | -| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | **Default**: `"credit_card"` | -| `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` | -| `SiteGatewaySettingId` | `*int` | Optional | - | -| `GatewayHandle` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "masked_bank_routing_number": "masked_bank_routing_number8", - "masked_bank_account_number": "masked_bank_account_number8", - "bank_account_type": "checking", - "payment_type": "credit_card", - "verified": false, - "id": 188, - "first_name": "first_name6", - "last_name": "last_name4", - "customer_id": 226, - "current_vault": "authorizenet" -} -``` - + +# Bank Account Payment Profile + +## Structure + +`BankAccountPaymentProfile` + +## Fields + +| 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 | +| `FirstName` | `*string` | Optional | The first name of the bank account holder | +| `LastName` | `*string` | Optional | The last name of the bank account holder | +| `CustomerId` | `*int` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | +| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | +| `VaultToken` | `*string` | Optional | The “token” provided by your vault storage for an already stored payment profile | +| `BillingAddress` | `Optional[string]` | Optional | The current billing street address for the bank account | +| `BillingCity` | `Optional[string]` | Optional | The current billing address city for the bank account | +| `BillingState` | `Optional[string]` | Optional | The current billing address state for the bank account | +| `BillingZip` | `Optional[string]` | Optional | The current billing address zip code for the bank account | +| `BillingCountry` | `Optional[string]` | Optional | The current billing address country for the bank account | +| `CustomerVaultToken` | `Optional[string]` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | +| `BillingAddress2` | `Optional[string]` | Optional | The current billing street address, second line, for the bank account | +| `BankName` | `*string` | Optional | The bank where the account resides | +| `MaskedBankRoutingNumber` | `string` | Required | 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 | +| `MaskedBankAccountNumber` | `string` | Required | A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’) | +| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | +| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | +| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | - | +| `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` | +| `SiteGatewaySettingId` | `*int` | Optional | - | +| `GatewayHandle` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "masked_bank_routing_number": "masked_bank_routing_number8", + "masked_bank_account_number": "masked_bank_account_number8", + "verified": false, + "id": 188, + "first_name": "first_name6", + "last_name": "last_name4", + "customer_id": 226, + "current_vault": "authorizenet" +} +``` + diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index 99af59a3..965d2818 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -1,32 +1,30 @@ - -# Bank Account Response - -## Structure - -`BankAccountResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfile` | [`models.BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "masked_bank_routing_number": "masked_bank_routing_number0", - "masked_bank_account_number": "masked_bank_account_number6", - "bank_account_type": "checking", - "payment_type": "credit_card", - "verified": false, - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "customer_id": 82, - "current_vault": "gocardless" - } -} -``` - + +# Bank Account Response + +## Structure + +`BankAccountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfile` | [`models.BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | + +## Example (as JSON) + +```json +{ + "payment_profile": { + "masked_bank_routing_number": "masked_bank_routing_number0", + "masked_bank_account_number": "masked_bank_account_number6", + "verified": false, + "id": 44, + "first_name": "first_name4", + "last_name": "last_name2", + "customer_id": 82, + "current_vault": "gocardless" + } +} +``` + diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md index 86a4b637..8bbb5ed2 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -1,16 +1,16 @@ - -# Bank Account Type - -Defaults to checking - -## Enumeration - -`BankAccountType` - -## Fields - -| Name | -| --- | -| `CHECKING` | -| `SAVINGS` | - + +# Bank Account Type + +Defaults to checking + +## Enumeration + +`BankAccountType` + +## Fields + +| Name | +| --- | +| `CHECKING` | +| `SAVINGS` | + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index bfbce7bf..f4b8850c 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -1,19 +1,19 @@ - -# Bank Account Vault - -The vault that stores the payment profile with the provided vault_token. - -## Enumeration - -`BankAccountVault` - -## Fields - -| Name | -| --- | -| `BOGUS` | -| `AUTHORIZENET` | -| `STRIPECONNECT` | -| `BRAINTREEBLUE` | -| `GOCARDLESS` | - + +# Bank Account Vault + +The vault that stores the payment profile with the provided vault_token. + +## Enumeration + +`BankAccountVault` + +## Fields + +| Name | +| --- | +| `BOGUS` | +| `AUTHORIZENET` | +| `STRIPECONNECT` | +| `BRAINTREEBLUE` | +| `GOCARDLESS` | + diff --git a/doc/models/bank-account-verification-request.md b/doc/models/bank-account-verification-request.md index 08a5646f..dfcbbf3b 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -1,24 +1,24 @@ - -# Bank Account Verification Request - -## Structure - -`BankAccountVerificationRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `BankAccountVerification` | [`models.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 - } -} -``` - + +# Bank Account Verification Request + +## Structure + +`BankAccountVerificationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `BankAccountVerification` | [`models.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 + } +} +``` + diff --git a/doc/models/bank-account-verification.md b/doc/models/bank-account-verification.md index 7e595ecd..ef670f78 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -1,23 +1,23 @@ - -# Bank Account Verification - -## Structure - -`BankAccountVerification` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Deposit1InCents` | `*int64` | Optional | - | -| `Deposit2InCents` | `*int64` | Optional | - | - -## Example (as JSON) - -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} -``` - + +# Bank Account Verification + +## Structure + +`BankAccountVerification` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Deposit1InCents` | `*int64` | Optional | - | +| `Deposit2InCents` | `*int64` | Optional | - | + +## Example (as JSON) + +```json +{ + "deposit_1_in_cents": 142, + "deposit_2_in_cents": 132 +} +``` + diff --git a/doc/models/base-refund-error.md b/doc/models/base-refund-error.md index 3416a4d3..a83468aa 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -1,34 +1,34 @@ - -# Base Refund Error - -## Structure - -`BaseRefundError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Base` | `[]interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] -} -``` - + +# Base Refund Error + +## Structure + +`BaseRefundError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Base` | `[]interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "base": [ + { + "key1": "val1", + "key2": "val2" + }, + { + "key1": "val1", + "key2": "val2" + }, + { + "key1": "val1", + "key2": "val2" + } + ] +} +``` + diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index bda3a9b7..eada7dcc 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -1,25 +1,25 @@ - -# Base String Error - -The error is base if it is not directly associated with a single attribute. - -## Structure - -`BaseStringError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Base` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "base": [ - "base3" - ] -} -``` - + +# Base String Error + +The error is base if it is not directly associated with a single attribute. + +## Structure + +`BaseStringError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Base` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "base": [ + "base3" + ] +} +``` + diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index 138377f1..38fc4f76 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -1,22 +1,22 @@ - -# Basic Date Field - -Allows to filter by `created_at` or `updated_at`. - -## Enumeration - -`BasicDateField` - -## Fields - -| Name | -| --- | -| `UPDATEDAT` | -| `CREATEDAT` | - -## Example - -``` -updated_at -``` - + +# Basic Date Field + +Allows to filter by `created_at` or `updated_at`. + +## Enumeration + +`BasicDateField` + +## Fields + +| Name | +| --- | +| `UPDATEDAT` | +| `CREATEDAT` | + +## Example + +``` +updated_at +``` + diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index d581dc0d..8883224c 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -1,27 +1,27 @@ - -# Batch Job Response - -## Structure - -`BatchJobResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Batchjob` | [`models.BatchJob`](../../doc/models/batch-job.md) | Required | - | - -## Example (as JSON) - -```json -{ - "batchjob": { - "id": 54, - "finished_at": "finished_at4", - "row_count": 62, - "created_at": "created_at0", - "completed": "completed4" - } -} -``` - + +# Batch Job Response + +## Structure + +`BatchJobResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Batchjob` | [`models.BatchJob`](../../doc/models/batch-job.md) | Required | - | + +## Example (as JSON) + +```json +{ + "batchjob": { + "id": 54, + "finished_at": "finished_at4", + "row_count": 62, + "created_at": "created_at0", + "completed": "completed4" + } +} +``` + diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index f979e35b..43217709 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -1,29 +1,29 @@ - -# Batch Job - -## Structure - -`BatchJob` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `FinishedAt` | `Optional[string]` | Optional | - | -| `RowCount` | `Optional[int]` | Optional | - | -| `CreatedAt` | `Optional[string]` | Optional | - | -| `Completed` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 246, - "finished_at": "finished_at0", - "row_count": 254, - "created_at": "created_at6", - "completed": "completed0" -} -``` - + +# Batch Job + +## Structure + +`BatchJob` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `FinishedAt` | `Optional[string]` | Optional | - | +| `RowCount` | `Optional[int]` | Optional | - | +| `CreatedAt` | `Optional[string]` | Optional | - | +| `Completed` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 246, + "finished_at": "finished_at0", + "row_count": 254, + "created_at": "created_at6", + "completed": "completed0" +} +``` + diff --git a/doc/models/billing-address.md b/doc/models/billing-address.md index 1cad2ed8..6200eec0 100644 --- a/doc/models/billing-address.md +++ b/doc/models/billing-address.md @@ -1,30 +1,30 @@ - -# Billing Address - -## Structure - -`BillingAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Street` | `Optional[string]` | Optional | - | -| `Line2` | `Optional[string]` | Optional | - | -| `City` | `Optional[string]` | Optional | - | -| `State` | `Optional[string]` | Optional | - | -| `Zip` | `Optional[string]` | Optional | - | -| `Country` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" -} -``` - + +# Billing Address + +## Structure + +`BillingAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Street` | `Optional[string]` | Optional | - | +| `Line2` | `Optional[string]` | Optional | - | +| `City` | `Optional[string]` | Optional | - | +| `State` | `Optional[string]` | Optional | - | +| `Zip` | `Optional[string]` | Optional | - | +| `Country` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "street": "street6", + "line2": "line20", + "city": "city6", + "state": "state2", + "zip": "zip0" +} +``` + diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 539bc03f..44db9885 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -1,38 +1,38 @@ - -# Billing Manifest Item - -## Structure - -`BillingManifestItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | -| `Kind` | [`*models.BillingManifestLineItemKind`](../../doc/models/billing-manifest-line-item-kind.md) | Optional | A handle for the billing manifest line item kind | -| `AmountInCents` | `*int64` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `DiscountAmountInCents` | `*int64` | Optional | - | -| `TaxableAmountInCents` | `*int64` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `ComponentHandle` | `*string` | Optional | - | -| `ComponentName` | `*string` | Optional | - | -| `ProductId` | `*int` | Optional | - | -| `ProductHandle` | `*string` | Optional | - | -| `ProductName` | `*string` | Optional | - | -| `PeriodRangeStart` | `*string` | Optional | - | -| `PeriodRangeEnd` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} -``` - + +# Billing Manifest Item + +## Structure + +`BillingManifestItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `Kind` | [`*models.BillingManifestLineItemKind`](../../doc/models/billing-manifest-line-item-kind.md) | Optional | A handle for the billing manifest line item kind | +| `AmountInCents` | `*int64` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `DiscountAmountInCents` | `*int64` | Optional | - | +| `TaxableAmountInCents` | `*int64` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `ComponentHandle` | `*string` | Optional | - | +| `ComponentName` | `*string` | Optional | - | +| `ProductId` | `*int` | Optional | - | +| `ProductHandle` | `*string` | Optional | - | +| `ProductName` | `*string` | Optional | - | +| `PeriodRangeStart` | `*string` | Optional | - | +| `PeriodRangeEnd` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "transaction_type": "info_transaction", + "kind": "baseline", + "amount_in_cents": 216, + "memo": "memo4", + "discount_amount_in_cents": 236 +} +``` + diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md index 1f99b4e3..270c00b8 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -1,20 +1,20 @@ - -# Billing Manifest Line Item Kind - -A handle for the billing manifest line item kind - -## Enumeration - -`BillingManifestLineItemKind` - -## Fields - -| Name | -| --- | -| `BASELINE` | -| `INITIAL` | -| `TRIAL` | -| `COUPON` | -| `COMPONENT` | -| `TAX` | - + +# Billing Manifest Line Item Kind + +A handle for the billing manifest line item kind + +## Enumeration + +`BillingManifestLineItemKind` + +## Fields + +| Name | +| --- | +| `BASELINE` | +| `INITIAL` | +| `TRIAL` | +| `COUPON` | +| `COMPONENT` | +| `TAX` | + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 02235794..5d5962f1 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -1,55 +1,55 @@ - -# Billing Manifest - -## Structure - -`BillingManifest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `LineItems` | [`[]models.BillingManifestItem`](../../doc/models/billing-manifest-item.md) | Optional | - | -| `TotalInCents` | `*int64` | Optional | - | -| `TotalDiscountInCents` | `*int64` | Optional | - | -| `TotalTaxInCents` | `*int64` | Optional | - | -| `SubtotalInCents` | `*int64` | Optional | - | -| `StartDate` | `*string` | Optional | - | -| `EndDate` | `*string` | Optional | - | -| `PeriodType` | `*string` | Optional | - | -| `ExistingBalanceInCents` | `*int64` | 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 -} -``` - + +# Billing Manifest + +## Structure + +`BillingManifest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `LineItems` | [`[]models.BillingManifestItem`](../../doc/models/billing-manifest-item.md) | Optional | - | +| `TotalInCents` | `*int64` | Optional | - | +| `TotalDiscountInCents` | `*int64` | Optional | - | +| `TotalTaxInCents` | `*int64` | Optional | - | +| `SubtotalInCents` | `*int64` | Optional | - | +| `StartDate` | `*string` | Optional | - | +| `EndDate` | `*string` | Optional | - | +| `PeriodType` | `*string` | Optional | - | +| `ExistingBalanceInCents` | `*int64` | 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 +} +``` + diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index 3baf55f0..40ba4091 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -1,23 +1,23 @@ - -# Billing Schedule - -This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled - -## Structure - -`BillingSchedule` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `InitialBillingAt` | `*time.Time` | Optional | The initial_billing_at attribute in Maxio allows you to specify a custom starting date for billing cycles associated with components that have their own billing frequency set. Only ISO8601 format is supported. | - -## Example (as JSON) - -```json -{ - "initial_billing_at": "2024-01-01" -} -``` - + +# Billing Schedule + +This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled + +## Structure + +`BillingSchedule` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `InitialBillingAt` | `*time.Time` | Optional | The initial_billing_at attribute in Maxio allows you to specify a custom starting date for billing cycles associated with components that have their own billing frequency set. Only ISO8601 format is supported. | + +## Example (as JSON) + +```json +{ + "initial_billing_at": "2024-01-01" +} +``` + diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index 5ff93445..fde46c3c 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -1,27 +1,27 @@ - -# Breakouts - -## Structure - -`Breakouts` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PlanAmountInCents` | `*int64` | Optional | - | -| `PlanAmountFormatted` | `*string` | Optional | - | -| `UsageAmountInCents` | `*int64` | Optional | - | -| `UsageAmountFormatted` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 68, - "plan_amount_formatted": "plan_amount_formatted2", - "usage_amount_in_cents": 176, - "usage_amount_formatted": "usage_amount_formatted0" -} -``` - + +# Breakouts + +## Structure + +`Breakouts` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PlanAmountInCents` | `*int64` | Optional | - | +| `PlanAmountFormatted` | `*string` | Optional | - | +| `UsageAmountInCents` | `*int64` | Optional | - | +| `UsageAmountFormatted` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "plan_amount_in_cents": 68, + "plan_amount_formatted": "plan_amount_formatted2", + "usage_amount_in_cents": 176, + "usage_amount_formatted": "usage_amount_formatted0" +} +``` + diff --git a/doc/models/bulk-component-s-price-point-assignment.md b/doc/models/bulk-component-s-price-point-assignment.md index 53f7e5a5..3df65cc3 100644 --- a/doc/models/bulk-component-s-price-point-assignment.md +++ b/doc/models/bulk-component-s-price-point-assignment.md @@ -1,29 +1,29 @@ - -# Bulk Component S Price Point Assignment - -## Structure - -`BulkComponentSPricePointAssignment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Components` | [`[]models.ComponentSPricePointAssignment`](../../doc/models/component-s-price-point-assignment.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": 108, - "price_point": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Bulk Component S Price Point Assignment + +## Structure + +`BulkComponentSPricePointAssignment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Components` | [`[]models.ComponentSPricePointAssignment`](../../doc/models/component-s-price-point-assignment.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "components": [ + { + "component_id": 108, + "price_point": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index b76c2527..3ade444b 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -1,34 +1,34 @@ - -# Bulk Create Product Price Points Request - -## Structure - -`BulkCreateProductPricePointsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.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": "trial_type6" - } - ] -} -``` - + +# Bulk Create Product Price Points Request + +## Structure + +`BulkCreateProductPricePointsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.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": "trial_type6" + } + ] +} +``` + diff --git a/doc/models/bulk-create-product-price-points-response.md b/doc/models/bulk-create-product-price-points-response.md index a23ba4dd..83f8a618 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -1,29 +1,29 @@ - -# Bulk Create Product Price Points Response - -## Structure - -`BulkCreateProductPricePointsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.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 - } - ] -} -``` - + +# Bulk Create Product Price Points Response + +## Structure + +`BulkCreateProductPricePointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/bulk-create-segments.md b/doc/models/bulk-create-segments.md index 81907811..f95732d3 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -1,67 +1,67 @@ - -# Bulk Create Segments - -## Structure - -`BulkCreateSegments` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segments` | [`[]models.CreateSegment`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | - -## Example (as JSON) - -```json -{ - "segments": [ - { - "segment_property_1_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_2_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_3_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_4_value": { - "key1": "val1", - "key2": "val2" - }, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } - ] -} -``` - + +# Bulk Create Segments + +## Structure + +`BulkCreateSegments` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segments` | [`[]models.CreateSegment`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | + +## Example (as JSON) + +```json +{ + "segments": [ + { + "segment_property_1_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_2_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_3_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_4_value": { + "key1": "val1", + "key2": "val2" + }, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } + ] +} +``` + diff --git a/doc/models/bulk-update-segments-item.md b/doc/models/bulk-update-segments-item.md index 177513b7..d33895be 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -1,34 +1,34 @@ - -# Bulk Update Segments Item - -## Structure - -`BulkUpdateSegmentsItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `int` | Required | The ID of the segment you want to update. | -| `PricingScheme` | [`models.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` | [`[]models.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": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Bulk Update Segments Item + +## Structure + +`BulkUpdateSegmentsItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `int` | Required | The ID of the segment you want to update. | +| `PricingScheme` | [`models.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` | [`[]models.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": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/bulk-update-segments.md b/doc/models/bulk-update-segments.md index 3cb51ee1..85ecc5c8 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -1,82 +1,82 @@ - -# Bulk Update Segments - -## Structure - -`BulkUpdateSegments` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segments` | [`[]models.BulkUpdateSegmentsItem`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | - -## Example (as JSON) - -```json -{ - "segments": [ - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - }, - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } - ] -} -``` - + +# Bulk Update Segments + +## Structure + +`BulkUpdateSegments` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segments` | [`[]models.BulkUpdateSegmentsItem`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | + +## Example (as JSON) + +```json +{ + "segments": [ + { + "id": 50, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + }, + { + "id": 50, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } + ] +} +``` + diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 39209619..2f8a9497 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -1,28 +1,28 @@ - -# Calendar Billing - -(Optional). Cannot be used when also specifying next_billing_at - -## Structure - -`CalendarBilling` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SnapDay` | `*interface{}` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | -| `CalendarBillingFirstCharge` | [`*models.FirstChargeType`](../../doc/models/first-charge-type.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "snap_day": { - "key1": "val1", - "key2": "val2" - }, - "calendar_billing_first_charge": "prorated" -} -``` - + +# Calendar Billing + +(Optional). Cannot be used when also specifying next_billing_at + +## Structure + +`CalendarBilling` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SnapDay` | `*interface{}` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | +| `CalendarBillingFirstCharge` | [`*models.FirstChargeType`](../../doc/models/first-charge-type.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "snap_day": { + "key1": "val1", + "key2": "val2" + }, + "calendar_billing_first_charge": "prorated" +} +``` + diff --git a/doc/models/cancel-grouped-subscriptions-request.md b/doc/models/cancel-grouped-subscriptions-request.md index ac2c871f..3e7ea341 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -1,21 +1,21 @@ - -# Cancel Grouped Subscriptions Request - -## Structure - -`CancelGroupedSubscriptionsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargeUnbilledUsage` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "charge_unbilled_usage": false -} -``` - + +# Cancel Grouped Subscriptions Request + +## Structure + +`CancelGroupedSubscriptionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargeUnbilledUsage` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "charge_unbilled_usage": false +} +``` + diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index a2ba3621..62bfc38f 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -1,19 +1,19 @@ - -# Cancellation Method - -The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. - -## Enumeration - -`CancellationMethod` - -## Fields - -| Name | -| --- | -| `MERCHANTUI` | -| `MERCHANTAPI` | -| `DUNNING` | -| `BILLINGPORTAL` | -| `UNKNOWN` | - + +# Cancellation Method + +The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. + +## Enumeration + +`CancellationMethod` + +## Fields + +| Name | +| --- | +| `MERCHANTUI` | +| `MERCHANTAPI` | +| `DUNNING` | +| `BILLINGPORTAL` | +| `UNKNOWN` | + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index abd5ef25..162c0791 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -1,23 +1,23 @@ - -# Cancellation Options - -## Structure - -`CancellationOptions` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CancellationMessage` | `*string` | Optional | For your internal use. An indication as to why the subscription is being canceled. | -| `ReasonCode` | `*string` | Optional | The reason code associated with the cancellation. See the list of reason codes associated with your site. | - -## Example (as JSON) - -```json -{ - "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6" -} -``` - + +# Cancellation Options + +## Structure + +`CancellationOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CancellationMessage` | `*string` | Optional | For your internal use. An indication as to why the subscription is being canceled. | +| `ReasonCode` | `*string` | Optional | The reason code associated with the cancellation. See the list of reason codes associated with your site. | + +## Example (as JSON) + +```json +{ + "cancellation_message": "cancellation_message0", + "reason_code": "reason_code6" +} +``` + diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index dc0627a4..c48c77f2 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -1,24 +1,24 @@ - -# Cancellation Request - -## Structure - -`CancellationRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`models.CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription": { - "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8" - } -} -``` - + +# Cancellation Request + +## Structure + +`CancellationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`models.CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription": { + "cancellation_message": "cancellation_message2", + "reason_code": "reason_code8" + } +} +``` + diff --git a/doc/models/card-type.md b/doc/models/card-type.md index 2929f9b0..4ae44cca 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -1,50 +1,50 @@ - -# Card Type - -The type of card used. - -## Enumeration - -`CardType` - -## Fields - -| Name | -| --- | -| `VISA` | -| `MASTER` | -| `ELO` | -| `CABAL` | -| `ALELO` | -| `DISCOVER` | -| `AMERICANEXPRESS` | -| `NARANJA` | -| `DINERSCLUB` | -| `JCB` | -| `DANKORT` | -| `MAESTRO` | -| `MAESTRONOLUHN` | -| `FORBRUGSFORENINGEN` | -| `SODEXO` | -| `ALIA` | -| `VR` | -| `UNIONPAY` | -| `CARNET` | -| `CARTESBANCAIRES` | -| `OLIMPICA` | -| `CREDITEL` | -| `CONFIABLE` | -| `SYNCHRONY` | -| `ROUTEX` | -| `MADA` | -| `BPPLUS` | -| `PASSCARD` | -| `EDENRED` | -| `ANDA` | -| `TARJETAD` | -| `HIPERCARD` | -| `BOGUS` | -| `ENUMSWITCH` | -| `SOLO` | -| `LASER` | - + +# Card Type + +The type of card used. + +## Enumeration + +`CardType` + +## Fields + +| Name | +| --- | +| `VISA` | +| `MASTER` | +| `ELO` | +| `CABAL` | +| `ALELO` | +| `DISCOVER` | +| `AMERICANEXPRESS` | +| `NARANJA` | +| `DINERSCLUB` | +| `JCB` | +| `DANKORT` | +| `MAESTRO` | +| `MAESTRONOLUHN` | +| `FORBRUGSFORENINGEN` | +| `SODEXO` | +| `ALIA` | +| `VR` | +| `UNIONPAY` | +| `CARNET` | +| `CARTESBANCAIRES` | +| `OLIMPICA` | +| `CREDITEL` | +| `CONFIABLE` | +| `SYNCHRONY` | +| `ROUTEX` | +| `MADA` | +| `BPPLUS` | +| `PASSCARD` | +| `EDENRED` | +| `ANDA` | +| `TARJETAD` | +| `HIPERCARD` | +| `BOGUS` | +| `ENUMSWITCH` | +| `SOLO` | +| `LASER` | + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 1d449368..87e35789 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -1,30 +1,30 @@ - -# Chargify EBB - -## Structure - -`ChargifyEBB` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Timestamp` | `*string` | Optional | This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add `chargify.timestamp` to the event payload and set the value to `now`. | -| `Id` | `*string` | Optional | A unique ID set by Chargify. Please note that this field is reserved. If `chargify.id` is present in the request payload, it will be overwritten. | -| `CreatedAt` | `*string` | Optional | An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If `chargify.created_at` is present in the request payload, it will be overwritten. | -| `UniquenessToken` | `*string` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
**Constraints**: *Maximum Length*: `64` | -| `SubscriptionId` | `*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. | -| `SubscriptionReference` | `*string` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | - -## Example (as JSON) - -```json -{ - "timestamp": "timestamp8", - "id": "id4", - "created_at": "created_at8", - "uniqueness_token": "uniqueness_token0", - "subscription_id": 200 -} -``` - + +# Chargify EBB + +## Structure + +`ChargifyEBB` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Timestamp` | `*string` | Optional | This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add `chargify.timestamp` to the event payload and set the value to `now`. | +| `Id` | `*string` | Optional | A unique ID set by Chargify. Please note that this field is reserved. If `chargify.id` is present in the request payload, it will be overwritten. | +| `CreatedAt` | `*string` | Optional | An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If `chargify.created_at` is present in the request payload, it will be overwritten. | +| `UniquenessToken` | `*string` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
**Constraints**: *Maximum Length*: `64` | +| `SubscriptionId` | `*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. | +| `SubscriptionReference` | `*string` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | + +## Example (as JSON) + +```json +{ + "timestamp": "timestamp8", + "id": "id4", + "created_at": "created_at8", + "uniqueness_token": "uniqueness_token0", + "subscription_id": 200 +} +``` + diff --git a/doc/models/cleanup-scope.md b/doc/models/cleanup-scope.md index 234cc07c..7f8b82e4 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -1,16 +1,16 @@ - -# Cleanup Scope - -all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0. - -## Enumeration - -`CleanupScope` - -## Fields - -| Name | -| --- | -| `ALL` | -| `CUSTOMERS` | - + +# Cleanup Scope + +all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0. + +## Enumeration + +`CleanupScope` + +## Fields + +| Name | +| --- | +| `ALL` | +| `CUSTOMERS` | + diff --git a/doc/models/payment-collection-method.md b/doc/models/collection-method.md similarity index 86% rename from doc/models/payment-collection-method.md rename to doc/models/collection-method.md index 095a136c..70d2ed2d 100644 --- a/doc/models/payment-collection-method.md +++ b/doc/models/collection-method.md @@ -1,18 +1,18 @@ - -# Payment Collection Method - -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`. - -## Enumeration - -`PaymentCollectionMethod` - -## Fields - -| Name | -| --- | -| `AUTOMATIC` | -| `REMITTANCE` | -| `PREPAID` | -| `INVOICE` | - + +# Collection Method + +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`. + +## Enumeration + +`CollectionMethod` + +## Fields + +| Name | +| --- | +| `AUTOMATIC` | +| `REMITTANCE` | +| `PREPAID` | +| `INVOICE` | + diff --git a/doc/models/component-allocation-error-exception.md b/doc/models/component-allocation-error-exception.md index 61157d85..ad3102d8 100644 --- a/doc/models/component-allocation-error-exception.md +++ b/doc/models/component-allocation-error-exception.md @@ -1,40 +1,40 @@ - -# Component Allocation Error Exception - -## Structure - -`ComponentAllocationErrorException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`[]models.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" - } - ] -} -``` - + +# Component Allocation Error Exception + +## Structure + +`ComponentAllocationErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index 8d59142f..0de5b681 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -1,27 +1,27 @@ - -# Component Allocation Error Item - -## Structure - -`ComponentAllocationErrorItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `Message` | `*string` | Optional | - | -| `Kind` | `*string` | Optional | - | -| `On` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} -``` - + +# Component Allocation Error Item + +## Structure + +`ComponentAllocationErrorItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `Message` | `*string` | Optional | - | +| `Kind` | `*string` | Optional | - | +| `On` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "component_id": 188, + "message": "message0", + "kind": "kind8", + "on": "on0" +} +``` + diff --git a/doc/models/component-cost-data-rate-tier.md b/doc/models/component-cost-data-rate-tier.md index 066f0c60..5e836a4f 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -1,29 +1,29 @@ - -# Component Cost Data Rate Tier - -## Structure - -`ComponentCostDataRateTier` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `StartingQuantity` | `*int` | Optional | - | -| `EndingQuantity` | `Optional[int]` | Optional | - | -| `Quantity` | `*string` | Optional | - | -| `UnitPrice` | `*string` | Optional | - | -| `Amount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} -``` - + +# Component Cost Data Rate Tier + +## Structure + +`ComponentCostDataRateTier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `StartingQuantity` | `*int` | Optional | - | +| `EndingQuantity` | `Optional[int]` | Optional | - | +| `Quantity` | `*string` | Optional | - | +| `UnitPrice` | `*string` | Optional | - | +| `Amount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "starting_quantity": 132, + "ending_quantity": 106, + "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 c0f21432..9cfdc1ed 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -1,31 +1,31 @@ - -# Component Cost Data - -## Structure - -`ComponentCostData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentCodeId` | `Optional[int]` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `ProductId` | `*int` | Optional | - | -| `Quantity` | `*string` | Optional | - | -| `Amount` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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` | [`[]models.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" -} -``` - + +# Component Cost Data + +## Structure + +`ComponentCostData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentCodeId` | `Optional[int]` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `ProductId` | `*int` | Optional | - | +| `Quantity` | `*string` | Optional | - | +| `Amount` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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` | [`[]models.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" +} +``` + diff --git a/doc/models/component-currency-price.md b/doc/models/component-currency-price.md index 8f9c31e0..5af54000 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -1,30 +1,30 @@ - -# Component Currency Price - -## Structure - -`ComponentCurrencyPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `Price` | `*string` | Optional | - | -| `FormattedPrice` | `*string` | Optional | - | -| `PriceId` | `*int` | Optional | - | -| `PricePointId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} -``` - + +# Component Currency Price + +## Structure + +`ComponentCurrencyPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `Price` | `*string` | Optional | - | +| `FormattedPrice` | `*string` | Optional | - | +| `PriceId` | `*int` | Optional | - | +| `PricePointId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 4, + "currency": "currency8", + "price": "price4", + "formatted_price": "formatted_price6", + "price_id": 162 +} +``` + diff --git a/doc/models/component-currency-prices-response.md b/doc/models/component-currency-prices-response.md index 76a75b76..710c0b80 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -1,29 +1,29 @@ - -# Component Currency Prices Response - -## Structure - -`ComponentCurrencyPricesResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.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 - } - ] -} -``` - + +# Component Currency Prices Response + +## Structure + +`ComponentCurrencyPricesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index df36bef5..e980d0de 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -1,44 +1,44 @@ - -# Component Custom Price - -Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. - -## Structure - -`ComponentCustomPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricingScheme` | [`*models.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. | -| `IntervalUnit` | [`*models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | On/off components only need one price bracket starting at 1 | - -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Component Custom Price + +Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. + +## Structure + +`ComponentCustomPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricingScheme` | [`*models.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. | +| `IntervalUnit` | [`*models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | On/off components only need one price bracket starting at 1 | + +## Example (as JSON) + +```json +{ + "pricing_scheme": "stairstep", + "interval": 162, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/component-kind.md b/doc/models/component-kind.md index 86d46440..5b9e610a 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -1,19 +1,19 @@ - -# Component Kind - -A handle for the component type - -## Enumeration - -`ComponentKind` - -## Fields - -| Name | -| --- | -| `METEREDCOMPONENT` | -| `QUANTITYBASEDCOMPONENT` | -| `ONOFFCOMPONENT` | -| `PREPAIDUSAGECOMPONENT` | -| `EVENTBASEDCOMPONENT` | - + +# Component Kind + +A handle for the component type + +## Enumeration + +`ComponentKind` + +## Fields + +| Name | +| --- | +| `METEREDCOMPONENT` | +| `QUANTITYBASEDCOMPONENT` | +| `ONOFFCOMPONENT` | +| `PREPAIDUSAGECOMPONENT` | +| `EVENTBASEDCOMPONENT` | + diff --git a/doc/models/component-price-point-error-exception.md b/doc/models/component-price-point-error-exception.md index 8fe4e1d9..9fea35e8 100644 --- a/doc/models/component-price-point-error-exception.md +++ b/doc/models/component-price-point-error-exception.md @@ -1,32 +1,32 @@ - -# Component Price Point Error Exception - -## Structure - -`ComponentPricePointErrorException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`[]models.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 - } - ] -} -``` - + +# Component Price Point Error Exception + +## Structure + +`ComponentPricePointErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index 68ccee55..ba86d5ab 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -1,25 +1,25 @@ - -# Component Price Point Error Item - -## Structure - -`ComponentPricePointErrorItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `Message` | `*string` | Optional | - | -| `PricePoint` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} -``` - + +# Component Price Point Error Item + +## Structure + +`ComponentPricePointErrorItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `Message` | `*string` | Optional | - | +| `PricePoint` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "component_id": 206, + "message": "message4", + "price_point": 152 +} +``` + diff --git a/doc/models/component-price-point-item.md b/doc/models/component-price-point-item.md index fbee7dc3..009589ba 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -1,30 +1,30 @@ - -# Component Price Point Item - -## Structure - -`ComponentPricePointItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `IntervalUnit` | [`*models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} -``` - + +# Component Price Point Item + +## Structure + +`ComponentPricePointItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `IntervalUnit` | [`*models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name6", + "handle": "handle2", + "pricing_scheme": "per_unit", + "interval": 196, + "interval_unit": "day" +} +``` + diff --git a/doc/models/component-price-point-response.md b/doc/models/component-price-point-response.md index cbd9ed53..3e367fe6 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -1,28 +1,27 @@ - -# Component Price Point Response - -## Structure - -`ComponentPricePointResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`models.ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | - -## Example (as JSON) - -```json -{ - "price_point": { - "use_site_exchange_rate": true, - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} -``` - + +# Component Price Point Response + +## Structure + +`ComponentPricePointResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`models.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" + } +} +``` + diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index 9155aa83..8a2b5889 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -1,42 +1,41 @@ - -# Component Price Point - -## Structure - -`ComponentPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Type` | [`*models.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 | -| `Name` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `ComponentId` | `*int` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `ArchivedAt` | `Optional[time.Time]` | Optional | - | -| `CreatedAt` | `*time.Time` | Optional | - | -| `UpdatedAt` | `*time.Time` | Optional | - | -| `Prices` | [`[]models.ComponentPrice`](../../doc/models/component-price.md) | Optional | - | -| `UseSiteExchangeRate` | `*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` | -| `SubscriptionId` | `*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. | -| `TaxIncluded` | `*bool` | Optional | - | -| `Interval` | `Optional[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. | -| `IntervalUnit` | [`Optional[models.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. | -| `CurrencyPrices` | [`[]models.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. | - -## Example (as JSON) - -```json -{ - "use_site_exchange_rate": true, - "id": 190, - "type": "custom", - "default": false, - "name": "name2", - "pricing_scheme": "stairstep" -} -``` - + +# Component Price Point + +## Structure + +`ComponentPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Type` | [`*models.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 | +| `Name` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `ComponentId` | `*int` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `ArchivedAt` | `Optional[time.Time]` | Optional | - | +| `CreatedAt` | `*time.Time` | Optional | - | +| `UpdatedAt` | `*time.Time` | Optional | - | +| `Prices` | [`[]models.ComponentPrice`](../../doc/models/component-price.md) | Optional | - | +| `UseSiteExchangeRate` | `*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. | +| `SubscriptionId` | `*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. | +| `TaxIncluded` | `*bool` | Optional | - | +| `Interval` | `Optional[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. | +| `IntervalUnit` | [`Optional[models.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. | +| `CurrencyPrices` | [`[]models.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. | + +## Example (as JSON) + +```json +{ + "id": 190, + "type": "custom", + "default": false, + "name": "name2", + "pricing_scheme": "stairstep" +} +``` + diff --git a/doc/models/component-price-points-response.md b/doc/models/component-price-points-response.md index 2dd64493..45df0633 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -1,43 +1,43 @@ - -# Component Price Points Response - -## Structure - -`ComponentPricePointsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.ComponentPricePoint`](../../doc/models/component-price-point.md) | Optional | - | -| `Meta` | [`*models.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 - } -} -``` - + +# Component Price Points Response + +## Structure + +`ComponentPricePointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.ComponentPricePoint`](../../doc/models/component-price-point.md) | Optional | - | +| `Meta` | [`*models.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 + } +} +``` + diff --git a/doc/models/component-price.md b/doc/models/component-price.md index 155efff9..1190f5b0 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -1,32 +1,32 @@ - -# Component Price - -## Structure - -`ComponentPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `StartingQuantity` | `*int` | Optional | - | -| `EndingQuantity` | `Optional[int]` | Optional | - | -| `UnitPrice` | `*string` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `FormattedUnitPrice` | `*string` | Optional | - | -| `SegmentId` | `Optional[int]` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} -``` - + +# Component Price + +## Structure + +`ComponentPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `StartingQuantity` | `*int` | Optional | - | +| `EndingQuantity` | `Optional[int]` | Optional | - | +| `UnitPrice` | `*string` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `FormattedUnitPrice` | `*string` | Optional | - | +| `SegmentId` | `Optional[int]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 234, + "component_id": 88, + "starting_quantity": 104, + "ending_quantity": 78, + "unit_price": "unit_price0" +} +``` + diff --git a/doc/models/component-response.md b/doc/models/component-response.md index 39ba7e6a..71572118 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -1,28 +1,28 @@ - -# Component Response - -## Structure - -`ComponentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Component` | [`models.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" - } -} -``` - + +# Component Response + +## Structure + +`ComponentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Component` | [`models.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" + } +} +``` + diff --git a/doc/models/component-s-price-point-assignment.md b/doc/models/component-s-price-point-assignment.md index 6e15dc2c..68572789 100644 --- a/doc/models/component-s-price-point-assignment.md +++ b/doc/models/component-s-price-point-assignment.md @@ -1,26 +1,26 @@ - -# Component S Price Point Assignment - -## Structure - -`ComponentSPricePointAssignment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `PricePoint` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "component_id": 76, - "price_point": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Component S Price Point Assignment + +## Structure + +`ComponentSPricePointAssignment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `PricePoint` | `*interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "component_id": 76, + "price_point": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/component.md b/doc/models/component.md index 4fb34c05..37254382 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -1,59 +1,59 @@ - -# Component - -## Structure - -`Component` - -## Fields - -| 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` | `*string` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | -| `Handle` | `Optional[string]` | Optional | The component API handle | -| `PricingScheme` | [`Optional[models.PricingScheme]`](../../doc/models/pricing-scheme.md) | Optional | - | -| `UnitName` | `*string` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | -| `UnitPrice` | `Optional[string]` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | -| `ProductFamilyId` | `*int` | Optional | The id of the Product Family to which the Component belongs | -| `ProductFamilyName` | `*string` | Optional | The name of the Product Family to which the Component belongs | -| `PricePerUnitInCents` | `Optional[int64]` | Optional | deprecated - use unit_price instead | -| `Kind` | [`*models.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. | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `Description` | `Optional[string]` | Optional | The description of the component. | -| `DefaultPricePointId` | `Optional[int]` | Optional | - | -| `OveragePrices` | [`Optional[[]models.ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | -| `Prices` | [`Optional[[]models.ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | -| `PricePointCount` | `*int` | Optional | Count for the number of price points associated with the component | -| `PricePointsUrl` | `*string` | Optional | URL that points to the location to read the existing price points via GET request | -| `DefaultPricePointName` | `*string` | Optional | - | -| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `Recurring` | `*bool` | Optional | - | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this component was created | -| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this component was updated | -| `ArchivedAt` | `Optional[string]` | Optional | Timestamp indicating when this component was archived | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `ItemCategory` | [`Optional[models.ItemCategory]`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | -| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | -| `AccountingCode` | `Optional[string]` | Optional | E.g. Internal ID or SKU Number | -| `EventBasedBillingMetricId` | `*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. | -| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} -``` - + +# Component + +## Structure + +`Component` + +## Fields + +| 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` | `*string` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `Handle` | `Optional[string]` | Optional | The component API handle | +| `PricingScheme` | [`Optional[models.PricingScheme]`](../../doc/models/pricing-scheme.md) | Optional | - | +| `UnitName` | `*string` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | +| `UnitPrice` | `Optional[string]` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | +| `ProductFamilyId` | `*int` | Optional | The id of the Product Family to which the Component belongs | +| `ProductFamilyName` | `*string` | Optional | The name of the Product Family to which the Component belongs | +| `PricePerUnitInCents` | `Optional[int64]` | Optional | deprecated - use unit_price instead | +| `Kind` | [`*models.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. | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `Description` | `Optional[string]` | Optional | The description of the component. | +| `DefaultPricePointId` | `Optional[int]` | Optional | - | +| `OveragePrices` | [`Optional[[]models.ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | +| `Prices` | [`Optional[[]models.ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | +| `PricePointCount` | `*int` | Optional | Count for the number of price points associated with the component | +| `PricePointsUrl` | `*string` | Optional | URL that points to the location to read the existing price points via GET request | +| `DefaultPricePointName` | `*string` | Optional | - | +| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `Recurring` | `*bool` | Optional | - | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this component was created | +| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this component was updated | +| `ArchivedAt` | `Optional[string]` | Optional | Timestamp indicating when this component was archived | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `ItemCategory` | [`Optional[models.ItemCategory]`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | +| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | +| `AccountingCode` | `Optional[string]` | Optional | E.g. Internal ID or SKU Number | +| `EventBasedBillingMetricId` | `*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. | +| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | + +## Example (as JSON) + +```json +{ + "item_category": "Business Software", + "id": 24, + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "unit_name": "unit_name4" +} +``` + diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index d3746d9f..dd0e3c83 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -1,14 +1,14 @@ - -# Compounding Strategy - -## Enumeration - -`CompoundingStrategy` - -## Fields - -| Name | -| --- | -| `COMPOUND` | -| `FULLPRICE` | - + +# Compounding Strategy + +## Enumeration + +`CompoundingStrategy` + +## Fields + +| Name | +| --- | +| `COMPOUND` | +| `FULLPRICE` | + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index 8e49790a..71e3f022 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -1,36 +1,36 @@ - -# Consolidated Invoice - -## Structure - -`ConsolidatedInvoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Invoices` | [`[]models.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 - } - ] -} -``` - + +# Consolidated Invoice + +## Structure + +`ConsolidatedInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Invoices` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/count-response.md b/doc/models/count-response.md index 7b584cb9..033525a0 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -1,21 +1,21 @@ - -# Count Response - -## Structure - -`CountResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Count` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "count": 60 -} -``` - + +# Count Response + +## Structure + +`CountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Count` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "count": 60 +} +``` + diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index e830058c..7eadcabb 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -1,26 +1,26 @@ - -# Coupon Currency Request - -## Structure - -`CouponCurrencyRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.UpdateCouponCurrency`](../../doc/models/update-coupon-currency.md) | Required | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78 - } - ] -} -``` - + +# Coupon Currency Request + +## Structure + +`CouponCurrencyRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.UpdateCouponCurrency`](../../doc/models/update-coupon-currency.md) | Required | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "currency": "currency8", + "price": 78 + } + ] +} +``` + diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index 5c72de8f..6c2206b6 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -1,40 +1,40 @@ - -# Coupon Currency Response - -## Structure - -`CouponCurrencyResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.CouponCurrency`](../../doc/models/coupon-currency.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 78, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 78, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 78, - "coupon_id": 224 - } - ] -} -``` - + +# Coupon Currency Response + +## Structure + +`CouponCurrencyResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.CouponCurrency`](../../doc/models/coupon-currency.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "id": 50, + "currency": "currency8", + "price": 78, + "coupon_id": 224 + }, + { + "id": 50, + "currency": "currency8", + "price": 78, + "coupon_id": 224 + }, + { + "id": 50, + "currency": "currency8", + "price": 78, + "coupon_id": 224 + } + ] +} +``` + diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index 9d611507..e4e88d32 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -1,27 +1,27 @@ - -# Coupon Currency - -## Structure - -`CouponCurrency` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `Price` | `*int` | Optional | - | -| `CouponId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 100, - "coupon_id": 210 -} -``` - + +# Coupon Currency + +## Structure + +`CouponCurrency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `Price` | `*int` | Optional | - | +| `CouponId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 228, + "currency": "currency8", + "price": 100, + "coupon_id": 210 +} +``` + diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index 5a3e3f1c..3626510a 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -1,27 +1,27 @@ - -# Coupon Response - -## Structure - -`CouponResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Coupon` | [`*models.Coupon`](../../doc/models/coupon.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} -``` - + +# Coupon Response + +## Structure + +`CouponResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Coupon` | [`*models.Coupon`](../../doc/models/coupon.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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 a0fa350d..c8ef6242 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -1,29 +1,29 @@ - -# Coupon Restriction - -## Structure - -`CouponRestriction` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `ItemType` | [`*models.RestrictionType`](../../doc/models/restriction-type.md) | Optional | - | -| `ItemId` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Handle` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} -``` - + +# Coupon Restriction + +## Structure + +`CouponRestriction` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `ItemType` | [`*models.RestrictionType`](../../doc/models/restriction-type.md) | Optional | - | +| `ItemId` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Handle` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 180, + "item_type": "Component", + "item_id": 184, + "name": "name4", + "handle": "handle0" +} +``` + diff --git a/doc/models/coupon-subcodes-response.md b/doc/models/coupon-subcodes-response.md index 24fe7899..1735c80e 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -1,35 +1,35 @@ - -# Coupon Subcodes Response - -## Structure - -`CouponSubcodesResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CreatedCodes` | `[]string` | Optional | - | -| `DuplicateCodes` | `[]string` | Optional | - | -| `InvalidCodes` | `[]string` | 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" - ] -} -``` - + +# Coupon Subcodes Response + +## Structure + +`CouponSubcodesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CreatedCodes` | `[]string` | Optional | - | +| `DuplicateCodes` | `[]string` | Optional | - | +| `InvalidCodes` | `[]string` | 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" + ] +} +``` + diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index ab8f8629..7d64cf53 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -1,23 +1,23 @@ - -# Coupon Subcodes - -## Structure - -`CouponSubcodes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Codes` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" - ] -} -``` - + +# Coupon Subcodes + +## Structure + +`CouponSubcodes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Codes` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "codes": [ + "codes8" + ] +} +``` + diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index 0b941086..8aee95b8 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -1,31 +1,31 @@ - -# Coupon Usage - -## Structure - -`CouponUsage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | The Chargify id of the product | -| `Name` | `*string` | Optional | Name of the product | -| `Signups` | `*int` | Optional | Number of times the coupon has been applied | -| `Savings` | `Optional[int]` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `SavingsInCents` | `Optional[int64]` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `Revenue` | `Optional[int]` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | -| `RevenueInCents` | `*int64` | 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 -} -``` - + +# Coupon Usage + +## Structure + +`CouponUsage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | The Chargify id of the product | +| `Name` | `*string` | Optional | Name of the product | +| `Signups` | `*int` | Optional | Number of times the coupon has been applied | +| `Savings` | `Optional[int]` | Optional | Dollar amount of customer savings as a result of the coupon. | +| `SavingsInCents` | `Optional[int64]` | Optional | Dollar amount of customer savings as a result of the coupon. | +| `Revenue` | `Optional[int]` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | +| `RevenueInCents` | `*int64` | 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 +} +``` + diff --git a/doc/models/coupon.md b/doc/models/coupon.md index 4e839a6d..b6ca8b6d 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -1,53 +1,53 @@ - -# Coupon - -## Structure - -`Coupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Code` | `*string` | Optional | - | -| `Description` | `*string` | Optional | - | -| `Amount` | `Optional[float64]` | Optional | - | -| `AmountInCents` | `Optional[int]` | Optional | - | -| `ProductFamilyId` | `*int` | Optional | - | -| `ProductFamilyName` | `Optional[string]` | Optional | - | -| `StartDate` | `*string` | Optional | - | -| `EndDate` | `Optional[string]` | Optional | - | -| `Percentage` | `Optional[string]` | Optional | - | -| `Recurring` | `*bool` | Optional | - | -| `RecurringScheme` | [`*models.RecurringScheme`](../../doc/models/recurring-scheme.md) | Optional | - | -| `DurationPeriodCount` | `Optional[int]` | Optional | - | -| `DurationInterval` | `Optional[int]` | Optional | - | -| `DurationIntervalUnit` | `Optional[string]` | Optional | - | -| `DurationIntervalSpan` | `Optional[string]` | Optional | - | -| `AllowNegativeBalance` | `*bool` | Optional | - | -| `ArchivedAt` | `Optional[string]` | Optional | - | -| `ConversionLimit` | `Optional[string]` | Optional | - | -| `Stackable` | `*bool` | Optional | - | -| `CompoundingStrategy` | `*interface{}` | Optional | - | -| `UseSiteExchangeRate` | `*bool` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | -| `DiscountType` | [`*models.DiscountType`](../../doc/models/discount-type.md) | Optional | - | -| `ExcludeMidPeriodAllocations` | `*bool` | Optional | - | -| `ApplyOnCancelAtEndOfPeriod` | `*bool` | Optional | - | -| `CouponRestrictions` | [`[]models.CouponRestriction`](../../doc/models/coupon-restriction.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 22, - "name": "name2", - "code": "code0", - "description": "description2", - "amount": 62.64 -} -``` - + +# Coupon + +## Structure + +`Coupon` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Code` | `*string` | Optional | - | +| `Description` | `*string` | Optional | - | +| `Amount` | `Optional[float64]` | Optional | - | +| `AmountInCents` | `Optional[int]` | Optional | - | +| `ProductFamilyId` | `*int` | Optional | - | +| `ProductFamilyName` | `Optional[string]` | Optional | - | +| `StartDate` | `*string` | Optional | - | +| `EndDate` | `Optional[string]` | Optional | - | +| `Percentage` | `Optional[string]` | Optional | - | +| `Recurring` | `*bool` | Optional | - | +| `RecurringScheme` | [`*models.RecurringScheme`](../../doc/models/recurring-scheme.md) | Optional | - | +| `DurationPeriodCount` | `Optional[int]` | Optional | - | +| `DurationInterval` | `Optional[int]` | Optional | - | +| `DurationIntervalUnit` | `Optional[string]` | Optional | - | +| `DurationIntervalSpan` | `Optional[string]` | Optional | - | +| `AllowNegativeBalance` | `*bool` | Optional | - | +| `ArchivedAt` | `Optional[string]` | Optional | - | +| `ConversionLimit` | `Optional[string]` | Optional | - | +| `Stackable` | `*bool` | Optional | - | +| `CompoundingStrategy` | `*interface{}` | Optional | - | +| `UseSiteExchangeRate` | `*bool` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | +| `DiscountType` | [`*models.DiscountType`](../../doc/models/discount-type.md) | Optional | - | +| `ExcludeMidPeriodAllocations` | `*bool` | Optional | - | +| `ApplyOnCancelAtEndOfPeriod` | `*bool` | Optional | - | +| `CouponRestrictions` | [`[]models.CouponRestriction`](../../doc/models/coupon-restriction.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 22, + "name": "name2", + "code": "code0", + "description": "description2", + "amount": 62.64 +} +``` + diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index 377578c7..f6231036 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -1,28 +1,28 @@ - -# Create Allocation Request - -## Structure - -`CreateAllocationRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Allocation` | [`models.CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | - -## Example (as JSON) - -```json -{ - "allocation": { - "quantity": 228.94, - "component_id": 8, - "memo": "memo2", - "proration_downgrade_scheme": "proration_downgrade_scheme4", - "proration_upgrade_scheme": "proration_upgrade_scheme6", - "accrue_charge": false - } -} -``` - + +# Create Allocation Request + +## Structure + +`CreateAllocationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Allocation` | [`models.CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | + +## Example (as JSON) + +```json +{ + "allocation": { + "quantity": 228.94, + "component_id": 8, + "memo": "memo2", + "proration_downgrade_scheme": "proration_downgrade_scheme4", + "proration_upgrade_scheme": "proration_upgrade_scheme6", + "accrue_charge": false + } +} +``` + diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 9d6357be..70bd64f4 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -1,36 +1,36 @@ - -# Create Allocation - -## Structure - -`CreateAllocation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Quantity` | `float64` | 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. | -| `ComponentId` | `*int` | Optional | (required for the multiple allocations endpoint) The id associated with the component for which the allocation is being made | -| `Memo` | `*string` | Optional | A memo to record along with the allocation | -| `ProrationDowngradeScheme` | `*string` | Optional | The scheme used if the proration is a downgrade. Defaults to the site setting if one is not provided. | -| `ProrationUpgradeScheme` | `*string` | Optional | The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided. | -| `AccrueCharge` | `*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. Defaults to the site setting if one is not provided. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `InitiateDunning` | `*bool` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | -| `PricePointId` | `Optional[interface{}]` | Optional | Price point that the allocation should be charged at. Accepts either the price point's id (integer) or handle (string). When not specified, the default price point will be used. | -| `BillingSchedule` | [`*models.BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | - -## Example (as JSON) - -```json -{ - "quantity": 8.06, - "component_id": 192, - "memo": "memo4", - "proration_downgrade_scheme": "proration_downgrade_scheme2", - "proration_upgrade_scheme": "proration_upgrade_scheme4", - "accrue_charge": false -} -``` - + +# Create Allocation + +## Structure + +`CreateAllocation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Quantity` | `float64` | 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. | +| `ComponentId` | `*int` | Optional | (required for the multiple allocations endpoint) The id associated with the component for which the allocation is being made | +| `Memo` | `*string` | Optional | A memo to record along with the allocation | +| `ProrationDowngradeScheme` | `*string` | Optional | The scheme used if the proration is a downgrade. Defaults to the site setting if one is not provided. | +| `ProrationUpgradeScheme` | `*string` | Optional | The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided. | +| `AccrueCharge` | `*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. Defaults to the site setting if one is not provided. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `InitiateDunning` | `*bool` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | +| `PricePointId` | `Optional[interface{}]` | Optional | Price point that the allocation should be charged at. Accepts either the price point's id (integer) or handle (string). When not specified, the default price point will be used. | +| `BillingSchedule` | [`*models.BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | + +## Example (as JSON) + +```json +{ + "quantity": 8.06, + "component_id": 192, + "memo": "memo4", + "proration_downgrade_scheme": "proration_downgrade_scheme2", + "proration_upgrade_scheme": "proration_upgrade_scheme4", + "accrue_charge": false +} +``` + diff --git a/doc/models/create-component-price-point-request.md b/doc/models/create-component-price-point-request.md index 3c32ac1b..10166679 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -1,70 +1,70 @@ - -# Create Component Price Point Request - -## Structure - -`CreateComponentPricePointRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`models.PricePoint`](../../doc/models/price-point.md) | Required | - | - -## Example (as JSON) - -```json -{ - "price_point": { - "use_site_exchange_rate": true, - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } -} -``` - + +# Create Component Price Point Request + +## Structure + +`CreateComponentPricePointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`models.PricePoint`](../../doc/models/price-point.md) | Required | - | + +## Example (as JSON) + +```json +{ + "price_point": { + "use_site_exchange_rate": true, + "name": "name0", + "handle": "handle6", + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } +} +``` + diff --git a/doc/models/create-component-price-points-request.md b/doc/models/create-component-price-points-request.md index b7d66a2b..d9b0b592 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -1,44 +1,44 @@ - -# Create Component Price Points Request - -## Structure - -`CreateComponentPricePointsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.PricePoint`](../../doc/models/price-point.md) | Required | - | - -## Example (as JSON) - -```json -{ - "price_points": [ - { - "use_site_exchange_rate": true, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } - ] -} -``` - + +# Create Component Price Points Request + +## Structure + +`CreateComponentPricePointsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.PricePoint`](../../doc/models/price-point.md) | Required | - | + +## Example (as JSON) + +```json +{ + "price_points": [ + { + "use_site_exchange_rate": true, + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } + ] +} +``` + diff --git a/doc/models/create-currency-price.md b/doc/models/create-currency-price.md index 7bbb5622..e1b71970 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -1,25 +1,25 @@ - -# Create Currency Price - -## Structure - -`CreateCurrencyPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Currency` | `*string` | Optional | ISO code for a currency defined on the site level | -| `Price` | `*float64` | Optional | Price for the price level in this currency | -| `PriceId` | `*int` | Optional | ID of the price that this corresponds with | - -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} -``` - + +# Create Currency Price + +## Structure + +`CreateCurrencyPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Currency` | `*string` | Optional | ISO code for a currency defined on the site level | +| `Price` | `*float64` | Optional | Price for the price level in this currency | +| `PriceId` | `*int` | Optional | ID of the price that this corresponds with | + +## Example (as JSON) + +```json +{ + "currency": "currency2", + "price": 10.4, + "price_id": 54 +} +``` + diff --git a/doc/models/create-currency-prices-request.md b/doc/models/create-currency-prices-request.md index 1e5c58f1..efc181fd 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -1,27 +1,27 @@ - -# Create Currency Prices Request - -## Structure - -`CreateCurrencyPricesRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.CreateCurrencyPrice`](../../doc/models/create-currency-price.md) | Required | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 233.74, - "price_id": 116 - } - ] -} -``` - + +# Create Currency Prices Request + +## Structure + +`CreateCurrencyPricesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.CreateCurrencyPrice`](../../doc/models/create-currency-price.md) | Required | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "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 568c14dd..36f9a02f 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -1,30 +1,30 @@ - -# Create Customer Request - -## Structure - -`CreateCustomerRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Customer` | [`models.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" - } -} -``` - + +# Create Customer Request + +## Structure + +`CreateCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Customer` | [`models.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" + } +} +``` + diff --git a/doc/models/create-customer.md b/doc/models/create-customer.md index 533b6046..70731a3b 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -1,45 +1,45 @@ - -# Create Customer - -## Structure - -`CreateCustomer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `string` | Required | - | -| `LastName` | `string` | Required | - | -| `Email` | `string` | Required | - | -| `CcEmails` | `*string` | Optional | - | -| `Organization` | `*string` | Optional | - | -| `Reference` | `*string` | Optional | - | -| `Address` | `*string` | Optional | - | -| `Address2` | `*string` | Optional | - | -| `City` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `Zip` | `*string` | Optional | - | -| `Country` | `*string` | Optional | - | -| `Phone` | `*string` | Optional | - | -| `Locale` | `*string` | Optional | Set a specific language on a customer record. | -| `VatNumber` | `*string` | Optional | - | -| `TaxExempt` | `*bool` | Optional | - | -| `TaxExemptReason` | `*string` | Optional | - | -| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | - -## 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" -} -``` - + +# Create Customer + +## Structure + +`CreateCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `string` | Required | - | +| `LastName` | `string` | Required | - | +| `Email` | `string` | Required | - | +| `CcEmails` | `*string` | Optional | - | +| `Organization` | `*string` | Optional | - | +| `Reference` | `*string` | Optional | - | +| `Address` | `*string` | Optional | - | +| `Address2` | `*string` | Optional | - | +| `City` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `Zip` | `*string` | Optional | - | +| `Country` | `*string` | Optional | - | +| `Phone` | `*string` | Optional | - | +| `Locale` | `*string` | Optional | Set a specific language on a customer record. | +| `VatNumber` | `*string` | Optional | - | +| `TaxExempt` | `*bool` | Optional | - | +| `TaxExemptReason` | `*string` | Optional | - | +| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | + +## 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" +} +``` + diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index f756bb14..72720e7b 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -1,46 +1,46 @@ - -# Create EBB Component - -## Structure - -`CreateEBBComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `EventBasedComponent` | [`models.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": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "full", - "event_based_billing_metric_id": 68 - } -} -``` - + +# Create EBB Component + +## Structure + +`CreateEBBComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `EventBasedComponent` | [`models.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": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "full", + "event_based_billing_metric_id": 68 + } +} +``` + diff --git a/doc/models/create-invoice-address.md b/doc/models/create-invoice-address.md index 572f0f43..665050df 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -1,35 +1,35 @@ - -# Create Invoice Address - -Overrides the default address. - -## Structure - -`CreateInvoiceAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Phone` | `*string` | Optional | - | -| `Address` | `*string` | Optional | - | -| `Address2` | `*string` | Optional | - | -| `City` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `Zip` | `*string` | Optional | - | -| `Country` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} -``` - + +# Create Invoice Address + +Overrides the default address. + +## Structure + +`CreateInvoiceAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Phone` | `*string` | Optional | - | +| `Address` | `*string` | Optional | - | +| `Address2` | `*string` | Optional | - | +| `City` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `Zip` | `*string` | Optional | - | +| `Country` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name4", + "last_name": "last_name2", + "phone": "phone6", + "address": "address0", + "address_2": "address_28" +} +``` + diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index b37c0c9d..979143f8 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -1,39 +1,39 @@ - -# Create Invoice Coupon - -## Structure - -`CreateInvoiceCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Code` | `*string` | Optional | - | -| `Percentage` | `*interface{}` | Optional | - | -| `Amount` | `*interface{}` | Optional | - | -| `Description` | `*string` | Optional | **Constraints**: *Maximum Length*: `255` | -| `ProductFamilyId` | `*interface{}` | Optional | - | -| `CompoundingStrategy` | [`*models.CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "percentage": { - "key1": "val1", - "key2": "val2" - }, - "code": "code4", - "amount": { - "key1": "val1", - "key2": "val2" - }, - "description": "description4", - "product_family_id": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Create Invoice Coupon + +## Structure + +`CreateInvoiceCoupon` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Code` | `*string` | Optional | - | +| `Percentage` | `*interface{}` | Optional | - | +| `Amount` | `*interface{}` | Optional | - | +| `Description` | `*string` | Optional | **Constraints**: *Maximum Length*: `255` | +| `ProductFamilyId` | `*interface{}` | Optional | - | +| `CompoundingStrategy` | [`*models.CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "percentage": { + "key1": "val1", + "key2": "val2" + }, + "code": "code4", + "amount": { + "key1": "val1", + "key2": "val2" + }, + "description": "description4", + "product_family_id": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index 98dcf91e..45b123f7 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -1,42 +1,42 @@ - -# Create Invoice Item - -## Structure - -`CreateInvoiceItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Title` | `*string` | Optional | - | -| `Quantity` | `*interface{}` | Optional | 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 more than 8 decimal places, we will round it down to the 8th decimal place. | -| `UnitPrice` | `*interface{}` | Optional | 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 more than 8 decimal places, we will round it down to the 8th decimal place. | -| `Taxable` | `*bool` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes.

If using Avalara, a tax_code parameter must also be sent. | -| `TaxCode` | `*string` | Optional | - | -| `PeriodRangeStart` | `*string` | Optional | YYYY-MM-DD | -| `PeriodRangeEnd` | `*string` | Optional | YYYY-MM-DD | -| `ProductId` | `*interface{}` | Optional | Product handle or product id. | -| `ComponentId` | `*interface{}` | Optional | Component handle or component id. | -| `PricePointId` | `*interface{}` | Optional | Price point handle or id. For component. | -| `ProductPricePointId` | `*interface{}` | Optional | - | -| `Description` | `*string` | Optional | **Constraints**: *Maximum Length*: `255` | - -## Example (as JSON) - -```json -{ - "title": "title2", - "quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "taxable": false, - "tax_code": "tax_code4" -} -``` - + +# Create Invoice Item + +## Structure + +`CreateInvoiceItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Title` | `*string` | Optional | - | +| `Quantity` | `*interface{}` | Optional | 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 more than 8 decimal places, we will round it down to the 8th decimal place. | +| `UnitPrice` | `*interface{}` | Optional | 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 more than 8 decimal places, we will round it down to the 8th decimal place. | +| `Taxable` | `*bool` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes.

If using Avalara, a tax_code parameter must also be sent. | +| `TaxCode` | `*string` | Optional | - | +| `PeriodRangeStart` | `*string` | Optional | YYYY-MM-DD | +| `PeriodRangeEnd` | `*string` | Optional | YYYY-MM-DD | +| `ProductId` | `*interface{}` | Optional | Product handle or product id. | +| `ComponentId` | `*interface{}` | Optional | Component handle or component id. | +| `PricePointId` | `*interface{}` | Optional | Price point handle or id. For component. | +| `ProductPricePointId` | `*interface{}` | Optional | - | +| `Description` | `*string` | Optional | **Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "title": "title2", + "quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "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 1b970f24..aaadb5c9 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -1,23 +1,23 @@ - -# Create Invoice Payment Application - -## Structure - -`CreateInvoicePaymentApplication` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `InvoiceUid` | `string` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | -| `Amount` | `string` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | - -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} -``` - + +# Create Invoice Payment Application + +## Structure + +`CreateInvoicePaymentApplication` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `InvoiceUid` | `string` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | +| `Amount` | `string` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | + +## Example (as JSON) + +```json +{ + "invoice_uid": "invoice_uid4", + "amount": "amount6" +} +``` + diff --git a/doc/models/create-invoice-payment-request.md b/doc/models/create-invoice-payment-request.md index a053d454..9d4be52a 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -1,31 +1,31 @@ - -# Create Invoice Payment Request - -## Structure - -`CreateInvoicePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Payment` | [`models.CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | -| `Type` | [`*models.InvoicePaymentType`](../../doc/models/invoice-payment-type.md) | Optional | The type of payment to be applied to an Invoice.
**Default**: `"external"` | - -## Example (as JSON) - -```json -{ - "payment": { - "method": "other", - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo0", - "details": "details6" - }, - "type": "external" -} -``` - + +# Create Invoice Payment Request + +## Structure + +`CreateInvoicePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Payment` | [`models.CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | +| `Type` | [`*models.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": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo0", + "method": "ach", + "details": "details6" + }, + "type": "external" +} +``` + diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index 702c21f5..cf414a55 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -1,30 +1,30 @@ - -# Create Invoice Payment - -## Structure - -`CreateInvoicePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `*interface{}` | Optional | A string of the dollar amount to be refunded (eg. "10.50" => $10.50) | -| `Memo` | `*string` | Optional | A description to be attached to the payment. | -| `Method` | [`*models.InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used.
**Default**: `"other"` | -| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #) | - -## Example (as JSON) - -```json -{ - "method": "other", - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo0", - "details": "details6" -} -``` - + +# Create Invoice Payment + +## Structure + +`CreateInvoicePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `*interface{}` | Optional | A string of the dollar amount to be refunded (eg. "10.50" => $10.50) | +| `Memo` | `*string` | Optional | A description to be attached to the payment. | +| `Method` | [`*models.InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used. Defaults to other. | +| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #) | + +## Example (as JSON) + +```json +{ + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo0", + "method": "cash", + "details": "details6" +} +``` + diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index 0ae11fdd..ad1c5d26 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -1,68 +1,68 @@ - -# Create Invoice Request - -## Structure - -`CreateInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Invoice` | [`models.CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | - -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "taxable": false, - "tax_code": "tax_code6" - } - ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} -``` - + +# Create Invoice Request + +## Structure + +`CreateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Invoice` | [`models.CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | + +## Example (as JSON) + +```json +{ + "invoice": { + "issue_date": "2024-01-01", + "status": "draft", + "line_items": [ + { + "title": "title4", + "quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "taxable": false, + "tax_code": "tax_code6" + }, + { + "title": "title4", + "quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "taxable": false, + "tax_code": "tax_code6" + }, + { + "title": "title4", + "quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "taxable": false, + "tax_code": "tax_code6" + } + ], + "net_terms": 144, + "payment_instructions": "payment_instructions6", + "memo": "memo0" + } +} +``` + diff --git a/doc/models/create-invoice-status.md b/doc/models/create-invoice-status.md index 73171a87..645cff05 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -1,20 +1,20 @@ - -# Create Invoice Status - -## Enumeration - -`CreateInvoiceStatus` - -## Fields - -| Name | -| --- | -| `DRAFT` | -| `OPEN` | - -## Example - -``` -draft -``` - + +# Create Invoice Status + +## Enumeration + +`CreateInvoiceStatus` + +## Fields + +| Name | +| --- | +| `DRAFT` | +| `OPEN` | + +## Example + +``` +draft +``` + diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index f921b1d0..791ac285 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -1,49 +1,49 @@ - -# Create Invoice - -## Structure - -`CreateInvoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `LineItems` | [`[]models.CreateInvoiceItem`](../../doc/models/create-invoice-item.md) | Optional | - | -| `IssueDate` | `*time.Time` | Optional | - | -| `NetTerms` | `*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. | -| `PaymentInstructions` | `*string` | Optional | - | -| `Memo` | `*string` | Optional | A custom memo can be sent to override the site's default. | -| `SellerAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | -| `BillingAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | -| `ShippingAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | -| `Coupons` | [`[]models.CreateInvoiceCoupon`](../../doc/models/create-invoice-coupon.md) | Optional | - | -| `Status` | [`*models.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": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "taxable": false, - "tax_code": "tax_code6" - } - ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} -``` - + +# Create Invoice + +## Structure + +`CreateInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `LineItems` | [`[]models.CreateInvoiceItem`](../../doc/models/create-invoice-item.md) | Optional | - | +| `IssueDate` | `*time.Time` | Optional | - | +| `NetTerms` | `*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. | +| `PaymentInstructions` | `*string` | Optional | - | +| `Memo` | `*string` | Optional | A custom memo can be sent to override the site's default. | +| `SellerAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | +| `BillingAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | +| `ShippingAddress` | [`*models.CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | +| `Coupons` | [`[]models.CreateInvoiceCoupon`](../../doc/models/create-invoice-coupon.md) | Optional | - | +| `Status` | [`*models.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": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "taxable": false, + "tax_code": "tax_code6" + } + ], + "net_terms": 18, + "payment_instructions": "payment_instructions0", + "memo": "memo6" +} +``` + diff --git a/doc/models/create-metadata-request.md b/doc/models/create-metadata-request.md index 8ba9892b..6f3a0092 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -1,26 +1,26 @@ - -# Create Metadata Request - -## Structure - -`CreateMetadataRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Metadata` | [`[]models.CreateMetadata`](../../doc/models/create-metadata.md) | Required | - | - -## Example (as JSON) - -```json -{ - "metadata": [ - { - "name": "name6", - "value": "value8" - } - ] -} -``` - + +# Create Metadata Request + +## Structure + +`CreateMetadataRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Metadata` | [`[]models.CreateMetadata`](../../doc/models/create-metadata.md) | Required | - | + +## Example (as JSON) + +```json +{ + "metadata": [ + { + "name": "name6", + "value": "value8" + } + ] +} +``` + diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index 3eb40e9d..f4e4fb63 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -1,23 +1,23 @@ - -# Create Metadata - -## Structure - -`CreateMetadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Value` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name4", - "value": "value6" -} -``` - + +# Create Metadata + +## Structure + +`CreateMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Value` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name4", + "value": "value6" +} +``` + diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 7f26cd92..3ac223bf 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -1,24 +1,24 @@ - -# Create Metafields Request - -## Structure - -`CreateMetafieldsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Metafields` | `interface{}` | Required | - | - -## Example (as JSON) - -```json -{ - "metafields": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Create Metafields Request + +## Structure + +`CreateMetafieldsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Metafields` | `interface{}` | Required | - | + +## Example (as JSON) + +```json +{ + "metafields": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index 8e7d6109..002f5850 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -1,73 +1,73 @@ - -# Create Metered Component - -## Structure - -`CreateMeteredComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `MeteredComponent` | [`models.MeteredComponent`](../../doc/models/metered-component.md) | Required | - | - -## Example (as JSON) - -```json -{ - "metered_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "none" - } -} -``` - + +# Create Metered Component + +## Structure + +`CreateMeteredComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `MeteredComponent` | [`models.MeteredComponent`](../../doc/models/metered-component.md) | Required | - | + +## Example (as JSON) + +```json +{ + "metered_component": { + "name": "name0", + "unit_name": "unit_name2", + "description": "description0", + "handle": "handle6", + "taxable": false, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "none" + } +} +``` + diff --git a/doc/models/create-multi-invoice-payment-request.md b/doc/models/create-multi-invoice-payment-request.md index 417f6f76..5dd512d2 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -1,36 +1,36 @@ - -# Create Multi Invoice Payment Request - -## Structure - -`CreateMultiInvoicePaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Payment` | [`models.CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment": { - "method": "other", - "amount": { - "key1": "val1", - "key2": "val2" - }, - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo0", - "details": "details6", - "received_on": "received_on8" - } -} -``` - + +# Create Multi Invoice Payment Request + +## Structure + +`CreateMultiInvoicePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Payment` | [`models.CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "payment": { + "amount": { + "key1": "val1", + "key2": "val2" + }, + "applications": [ + { + "invoice_uid": "invoice_uid8", + "amount": "amount0" + } + ], + "memo": "memo0", + "details": "details6", + "method": "ach", + "received_on": "received_on8" + } +} +``` + diff --git a/doc/models/create-multi-invoice-payment.md b/doc/models/create-multi-invoice-payment.md index 8d2b22af..4a93fdce 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -1,39 +1,39 @@ - -# Create Multi Invoice Payment - -## Structure - -`CreateMultiInvoicePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Memo` | `*string` | Optional | A description to be attached to the payment. | -| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #). | -| `Method` | [`*models.InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used.
**Default**: `"other"` | -| `Amount` | `interface{}` | Required | Dollar amount of the sum of the invoices payment (eg. "10.50" => $10.50). | -| `ReceivedOn` | `*string` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | -| `Applications` | [`[]models.CreateInvoicePaymentApplication`](../../doc/models/create-invoice-payment-application.md) | Required | - | - -## Example (as JSON) - -```json -{ - "method": "other", - "amount": { - "key1": "val1", - "key2": "val2" - }, - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo8", - "details": "details4", - "received_on": "received_on6" -} -``` - + +# Create Multi Invoice Payment + +## Structure + +`CreateMultiInvoicePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Memo` | `*string` | Optional | A description to be attached to the payment. | +| `Details` | `*string` | Optional | Additional information related to the payment method (eg. Check #). | +| `Method` | [`*models.InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used. Defaults to other. | +| `Amount` | `interface{}` | Required | Dollar amount of the sum of the invoices payment (eg. "10.50" => $10.50). | +| `ReceivedOn` | `*string` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | +| `Applications` | [`[]models.CreateInvoicePaymentApplication`](../../doc/models/create-invoice-payment-application.md) | Required | - | + +## Example (as JSON) + +```json +{ + "amount": { + "key1": "val1", + "key2": "val2" + }, + "applications": [ + { + "invoice_uid": "invoice_uid8", + "amount": "amount0" + } + ], + "memo": "memo8", + "details": "details4", + "method": "credit_card", + "received_on": "received_on6" +} +``` + diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index 382f1ea3..96533c2f 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -1,23 +1,23 @@ - -# Create Offer Component - -## Structure - -`CreateOfferComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `StartingQuantity` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "component_id": 242, - "starting_quantity": 50 -} -``` - + +# Create Offer Component + +## Structure + +`CreateOfferComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `StartingQuantity` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "component_id": 242, + "starting_quantity": 50 +} +``` + diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index 0c7b2313..1c6e2774 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -1,40 +1,40 @@ - -# Create Offer Request - -## Structure - -`CreateOfferRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Offer` | [`models.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, - "starting_quantity": 84 - }, - { - "component_id": 108, - "starting_quantity": 84 - } - ], - "coupons": [ - "coupons6" - ] - } -} -``` - + +# Create Offer Request + +## Structure + +`CreateOfferRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Offer` | [`models.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, + "starting_quantity": 84 + }, + { + "component_id": 108, + "starting_quantity": 84 + } + ], + "coupons": [ + "coupons6" + ] + } +} +``` + diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index fdcc57c5..9937bc03 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -1,44 +1,44 @@ - -# Create Offer - -## Structure - -`CreateOffer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | - | -| `Handle` | `string` | Required | - | -| `Description` | `*string` | Optional | - | -| `ProductId` | `int` | Required | - | -| `ProductPricePointId` | `*int` | Optional | - | -| `Components` | [`[]models.CreateOfferComponent`](../../doc/models/create-offer-component.md) | Optional | - | -| `Coupons` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "description": "description4", - "product_id": 208, - "product_price_point_id": 132, - "components": [ - { - "component_id": 108, - "starting_quantity": 84 - }, - { - "component_id": 108, - "starting_quantity": 84 - } - ], - "coupons": [ - "coupons4" - ] -} -``` - + +# Create Offer + +## Structure + +`CreateOffer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | - | +| `Handle` | `string` | Required | - | +| `Description` | `*string` | Optional | - | +| `ProductId` | `int` | Required | - | +| `ProductPricePointId` | `*int` | Optional | - | +| `Components` | [`[]models.CreateOfferComponent`](../../doc/models/create-offer-component.md) | Optional | - | +| `Coupons` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name4", + "handle": "handle0", + "description": "description4", + "product_id": 208, + "product_price_point_id": 132, + "components": [ + { + "component_id": 108, + "starting_quantity": 84 + }, + { + "component_id": 108, + "starting_quantity": 84 + } + ], + "coupons": [ + "coupons4" + ] +} +``` + diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index cb2f72f0..b989031b 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -1,43 +1,43 @@ - -# Create on Off Component - -## Structure - -`CreateOnOffComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `OnOffComponent` | [`models.OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | - -## Example (as JSON) - -```json -{ - "on_off_component": { - "name": "name6", - "description": "description6", - "handle": "handle2", - "taxable": false, - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "full" - } -} -``` - + +# Create on Off Component + +## Structure + +`CreateOnOffComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `OnOffComponent` | [`models.OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | + +## Example (as JSON) + +```json +{ + "on_off_component": { + "name": "name6", + "description": "description6", + "handle": "handle2", + "taxable": false, + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "full" + } +} +``` + diff --git a/doc/models/create-or-update-coupon.md b/doc/models/create-or-update-coupon.md index 0bfeb621..d39d5645 100644 --- a/doc/models/create-or-update-coupon.md +++ b/doc/models/create-or-update-coupon.md @@ -1,32 +1,32 @@ - -# Create or Update Coupon - -## Structure - -`CreateOrUpdateCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Coupon` | `*interface{}` | Optional | - | -| `RestrictedProducts` | `map[string]bool` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | -| `RestrictedComponents` | `map[string]bool` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | - -## Example (as JSON) - -```json -{ - "coupon": { - "key1": "val1", - "key2": "val2" - }, - "restricted_products": { - "key0": true - }, - "restricted_components": { - "key0": true - } -} -``` - + +# Create or Update Coupon + +## Structure + +`CreateOrUpdateCoupon` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Coupon` | `*interface{}` | Optional | - | +| `RestrictedProducts` | `map[string]bool` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | +| `RestrictedComponents` | `map[string]bool` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | + +## Example (as JSON) + +```json +{ + "coupon": { + "key1": "val1", + "key2": "val2" + }, + "restricted_products": { + "key0": true + }, + "restricted_components": { + "key0": true + } +} +``` + diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index 312a811a..17b90ece 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -1,32 +1,32 @@ - -# Create or Update Product Request - -## Structure - -`CreateOrUpdateProductRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Product` | [`models.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", - "auto_create_signup_page": false, - "tax_code": "tax_code8" - } -} -``` - + +# Create or Update Product Request + +## Structure + +`CreateOrUpdateProductRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Product` | [`models.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", + "auto_create_signup_page": false, + "tax_code": "tax_code8" + } +} +``` + diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 681dd2c9..98448a62 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -1,39 +1,39 @@ - -# Create or Update Product - -## Structure - -`CreateOrUpdateProduct` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | The product name | -| `Handle` | `*string` | Optional | The product API handle | -| `Description` | `string` | Required | The product description | -| `AccountingCode` | `*string` | Optional | E.g. Internal ID or SKU Number | -| `RequireCreditCard` | `*bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | -| `PriceInCents` | `int64` | 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 | -| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | -| `AutoCreateSignupPage` | `*bool` | Optional | - | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
**Constraints**: *Maximum Length*: `10` | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "description": "description8", - "accounting_code": "accounting_code4", - "require_credit_card": false, - "price_in_cents": 190, - "interval": 174, - "interval_unit": "day", - "auto_create_signup_page": false, - "tax_code": "tax_code6" -} -``` - + +# Create or Update Product + +## Structure + +`CreateOrUpdateProduct` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | The product name | +| `Handle` | `*string` | Optional | The product API handle | +| `Description` | `string` | Required | The product description | +| `AccountingCode` | `*string` | Optional | E.g. Internal ID or SKU Number | +| `RequireCreditCard` | `*bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | +| `PriceInCents` | `int64` | 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 | +| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | +| `AutoCreateSignupPage` | `*bool` | Optional | - | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
**Constraints**: *Maximum Length*: `10` | + +## Example (as JSON) + +```json +{ + "name": "name8", + "handle": "handle4", + "description": "description8", + "accounting_code": "accounting_code4", + "require_credit_card": false, + "price_in_cents": 190, + "interval": 174, + "interval_unit": "day", + "auto_create_signup_page": false, + "tax_code": "tax_code6" +} +``` + diff --git a/doc/models/create-or-update-segment-price.md b/doc/models/create-or-update-segment-price.md index 0956c1dd..08d03844 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -1,28 +1,28 @@ - -# Create or Update Segment Price - -## Structure - -`CreateOrUpdateSegmentPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `StartingQuantity` | `*int` | Optional | - | -| `EndingQuantity` | `*int` | Optional | - | -| `UnitPrice` | `interface{}` | Required | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | - -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Create or Update Segment Price + +## Structure + +`CreateOrUpdateSegmentPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `StartingQuantity` | `*int` | Optional | - | +| `EndingQuantity` | `*int` | Optional | - | +| `UnitPrice` | `interface{}` | Required | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | + +## Example (as JSON) + +```json +{ + "starting_quantity": 78, + "ending_quantity": 52, + "unit_price": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/create-payment-profile-request.md b/doc/models/create-payment-profile-request.md index 9549e5a2..a2e2d299 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -1,29 +1,28 @@ - -# Create Payment Profile Request - -## Structure - -`CreatePaymentProfileRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfile` | [`models.CreatePaymentProfile`](../../doc/models/create-payment-profile.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "payment_type": "credit_card", - "full_number": "5424000000000015", - "bank_account_type": "checking", - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2" - } -} -``` - + +# Create Payment Profile Request + +## Structure + +`CreatePaymentProfileRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfile` | [`models.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": "bank_account", + "first_name": "first_name4", + "last_name": "last_name2" + } +} +``` + diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index f6c8e622..e33684b6 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -1,58 +1,57 @@ - -# Create Payment Profile - -## Structure - -`CreatePaymentProfile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyToken` | `*string` | Optional | Token received after sending billing informations using chargify.js. | -| `Id` | `*int` | Optional | - | -| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | **Default**: `"credit_card"` | -| `FirstName` | `*string` | Optional | First name on card or bank account. If omitted, the first_name from customer attributes will be used. | -| `LastName` | `*string` | Optional | Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | -| `MaskedCardNumber` | `*string` | Optional | - | -| `FullNumber` | `*string` | Optional | The full credit card number | -| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `ExpirationMonth` | `*interface{}` | 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 | -| `ExpirationYear` | `*interface{}` | 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 | -| `BillingAddress` | `*string` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `BillingAddress2` | `Optional[string]` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | -| `BillingCity` | `*string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `BillingState` | `*string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `BillingCountry` | `*string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `BillingZip` | `*string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `VaultToken` | `*string` | Optional | The “token” provided by your vault storage for an already stored payment profile | -| `CustomerVaultToken` | `*string` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | -| `CustomerId` | `*int` | Optional | (Required when creating a new payment profile) The Chargify customer id. | -| `PaypalEmail` | `*string` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | -| `PaymentMethodNonce` | `*string` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | -| `GatewayHandle` | `*string` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | -| `Cvv` | `*string` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | -| `BankName` | `*string` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | -| `BankIban` | `*string` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | -| `BankRoutingNumber` | `*string` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `BankAccountNumber` | `*string` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is blank) The customerʼs bank account number | -| `BankBranchCode` | `*string` | Optional | (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. Alternatively, an IBAN can be provided | -| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking
**Default**: `"checking"` | -| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | -| `LastFour` | `*string` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | - -## Example (as JSON) - -```json -{ - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "payment_type": "credit_card", - "full_number": "5424000000000015", - "bank_account_type": "checking", - "id": 76, - "first_name": "first_name8", - "last_name": "last_name6" -} -``` - + +# Create Payment Profile + +## Structure + +`CreatePaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyToken` | `*string` | Optional | Token received after sending billing informations using chargify.js. | +| `Id` | `*int` | Optional | - | +| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | - | +| `FirstName` | `*string` | Optional | First name on card or bank account. If omitted, the first_name from customer attributes will be used. | +| `LastName` | `*string` | Optional | Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | +| `MaskedCardNumber` | `*string` | Optional | - | +| `FullNumber` | `*string` | Optional | The full credit card number | +| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | +| `ExpirationMonth` | `*interface{}` | 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 | +| `ExpirationYear` | `*interface{}` | 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 | +| `BillingAddress` | `*string` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | +| `BillingAddress2` | `Optional[string]` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | +| `BillingCity` | `*string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | +| `BillingState` | `*string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `BillingCountry` | `*string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `BillingZip` | `*string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | +| `VaultToken` | `*string` | Optional | The “token” provided by your vault storage for an already stored payment profile | +| `CustomerVaultToken` | `*string` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | +| `CustomerId` | `*int` | Optional | (Required when creating a new payment profile) The Chargify customer id. | +| `PaypalEmail` | `*string` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | +| `PaymentMethodNonce` | `*string` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | +| `GatewayHandle` | `*string` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | +| `Cvv` | `*string` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | +| `BankName` | `*string` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | +| `BankIban` | `*string` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | +| `BankRoutingNumber` | `*string` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `BankAccountNumber` | `*string` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is blank) The customerʼs bank account number | +| `BankBranchCode` | `*string` | Optional | (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. Alternatively, an IBAN can be provided | +| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | +| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | +| `LastFour` | `*string` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | + +## Example (as JSON) + +```json +{ + "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", + "full_number": "5424000000000015", + "id": 76, + "payment_type": "paypal_account", + "first_name": "first_name8", + "last_name": "last_name6" +} +``` + diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index f5ecb33a..f24d0dbd 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -1,27 +1,27 @@ - -# Create Payment - -## Structure - -`CreatePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `string` | Required | - | -| `Memo` | `string` | Required | - | -| `PaymentDetails` | `string` | Required | - | -| `PaymentMethod` | `string` | Required | - | - -## Example (as JSON) - -```json -{ - "amount": "amount6", - "memo": "memo8", - "payment_details": "payment_details4", - "payment_method": "payment_method6" -} -``` - + +# Create Payment + +## Structure + +`CreatePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `string` | Required | - | +| `Memo` | `string` | Required | - | +| `PaymentDetails` | `string` | Required | - | +| `PaymentMethod` | `string` | Required | - | + +## Example (as JSON) + +```json +{ + "amount": "amount6", + "memo": "memo8", + "payment_details": "payment_details4", + "payment_method": "payment_method6" +} +``` + diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index 1cc3cd74..e13f5a80 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -1,28 +1,28 @@ - -# Create Prepaid Component - -## Structure - -`CreatePrepaidComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PrepaidUsageComponent` | [`models.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" - } -} -``` - + +# Create Prepaid Component + +## Structure + +`CreatePrepaidComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PrepaidUsageComponent` | [`models.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" + } +} +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 15aa5912..e25c41c0 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -1,27 +1,27 @@ - -# Create Prepayment Request - -## Structure - -`CreatePrepaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayment` | [`models.CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 11.6, - "details": "details8", - "memo": "memo2", - "method": "cash", - "payment_profile_id": 240 - } -} -``` - + +# Create Prepayment Request + +## Structure + +`CreatePrepaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayment` | [`models.CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "prepayment": { + "amount": 11.6, + "details": "details8", + "memo": "memo2", + "method": "cash", + "payment_profile_id": 240 + } +} +``` + diff --git a/doc/models/create-prepayment-response.md b/doc/models/create-prepayment-response.md index 518486d1..63a89696 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -1,27 +1,27 @@ - -# Create Prepayment Response - -## Structure - -`CreatePrepaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayment` | [`models.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": "created_at6" - } -} -``` - + +# Create Prepayment Response + +## Structure + +`CreatePrepaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayment` | [`models.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": "created_at6" + } +} +``` + diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index 6f133c73..6e186ab6 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -1,29 +1,29 @@ - -# Create Prepayment - -## Structure - -`CreatePrepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `float64` | Required | - | -| `Details` | `string` | Required | - | -| `Memo` | `string` | Required | - | -| `Method` | [`models.PrepaymentMethod`](../../doc/models/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. | -| `PaymentProfileId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "paypal_account", - "payment_profile_id": 240 -} -``` - + +# Create Prepayment + +## Structure + +`CreatePrepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `float64` | Required | - | +| `Details` | `string` | Required | - | +| `Memo` | `string` | Required | - | +| `Method` | [`models.PrepaymentMethod`](../../doc/models/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. | +| `PaymentProfileId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "amount": 23.92, + "details": "details6", + "memo": "memo0", + "method": "paypal_account", + "payment_profile_id": 240 +} +``` + diff --git a/doc/models/create-product-currency-price.md b/doc/models/create-product-currency-price.md index a0b29d5e..94259240 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -1,25 +1,25 @@ - -# Create Product Currency Price - -## Structure - -`CreateProductCurrencyPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Currency` | `string` | Required | ISO code for one of the site level currencies. | -| `Price` | `int` | Required | Price for the given role. | -| `Role` | [`models.CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | - -## Example (as JSON) - -```json -{ - "currency": "currency0", - "price": 222, - "role": "baseline" -} -``` - + +# Create Product Currency Price + +## Structure + +`CreateProductCurrencyPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Currency` | `string` | Required | ISO code for one of the site level currencies. | +| `Price` | `int` | Required | Price for the given role. | +| `Role` | [`models.CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | + +## Example (as JSON) + +```json +{ + "currency": "currency0", + "price": 222, + "role": "baseline" +} +``` + diff --git a/doc/models/create-product-currency-prices-request.md b/doc/models/create-product-currency-prices-request.md index 7b9ab481..9590cf62 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -1,27 +1,27 @@ - -# Create Product Currency Prices Request - -## Structure - -`CreateProductCurrencyPricesRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.CreateProductCurrencyPrice`](../../doc/models/create-product-currency-price.md) | Required | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78, - "role": "initial" - } - ] -} -``` - + +# Create Product Currency Prices Request + +## Structure + +`CreateProductCurrencyPricesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.CreateProductCurrencyPrice`](../../doc/models/create-product-currency-price.md) | Required | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "currency": "currency8", + "price": 78, + "role": "initial" + } + ] +} +``` + diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index ce26c455..86b23579 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -1,24 +1,24 @@ - -# Create Product Family Request - -## Structure - -`CreateProductFamilyRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductFamily` | [`models.CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | - -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "description": "description0" - } -} -``` - + +# Create Product Family Request + +## Structure + +`CreateProductFamilyRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductFamily` | [`models.CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | + +## Example (as JSON) + +```json +{ + "product_family": { + "name": "name0", + "description": "description0" + } +} +``` + diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index 2b9a40c0..e6dd615b 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -1,23 +1,23 @@ - -# Create Product Family - -## Structure - -`CreateProductFamily` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name6", - "description": "description6" -} -``` - + +# Create Product Family + +## Structure + +`CreateProductFamily` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name6", + "description": "description6" +} +``` + diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index a4d8de9b..6afe2a60 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -1,32 +1,32 @@ - -# Create Product Price Point Request - -## Structure - -`CreateProductPricePointRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`models.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": "trial_type4" - } -} -``` - + +# Create Product Price Point Request + +## Structure + +`CreateProductPricePointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`models.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": "trial_type4" + } +} +``` + diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 153448d4..7b408e8d 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -1,43 +1,43 @@ - -# Create Product Price Point - -## Structure - -`CreateProductPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | The product price point name | -| `Handle` | `*string` | Optional | The product price point API handle | -| `PriceInCents` | `int64` | 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 | -| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | -| `TrialPriceInCents` | `*int64` | Optional | The product price point trial price, in integer cents | -| `TrialInterval` | `*int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | -| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `TrialType` | `*string` | Optional | - | -| `InitialChargeInCents` | `*int64` | Optional | The product price point initial charge, in integer cents | -| `InitialChargeAfterTrial` | `*bool` | Optional | - | -| `ExpirationInterval` | `*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 every 30 days | -| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | -| `UseSiteExchangeRate` | `*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": "trial_type0" -} -``` - + +# Create Product Price Point + +## Structure + +`CreateProductPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | The product price point name | +| `Handle` | `*string` | Optional | The product price point API handle | +| `PriceInCents` | `int64` | 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 | +| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | +| `TrialPriceInCents` | `*int64` | Optional | The product price point trial price, in integer cents | +| `TrialInterval` | `*int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | +| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | +| `TrialType` | `*string` | Optional | - | +| `InitialChargeInCents` | `*int64` | Optional | The product price point initial charge, in integer cents | +| `InitialChargeAfterTrial` | `*bool` | Optional | - | +| `ExpirationInterval` | `*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 every 30 days | +| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | +| `UseSiteExchangeRate` | `*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": "trial_type0" +} +``` + diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index 251a65be..6e4fb9ba 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -1,59 +1,59 @@ - -# Create Quantity Based Component - -## Structure - -`CreateQuantityBasedComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `QuantityBasedComponent` | [`models.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": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "prorated" - } -} -``` - + +# Create Quantity Based Component + +## Structure + +`CreateQuantityBasedComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `QuantityBasedComponent` | [`models.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": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "prorated" + } +} +``` + diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index 6f999969..cea73d8c 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -1,25 +1,25 @@ - -# Create Reason Code Request - -## Structure - -`CreateReasonCodeRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ReasonCode` | [`models.CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | - -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} -``` - + +# Create Reason Code Request + +## Structure + +`CreateReasonCodeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ReasonCode` | [`models.CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | + +## Example (as JSON) + +```json +{ + "reason_code": { + "code": "code4", + "description": "description6", + "position": 14 + } +} +``` + diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index 172da004..c86e0f84 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -1,25 +1,25 @@ - -# Create Reason Code - -## Structure - -`CreateReasonCode` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Code` | `string` | Required | The unique identifier for the ReasonCode | -| `Description` | `string` | 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 -} -``` - + +# Create Reason Code + +## Structure + +`CreateReasonCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Code` | `string` | Required | The unique identifier for the ReasonCode | +| `Description` | `string` | 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 +} +``` + diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index dfb16a15..03dbea09 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -1,65 +1,65 @@ - -# Create Segment Request - -## Structure - -`CreateSegmentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segment` | [`models.CreateSegment`](../../doc/models/create-segment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "segment": { - "segment_property_1_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_2_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_3_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_4_value": { - "key1": "val1", - "key2": "val2" - }, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } -} -``` - + +# Create Segment Request + +## Structure + +`CreateSegmentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segment` | [`models.CreateSegment`](../../doc/models/create-segment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "segment": { + "segment_property_1_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_2_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_3_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_4_value": { + "key1": "val1", + "key2": "val2" + }, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } +} +``` + diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index 2ed281a9..bc21bdf6 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -1,68 +1,68 @@ - -# Create Segment - -## Structure - -`CreateSegment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SegmentProperty1Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | -| `SegmentProperty2Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | -| `SegmentProperty3Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | -| `SegmentProperty4Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | -| `PricingScheme` | [`models.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` | [`[]models.CreateOrUpdateSegmentPrice`](../../doc/models/create-or-update-segment-price.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "segment_property_1_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_2_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_3_value": { - "key1": "val1", - "key2": "val2" - }, - "segment_property_4_value": { - "key1": "val1", - "key2": "val2" - }, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Create Segment + +## Structure + +`CreateSegment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SegmentProperty1Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | +| `SegmentProperty2Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | +| `SegmentProperty3Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | +| `SegmentProperty4Value` | `*interface{}` | Optional | A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. | +| `PricingScheme` | [`models.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` | [`[]models.CreateOrUpdateSegmentPrice`](../../doc/models/create-or-update-segment-price.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "segment_property_1_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_2_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_3_value": { + "key1": "val1", + "key2": "val2" + }, + "segment_property_4_value": { + "key1": "val1", + "key2": "val2" + }, + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/create-subscription-component.md b/doc/models/create-subscription-component.md index 3bc577ae..b59cb2ba 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -1,37 +1,37 @@ - -# Create Subscription Component - -## Structure - -`CreateSubscriptionComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*interface{}` | Optional | - | -| `Enabled` | `*bool` | Optional | Used for on/off components only. | -| `UnitBalance` | `*int` | Optional | Used for metered and events based components. | -| `AllocatedQuantity` | `*interface{}` | Optional | Used for quantity based components. | -| `Quantity` | `*int` | Optional | Deprecated. Use `allocated_quantity` instead. | -| `PricePointId` | `*interface{}` | Optional | - | -| `CustomPrice` | [`*models.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": { - "key1": "val1", - "key2": "val2" - }, - "enabled": false, - "unit_balance": 144, - "allocated_quantity": { - "key1": "val1", - "key2": "val2" - }, - "quantity": 188 -} -``` - + +# Create Subscription Component + +## Structure + +`CreateSubscriptionComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*interface{}` | Optional | - | +| `Enabled` | `*bool` | Optional | Used for on/off components only. | +| `UnitBalance` | `*int` | Optional | Used for metered and events based components. | +| `AllocatedQuantity` | `*interface{}` | Optional | Used for quantity based components. | +| `Quantity` | `*int` | Optional | Deprecated. Use `allocated_quantity` instead. | +| `PricePointId` | `*interface{}` | Optional | - | +| `CustomPrice` | [`*models.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": { + "key1": "val1", + "key2": "val2" + }, + "enabled": false, + "unit_balance": 144, + "allocated_quantity": { + "key1": "val1", + "key2": "val2" + }, + "quantity": 188 +} +``` + diff --git a/doc/models/create-subscription-group-request.md b/doc/models/create-subscription-group-request.md index 27cb31dd..a302c937 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -1,30 +1,30 @@ - -# Create Subscription Group Request - -## Structure - -`CreateSubscriptionGroupRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionGroup` | [`models.CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscription_id": { - "key1": "val1", - "key2": "val2" - }, - "member_ids": [ - 164, - 165 - ] - } -} -``` - + +# Create Subscription Group Request + +## Structure + +`CreateSubscriptionGroupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionGroup` | [`models.CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription_group": { + "subscription_id": { + "key1": "val1", + "key2": "val2" + }, + "member_ids": [ + 164, + 165 + ] + } +} +``` + diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index 2c584e4c..98c9ffbe 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -1,28 +1,28 @@ - -# Create Subscription Group - -## Structure - -`CreateSubscriptionGroup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionId` | `interface{}` | Required | - | -| `MemberIds` | `[]int` | Optional | - | - -## Example (as JSON) - -```json -{ - "subscription_id": { - "key1": "val1", - "key2": "val2" - }, - "member_ids": [ - 162 - ] -} -``` - + +# Create Subscription Group + +## Structure + +`CreateSubscriptionGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionId` | `interface{}` | Required | - | +| `MemberIds` | `[]int` | Optional | - | + +## Example (as JSON) + +```json +{ + "subscription_id": { + "key1": "val1", + "key2": "val2" + }, + "member_ids": [ + 162 + ] +} +``` + diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 4ed52a6d..aa9787fa 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -1,56 +1,56 @@ - -# Create Subscription Request - -## Structure - -`CreateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`models.CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription": { - "payment_collection_method": "automatic", - "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)\"", - "skip_billing_manifest_taxes": false, - "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": { - "key1": "val1", - "key2": "val2" - }, - "interval": { - "key1": "val1", - "key2": "val2" - }, - "interval_unit": "day", - "trial_price_in_cents": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval_unit": "day" - } - } -} -``` - + +# Create Subscription Request + +## Structure + +`CreateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`models.CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription": { + "payment_collection_method": "automatic", + "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)\"", + "skip_billing_manifest_taxes": false, + "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": { + "key1": "val1", + "key2": "val2" + }, + "interval": { + "key1": "val1", + "key2": "val2" + }, + "interval_unit": "day", + "trial_price_in_cents": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval_unit": "day" + } + } +} +``` + diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index e14ce38b..3ea9b50c 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -1,102 +1,102 @@ - -# Create Subscription - -## Structure - -`CreateSubscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductHandle` | `*string` | Optional | The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. | -| `ProductId` | `*int` | Optional | The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead. | -| `ProductPricePointHandle` | `*string` | Optional | The user-friendly API handle of a product's particular price point. | -| `ProductPricePointId` | `*int` | Optional | The ID of the particular price point on the product. | -| `CustomPrice` | [`*models.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 | -| `CouponCode` | `*string` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | -| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | -| `PaymentCollectionMethod` | [`*models.PaymentCollectionMethod`](../../doc/models/payment-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`.
**Default**: `"automatic"` | -| `ReceivesInvoiceEmails` | `*string` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | -| `NetTerms` | `*string` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | -| `CustomerId` | `*int` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | -| `NextBillingAt` | `*time.Time` | 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-chargify.zendesk.com/hc/en-us/articles/5404863655821#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. | -| `InitialBillingAt` | `*string` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. | -| `StoredCredentialTransactionId` | `*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. | -| `SalesRepId` | `*int` | Optional | - | -| `PaymentProfileId` | `*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` | `*string` | Optional | The reference value (provided by your app) for the subscription itelf. | -| `CustomerAttributes` | [`*models.CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | -| `PaymentProfileAttributes` | [`*models.PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | -| `CreditCardAttributes` | [`*models.PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | -| `BankAccountAttributes` | [`*models.BankAccountAttributes`](../../doc/models/bank-account-attributes.md) | Optional | - | -| `Components` | [`[]models.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-chargify.zendesk.com/hc/en-us/articles/5405020625677) for more information. | -| `CalendarBilling` | [`*models.CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | -| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -| `CustomerReference` | `*string` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | -| `Group` | [`*models.GroupSettings`](../../doc/models/group-settings.md) | Optional | - | -| `Ref` | `*string` | Optional | A valid referral code. (optional, see [Referrals](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405420204045-Referrals-Reference#how-to-obtain-referral-codes) for more details). If supplied, must be valid, or else subscription creation will fail. | -| `CancellationMessage` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about the reason for cancellation. | -| `CancellationMethod` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about how the subscription was canceled. | -| `Currency` | `*string` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | -| `ExpiresAt` | `*time.Time` | 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. | -| `ExpirationTracksNextBillingChange` | `*string` | Optional | (Optional, default false) When set to true, and when next_billing_at is present, if the subscription expires, the expires_at will be shifted by the same amount of time as the difference between the old and new “next billing” dates. | -| `AgreementTerms` | `*string` | Optional | (Optional) The ACH authorization agreement terms. If enabled, an email will be sent to the customer with a copy of the terms. | -| `AuthorizerFirstName` | `*string` | Optional | (Optional) The first name of the person authorizing the ACH agreement. | -| `AuthorizerLastName` | `*string` | Optional | (Optional) The last name of the person authorizing the ACH agreement. | -| `CalendarBillingFirstCharge` | `*string` | Optional | (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). | -| `ReasonCode` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. | -| `ProductChangeDelayed` | `*bool` | Optional | (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | -| `OfferId` | `*interface{}` | 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:`.er | -| `PrepaidConfiguration` | [`*models.UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Optional | - | -| `PreviousBillingAt` | `*time.Time` | Optional | Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. | -| `ImportMrr` | `*bool` | Optional | Setting this attribute to true will cause the subscription's MRR to be added to your MRR analytics immediately. For this value to be honored, a next_billing_at must be present and set to a future date. This key/value will not be returned in the subscription response body. | -| `CanceledAt` | `*string` | Optional | - | -| `ActivatedAt` | `*time.Time` | Optional | - | -| `AgreementAcceptance` | [`*models.AgreementAcceptance`](../../doc/models/agreement-acceptance.md) | Optional | Required when creating a subscription with Maxio Payments. | -| `AchAgreement` | [`*models.ACHAgreement`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | -| `DunningCommunicationDelayEnabled` | `Optional[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.
**Default**: `false` | -| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | -| `SkipBillingManifestTaxes` | `*bool` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
**Default**: `false` | - -## Example (as JSON) - -```json -{ - "payment_collection_method": "automatic", - "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)\"", - "skip_billing_manifest_taxes": false, - "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": { - "key1": "val1", - "key2": "val2" - }, - "interval": { - "key1": "val1", - "key2": "val2" - }, - "interval_unit": "day", - "trial_price_in_cents": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval_unit": "day" - } -} -``` - + +# Create Subscription + +## Structure + +`CreateSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductHandle` | `*string` | Optional | The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. | +| `ProductId` | `*int` | Optional | The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead. | +| `ProductPricePointHandle` | `*string` | Optional | The user-friendly API handle of a product's particular price point. | +| `ProductPricePointId` | `*int` | Optional | The ID of the particular price point on the product. | +| `CustomPrice` | [`*models.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 | +| `CouponCode` | `*string` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | +| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | +| `PaymentCollectionMethod` | [`*models.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`.
**Default**: `"automatic"` | +| `ReceivesInvoiceEmails` | `*string` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | +| `NetTerms` | `*string` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | +| `CustomerId` | `*int` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | +| `NextBillingAt` | `*time.Time` | 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-chargify.zendesk.com/hc/en-us/articles/5404863655821#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. | +| `InitialBillingAt` | `*time.Time` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. | +| `StoredCredentialTransactionId` | `*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. | +| `SalesRepId` | `*int` | Optional | - | +| `PaymentProfileId` | `*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` | `*string` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `CustomerAttributes` | [`*models.CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | +| `PaymentProfileAttributes` | [`*models.PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | +| `CreditCardAttributes` | [`*models.PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | +| `BankAccountAttributes` | [`*models.BankAccountAttributes`](../../doc/models/bank-account-attributes.md) | Optional | - | +| `Components` | [`[]models.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-chargify.zendesk.com/hc/en-us/articles/5405020625677) for more information. | +| `CalendarBilling` | [`*models.CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | +| `CustomerReference` | `*string` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | +| `Group` | [`*models.GroupSettings`](../../doc/models/group-settings.md) | Optional | - | +| `Ref` | `*string` | Optional | A valid referral code. (optional, see [Referrals](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405420204045-Referrals-Reference#how-to-obtain-referral-codes) for more details). If supplied, must be valid, or else subscription creation will fail. | +| `CancellationMessage` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about the reason for cancellation. | +| `CancellationMethod` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about how the subscription was canceled. | +| `Currency` | `*string` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | +| `ExpiresAt` | `*time.Time` | 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. | +| `ExpirationTracksNextBillingChange` | `*string` | Optional | (Optional, default false) When set to true, and when next_billing_at is present, if the subscription expires, the expires_at will be shifted by the same amount of time as the difference between the old and new “next billing” dates. | +| `AgreementTerms` | `*string` | Optional | (Optional) The ACH authorization agreement terms. If enabled, an email will be sent to the customer with a copy of the terms. | +| `AuthorizerFirstName` | `*string` | Optional | (Optional) The first name of the person authorizing the ACH agreement. | +| `AuthorizerLastName` | `*string` | Optional | (Optional) The last name of the person authorizing the ACH agreement. | +| `CalendarBillingFirstCharge` | `*string` | Optional | (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). | +| `ReasonCode` | `*string` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. | +| `ProductChangeDelayed` | `*bool` | Optional | (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | +| `OfferId` | `*interface{}` | 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:`.er | +| `PrepaidConfiguration` | [`*models.UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Optional | - | +| `PreviousBillingAt` | `*time.Time` | Optional | Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. | +| `ImportMrr` | `*bool` | Optional | Setting this attribute to true will cause the subscription's MRR to be added to your MRR analytics immediately. For this value to be honored, a next_billing_at must be present and set to a future date. This key/value will not be returned in the subscription response body. | +| `CanceledAt` | `*string` | Optional | - | +| `ActivatedAt` | `*time.Time` | Optional | - | +| `AgreementAcceptance` | [`*models.AgreementAcceptance`](../../doc/models/agreement-acceptance.md) | Optional | Required when creating a subscription with Maxio Payments. | +| `AchAgreement` | [`*models.ACHAgreement`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | +| `DunningCommunicationDelayEnabled` | `Optional[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.
**Default**: `false` | +| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | +| `SkipBillingManifestTaxes` | `*bool` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
**Default**: `false` | + +## Example (as JSON) + +```json +{ + "payment_collection_method": "automatic", + "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)\"", + "skip_billing_manifest_taxes": false, + "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": { + "key1": "val1", + "key2": "val2" + }, + "interval": { + "key1": "val1", + "key2": "val2" + }, + "interval_unit": "day", + "trial_price_in_cents": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval_unit": "day" + } +} +``` + diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 97930a87..a2101543 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -1,28 +1,28 @@ - -# Create Usage Request - -## Structure - -`CreateUsageRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Usage` | [`models.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-13T12:52:32.123Z" - } - } -} -``` - + +# Create Usage Request + +## Structure + +`CreateUsageRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Usage` | [`models.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-13T12:52:32.123Z" + } + } +} +``` + diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 9ec044f9..c4602724 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -1,29 +1,29 @@ - -# Create Usage - -## Structure - -`CreateUsage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Quantity` | `*float64` | Optional | integer by default or decimal number if fractional quantities are enabled for the component | -| `PricePointId` | `*string` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `BillingSchedule` | [`*models.BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | - -## Example (as JSON) - -```json -{ - "quantity": 23.44, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13T12:52:32.123Z" - } -} -``` - + +# Create Usage + +## Structure + +`CreateUsage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Quantity` | `*float64` | Optional | integer by default or decimal number if fractional quantities are enabled for the component | +| `PricePointId` | `*string` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `BillingSchedule` | [`*models.BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | + +## Example (as JSON) + +```json +{ + "quantity": 23.44, + "price_point_id": "price_point_id0", + "memo": "memo2", + "billing_schedule": { + "initial_billing_at": "2016-03-13T12:52:32.123Z" + } +} +``` + diff --git a/doc/models/created-prepayment.md b/doc/models/created-prepayment.md index 928db699..6fda1348 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -1,31 +1,31 @@ - -# Created Prepayment - -## Structure - -`CreatedPrepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `AmountInCents` | `*int64` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `StartingBalanceInCents` | `*int64` | Optional | - | -| `EndingBalanceInCents` | `*int64` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 110, - "subscription_id": 220, - "amount_in_cents": 196, - "memo": "memo6", - "created_at": "created_at0" -} -``` - + +# Created Prepayment + +## Structure + +`CreatedPrepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `AmountInCents` | `*int64` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `StartingBalanceInCents` | `*int64` | Optional | - | +| `EndingBalanceInCents` | `*int64` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 110, + "subscription_id": 220, + "amount_in_cents": 196, + "memo": "memo6", + "created_at": "created_at0" +} +``` + diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index 16ab33e5..c06a2236 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -1,25 +1,25 @@ - -# Credit Card Attributes - -## Structure - -`CreditCardAttributes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FullNumber` | `*string` | Optional | - | -| `ExpirationMonth` | `*string` | Optional | - | -| `ExpirationYear` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} -``` - + +# Credit Card Attributes + +## Structure + +`CreditCardAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FullNumber` | `*string` | Optional | - | +| `ExpirationMonth` | `*string` | Optional | - | +| `ExpirationYear` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "full_number": "full_number0", + "expiration_month": "expiration_month6", + "expiration_year": "expiration_year0" +} +``` + diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 41df8058..2edcd9ad 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -1,61 +1,61 @@ - -# Credit Card Payment Profile - -## Structure - -`CreditCardPaymentProfile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `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. | -| `FirstName` | `*string` | Optional | The first name of the card holder. | -| `LastName` | `*string` | Optional | The last name of the card holder. | -| `MaskedCardNumber` | `string` | Required | 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’). | -| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `ExpirationMonth` | `*int` | Optional | An integer representing the expiration month of the card(1 – 12). | -| `ExpirationYear` | `*int` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | -| `CustomerId` | `*int` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | -| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `VaultToken` | `Optional[string]` | Optional | The “token” provided by your vault storage for an already stored payment profile. | -| `BillingAddress` | `Optional[string]` | Optional | The current billing street address for the card. | -| `BillingCity` | `Optional[string]` | Optional | The current billing address city for the card. | -| `BillingState` | `Optional[string]` | Optional | The current billing address state for the card. | -| `BillingZip` | `Optional[string]` | Optional | The current billing address zip code for the card. | -| `BillingCountry` | `Optional[string]` | Optional | The current billing address country for the card. | -| `CustomerVaultToken` | `Optional[string]` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | -| `BillingAddress2` | `Optional[string]` | Optional | The current billing street address, second line, for the card. | -| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | **Default**: `"credit_card"` | -| `Disabled` | `*bool` | Optional | - | -| `ChargifyToken` | `*string` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | -| `SiteGatewaySettingId` | `Optional[int]` | Optional | - | -| `GatewayHandle` | `Optional[string]` | Optional | An identifier of connected gateway. | - -## 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 -} -``` - + +# Credit Card Payment Profile + +## Structure + +`CreditCardPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `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. | +| `FirstName` | `*string` | Optional | The first name of the card holder. | +| `LastName` | `*string` | Optional | The last name of the card holder. | +| `MaskedCardNumber` | `string` | Required | 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’). | +| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | +| `ExpirationMonth` | `*int` | Optional | An integer representing the expiration month of the card(1 – 12). | +| `ExpirationYear` | `*int` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | +| `CustomerId` | `*int` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | +| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | +| `VaultToken` | `Optional[string]` | Optional | The “token” provided by your vault storage for an already stored payment profile. | +| `BillingAddress` | `Optional[string]` | Optional | The current billing street address for the card. | +| `BillingCity` | `Optional[string]` | Optional | The current billing address city for the card. | +| `BillingState` | `Optional[string]` | Optional | The current billing address state for the card. | +| `BillingZip` | `Optional[string]` | Optional | The current billing address zip code for the card. | +| `BillingCountry` | `Optional[string]` | Optional | The current billing address country for the card. | +| `CustomerVaultToken` | `Optional[string]` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | +| `BillingAddress2` | `Optional[string]` | Optional | The current billing street address, second line, for the card. | +| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | - | +| `Disabled` | `*bool` | Optional | - | +| `ChargifyToken` | `*string` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `SiteGatewaySettingId` | `Optional[int]` | Optional | - | +| `GatewayHandle` | `Optional[string]` | Optional | An identifier of connected gateway. | + +## 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 +} +``` + diff --git a/doc/models/credit-note-1.md b/doc/models/credit-note-1.md index 871ae35b..e2c86dc1 100644 --- a/doc/models/credit-note-1.md +++ b/doc/models/credit-note-1.md @@ -1,51 +1,51 @@ - -# Credit Note 1 - -## Structure - -`CreditNote1` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | -| `SiteId` | `*int` | Optional | ID of the site to which the credit note belongs. | -| `CustomerId` | `*int` | Optional | ID of the customer to which the credit note belongs. | -| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the credit note. | -| `Number` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it 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. | -| `SequenceNumber` | `*int` | Optional | A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. | -| `IssueDate` | `*string` | Optional | Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied.

The format is `"YYYY-MM-DD"`. | -| `AppliedDate` | `*string` | Optional | Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.

If the credit note has been partially applied, this field will not have a value until it has been fully applied.

The format is `"YYYY-MM-DD"`. | -| `Status` | `*string` | Optional | Current status of the credit note. Valid values:

* open
* applied | -| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | -| `Memo` | `*string` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | -| `Seller` | [`*models.Seller`](../../doc/models/seller.md) | Optional | - | -| `Customer` | [`*models.Customer1`](../../doc/models/customer-1.md) | Optional | - | -| `BillingAddress` | [`*models.BillingAddress`](../../doc/models/billing-address.md) | Optional | - | -| `ShippingAddress` | [`*models.ShippingAddress`](../../doc/models/shipping-address.md) | Optional | - | -| `SubtotalAmount` | `*string` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | -| `DiscountAmount` | `*string` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | -| `TaxAmount` | `*string` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | -| `TotalAmount` | `*string` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | -| `AppliedAmount` | `*string` | Optional | The amount of the credit note that has already been applied to invoices. | -| `RemainingAmount` | `*string` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | -| `LineItems` | [`[]models.CreditNoteLineItem`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | -| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | -| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | -| `Applications` | [`[]models.CreditNoteApplication`](../../doc/models/credit-note-application.md) | Optional | - | -| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | -| `OriginInvoices` | [`[]models.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://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "site_id": 120, - "customer_id": 232, - "subscription_id": 48, - "number": "number6" -} -``` - + +# Credit Note 1 + +## Structure + +`CreditNote1` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | +| `SiteId` | `*int` | Optional | ID of the site to which the credit note belongs. | +| `CustomerId` | `*int` | Optional | ID of the customer to which the credit note belongs. | +| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the credit note. | +| `Number` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it 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. | +| `SequenceNumber` | `*int` | Optional | A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. | +| `IssueDate` | `*time.Time` | Optional | Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied.

The format is `"YYYY-MM-DD"`. | +| `AppliedDate` | `*time.Time` | Optional | Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.

If the credit note has been partially applied, this field will not have a value until it has been fully applied.

The format is `"YYYY-MM-DD"`. | +| `Status` | [`*models.CreditNoteStatus`](../../doc/models/credit-note-status.md) | Optional | Current status of the credit note. | +| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | +| `Memo` | `*string` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | +| `Seller` | [`*models.Seller`](../../doc/models/seller.md) | Optional | - | +| `Customer` | [`*models.Customer1`](../../doc/models/customer-1.md) | Optional | - | +| `BillingAddress` | [`*models.BillingAddress`](../../doc/models/billing-address.md) | Optional | - | +| `ShippingAddress` | [`*models.ShippingAddress`](../../doc/models/shipping-address.md) | Optional | - | +| `SubtotalAmount` | `*string` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | +| `DiscountAmount` | `*string` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | +| `TaxAmount` | `*string` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | +| `TotalAmount` | `*string` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `AppliedAmount` | `*string` | Optional | The amount of the credit note that has already been applied to invoices. | +| `RemainingAmount` | `*string` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | +| `LineItems` | [`[]models.CreditNoteLineItem`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | +| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | +| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | +| `Applications` | [`[]models.CreditNoteApplication`](../../doc/models/credit-note-application.md) | Optional | - | +| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | +| `OriginInvoices` | [`[]models.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://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "site_id": 120, + "customer_id": 232, + "subscription_id": 48, + "number": "number6" +} +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index ecebc81b..bee3768e 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -1,29 +1,29 @@ - -# Credit Note Application - -## Structure - -`CreditNoteApplication` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `TransactionTime` | `*string` | Optional | - | -| `InvoiceUid` | `*string` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `AppliedAmount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "transaction_time": "transaction_time2", - "invoice_uid": "invoice_uid0", - "memo": "memo4", - "applied_amount": "applied_amount8" -} -``` - + +# Credit Note Application + +## Structure + +`CreditNoteApplication` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `TransactionTime` | `*string` | Optional | - | +| `InvoiceUid` | `*string` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `AppliedAmount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "transaction_time": "transaction_time2", + "invoice_uid": "invoice_uid0", + "memo": "memo4", + "applied_amount": "applied_amount8" +} +``` + diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 1ef52a01..c9098239 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -1,40 +1,40 @@ - -# Credit Note Line Item - -## Structure - -`CreditNoteLineItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | -| `Title` | `*string` | Optional | A short descriptor for the credit given by this line. | -| `Description` | `*string` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

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

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

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

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

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | -| `TotalAmount` | `*string` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | -| `TieredUnitPrice` | `*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. | -| `PeriodRangeStart` | `*string` | Optional | Start date for the period credited by this line. The format is `"YYYY-MM-DD"`. | -| `PeriodRangeEnd` | `*string` | Optional | End date for the period credited by this line. The format is `"YYYY-MM-DD"`. | -| `ProductId` | `*int` | Optional | The ID of the product being credited.

This may be set even for component credits, so true product-only (non-component) credits will also have a nil `component_id`. | -| `ProductVersion` | `*int` | Optional | The version of the product being credited. | -| `ComponentId` | `Optional[int]` | Optional | The ID of the component being credited. Will be `nil` for non-component credits. | -| `PricePointId` | `Optional[int]` | Optional | The price point ID of the component being credited. Will be `nil` for non-component credits. | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": "quantity0", - "unit_price": "unit_price2" -} -``` - + +# Credit Note Line Item + +## Structure + +`CreditNoteLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `Title` | `*string` | Optional | A short descriptor for the credit given by this line. | +| `Description` | `*string` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

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

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

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

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

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | +| `TotalAmount` | `*string` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | +| `TieredUnitPrice` | `*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. | +| `PeriodRangeStart` | `*string` | Optional | Start date for the period credited by this line. The format is `"YYYY-MM-DD"`. | +| `PeriodRangeEnd` | `*string` | Optional | End date for the period credited by this line. The format is `"YYYY-MM-DD"`. | +| `ProductId` | `*int` | Optional | The ID of the product being credited.

This may be set even for component credits, so true product-only (non-component) credits will also have a nil `component_id`. | +| `ProductVersion` | `*int` | Optional | The version of the product being credited. | +| `ComponentId` | `Optional[int]` | Optional | The ID of the component being credited. Will be `nil` for non-component credits. | +| `PricePointId` | `Optional[int]` | Optional | The price point ID of the component being credited. Will be `nil` for non-component credits. | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "title": "title0", + "description": "description6", + "quantity": "quantity0", + "unit_price": "unit_price2" +} +``` + diff --git a/doc/models/credit-note-status.md b/doc/models/credit-note-status.md new file mode 100644 index 00000000..91494c0f --- /dev/null +++ b/doc/models/credit-note-status.md @@ -0,0 +1,16 @@ + +# Credit Note Status + +Current status of the credit note. + +## Enumeration + +`CreditNoteStatus` + +## Fields + +| Name | +| --- | +| `OPEN` | +| `APPLIED` | + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index 436c31fb..2444b2ab 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -1,51 +1,51 @@ - -# Credit Note - -## Structure - -`CreditNote` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | -| `SiteId` | `*int` | Optional | ID of the site to which the credit note belongs. | -| `CustomerId` | `*int` | Optional | ID of the customer to which the credit note belongs. | -| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the credit note. | -| `Number` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it 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. | -| `SequenceNumber` | `*int` | Optional | A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. | -| `IssueDate` | `*string` | Optional | Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied.

The format is `"YYYY-MM-DD"`. | -| `AppliedDate` | `*string` | Optional | Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.

If the credit note has been partially applied, this field will not have a value until it has been fully applied.

The format is `"YYYY-MM-DD"`. | -| `Status` | `*string` | Optional | Current status of the credit note. Valid values:

* open
* applied | -| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | -| `Memo` | `*string` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | -| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | -| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | -| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | -| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | -| `SubtotalAmount` | `*string` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | -| `DiscountAmount` | `*string` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | -| `TaxAmount` | `*string` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | -| `TotalAmount` | `*string` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | -| `AppliedAmount` | `*string` | Optional | The amount of the credit note that has already been applied to invoices. | -| `RemainingAmount` | `*string` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | -| `LineItems` | [`[]models.CreditNoteLineItem`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | -| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | -| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | -| `Applications` | [`[]models.CreditNoteApplication`](../../doc/models/credit-note-application.md) | Optional | - | -| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | -| `OriginInvoices` | [`[]models.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://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 218, - "customer_id": 74, - "subscription_id": 146, - "number": "number0" -} -``` - + +# Credit Note + +## Structure + +`CreditNote` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | +| `SiteId` | `*int` | Optional | ID of the site to which the credit note belongs. | +| `CustomerId` | `*int` | Optional | ID of the customer to which the credit note belongs. | +| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the credit note. | +| `Number` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it 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. | +| `SequenceNumber` | `*int` | Optional | A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. | +| `IssueDate` | `*time.Time` | Optional | Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied.

The format is `"YYYY-MM-DD"`. | +| `AppliedDate` | `*time.Time` | Optional | Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.

If the credit note has been partially applied, this field will not have a value until it has been fully applied.

The format is `"YYYY-MM-DD"`. | +| `Status` | [`*models.CreditNoteStatus`](../../doc/models/credit-note-status.md) | Optional | Current status of the credit note. | +| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | +| `Memo` | `*string` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | +| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | +| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | +| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | +| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | +| `SubtotalAmount` | `*string` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | +| `DiscountAmount` | `*string` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | +| `TaxAmount` | `*string` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | +| `TotalAmount` | `*string` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `AppliedAmount` | `*string` | Optional | The amount of the credit note that has already been applied to invoices. | +| `RemainingAmount` | `*string` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | +| `LineItems` | [`[]models.CreditNoteLineItem`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | +| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | +| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | +| `Applications` | [`[]models.CreditNoteApplication`](../../doc/models/credit-note-application.md) | Optional | - | +| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | +| `OriginInvoices` | [`[]models.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://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "site_id": 218, + "customer_id": 74, + "subscription_id": 146, + "number": "number0" +} +``` + diff --git a/doc/models/credit-scheme-request.md b/doc/models/credit-scheme-request.md index 1ec79363..657b19c4 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -1,21 +1,21 @@ - -# Credit Scheme Request - -## Structure - -`CreditSchemeRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CreditScheme` | [`models.CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | - -## Example (as JSON) - -```json -{ - "credit_scheme": "credit" -} -``` - + +# Credit Scheme Request + +## Structure + +`CreditSchemeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CreditScheme` | [`models.CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | + +## Example (as JSON) + +```json +{ + "credit_scheme": "credit" +} +``` + diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index fdf3956d..7c0076b0 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -1,15 +1,15 @@ - -# Credit Scheme - -## Enumeration - -`CreditScheme` - -## Fields - -| Name | -| --- | -| `NONE` | -| `CREDIT` | -| `REFUND` | - + +# Credit Scheme + +## Enumeration + +`CreditScheme` + +## Fields + +| Name | +| --- | +| `NONE` | +| `CREDIT` | +| `REFUND` | + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index b92ca7b7..cdc18531 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -1,18 +1,18 @@ - -# Credit Type - + +# Credit Type + The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. -Available values: `full`, `prorated`, `none`. - -## Enumeration - -`CreditType` - -## Fields - -| Name | -| --- | -| `FULL` | -| `PRORATED` | -| `NONE` | - +Available values: `full`, `prorated`, `none`. + +## Enumeration + +`CreditType` + +## Fields + +| Name | +| --- | +| `FULL` | +| `PRORATED` | +| `NONE` | + diff --git a/doc/models/currency-price-role.md b/doc/models/currency-price-role.md index 32d78475..8f089134 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -1,17 +1,17 @@ - -# Currency Price Role - -Role for the price. - -## Enumeration - -`CurrencyPriceRole` - -## Fields - -| Name | -| --- | -| `BASELINE` | -| `TRIAL` | -| `INITIAL` | - + +# Currency Price Role + +Role for the price. + +## Enumeration + +`CurrencyPriceRole` + +## Fields + +| Name | +| --- | +| `BASELINE` | +| `TRIAL` | +| `INITIAL` | + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index ae33e5f2..99f0e5dc 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -1,30 +1,30 @@ - -# Currency Price - -## Structure - -`CurrencyPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `Price` | `*float64` | Optional | - | -| `FormattedPrice` | `*string` | Optional | - | -| `ProductPricePointId` | `*int` | Optional | - | -| `Role` | [`*models.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", - "product_price_point_id": 210 -} -``` - + +# Currency Price + +## Structure + +`CurrencyPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `Price` | `*float64` | Optional | - | +| `FormattedPrice` | `*string` | Optional | - | +| `ProductPricePointId` | `*int` | Optional | - | +| `Role` | [`*models.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", + "product_price_point_id": 210 +} +``` + diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index 4cd95fb1..1d0c5647 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -1,29 +1,29 @@ - -# Currency Prices Response - -## Structure - -`CurrencyPricesResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.CurrencyPrice`](../../doc/models/currency-price.md) | Required | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "formatted_price": "formatted_price6", - "product_price_point_id": 172 - } - ] -} -``` - + +# Currency Prices Response + +## Structure + +`CurrencyPricesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.CurrencyPrice`](../../doc/models/currency-price.md) | Required | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "id": 50, + "currency": "currency8", + "price": 233.74, + "formatted_price": "formatted_price6", + "product_price_point_id": 172 + } + ] +} +``` + diff --git a/doc/models/current-vault.md b/doc/models/current-vault.md index 30a70aac..24c3b892 100644 --- a/doc/models/current-vault.md +++ b/doc/models/current-vault.md @@ -1,41 +1,41 @@ - -# Current Vault - -The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - -## Enumeration - -`CurrentVault` - -## Fields - -| Name | -| --- | -| `ADYEN` | -| `AUTHORIZENET` | -| `AVALARA` | -| `BEANSTREAM` | -| `BLUESNAP` | -| `BOGUS` | -| `BRAINTREEBLUE` | -| `CHECKOUT` | -| `CYBERSOURCE` | -| `ELAVON` | -| `EWAY` | -| `EWAYRAPIDSTD` | -| `FIRSTDATA` | -| `FORTE` | -| `GOCARDLESS` | -| `LITLE` | -| `MAXIOPAYMENTS` | -| `MODUSLINK` | -| `MONERIS` | -| `NMI` | -| `ORBITAL` | -| `PAYMENTEXPRESS` | -| `PIN` | -| `SQUARE` | -| `STRIPECONNECT` | -| `TRUSTCOMMERCE` | -| `UNIPAAS` | - + +# Current Vault + +The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + +## Enumeration + +`CurrentVault` + +## Fields + +| Name | +| --- | +| `ADYEN` | +| `AUTHORIZENET` | +| `AVALARA` | +| `BEANSTREAM` | +| `BLUESNAP` | +| `BOGUS` | +| `BRAINTREEBLUE` | +| `CHECKOUT` | +| `CYBERSOURCE` | +| `ELAVON` | +| `EWAY` | +| `EWAYRAPIDSTD` | +| `FIRSTDATA` | +| `FORTE` | +| `GOCARDLESS` | +| `LITLE` | +| `MAXIOPAYMENTS` | +| `MODUSLINK` | +| `MONERIS` | +| `NMI` | +| `ORBITAL` | +| `PAYMENTEXPRESS` | +| `PIN` | +| `SQUARE` | +| `STRIPECONNECT` | +| `TRUSTCOMMERCE` | +| `UNIPAAS` | + diff --git a/doc/models/custom-field-owner.md b/doc/models/custom-field-owner.md new file mode 100644 index 00000000..683dcc65 --- /dev/null +++ b/doc/models/custom-field-owner.md @@ -0,0 +1,14 @@ + +# Custom Field Owner + +## Enumeration + +`CustomFieldOwner` + +## Fields + +| Name | +| --- | +| `CUSTOMER` | +| `SUBSCRIPTION` | + diff --git a/doc/models/customer-1.md b/doc/models/customer-1.md index 3cc7c3c4..4f0431f0 100644 --- a/doc/models/customer-1.md +++ b/doc/models/customer-1.md @@ -1,31 +1,31 @@ - -# Customer 1 - -## Structure - -`Customer1` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyId` | `*int` | Optional | - | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Organization` | `Optional[string]` | Optional | - | -| `Email` | `*string` | Optional | - | -| `VatNumber` | `Optional[string]` | Optional | - | -| `Reference` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "chargify_id": 126, - "first_name": "first_name8", - "last_name": "last_name6", - "organization": "organization8", - "email": "email8" -} -``` - + +# Customer 1 + +## Structure + +`Customer1` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyId` | `*int` | Optional | - | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Organization` | `Optional[string]` | Optional | - | +| `Email` | `*string` | Optional | - | +| `VatNumber` | `Optional[string]` | Optional | - | +| `Reference` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "chargify_id": 126, + "first_name": "first_name8", + "last_name": "last_name6", + "organization": "organization8", + "email": "email8" +} +``` + diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md index 83c4bf8f..eb15b9c8 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -1,46 +1,46 @@ - -# Customer Attributes - -## Structure - -`CustomerAttributes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | The first name of the customer. Required when creating a customer via attributes. | -| `LastName` | `*string` | Optional | The last name of the customer. Required when creating a customer via attributes. | -| `Email` | `*string` | Optional | The email address of the customer. Required when creating a customer via attributes. | -| `CcEmails` | `*string` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | -| `Organization` | `*string` | Optional | The organization/company of the customer. Optional. | -| `Reference` | `*string` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | -| `Address` | `*string` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | -| `Address2` | `Optional[string]` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | -| `City` | `*string` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | -| `State` | `*string` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `Zip` | `*string` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | -| `Country` | `*string` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | -| `Phone` | `*string` | Optional | (Optional) The phone number of the customer. | -| `Verified` | `*bool` | Optional | - | -| `TaxExempt` | `*bool` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | -| `VatNumber` | `*string` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | -| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | - -## 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" -} -``` - + +# Customer Attributes + +## Structure + +`CustomerAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | The first name of the customer. Required when creating a customer via attributes. | +| `LastName` | `*string` | Optional | The last name of the customer. Required when creating a customer via attributes. | +| `Email` | `*string` | Optional | The email address of the customer. Required when creating a customer via attributes. | +| `CcEmails` | `*string` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | +| `Organization` | `*string` | Optional | The organization/company of the customer. Optional. | +| `Reference` | `*string` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | +| `Address` | `*string` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | +| `Address2` | `Optional[string]` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | +| `City` | `*string` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | +| `State` | `*string` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `Zip` | `*string` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | +| `Country` | `*string` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | +| `Phone` | `*string` | Optional | (Optional) The phone number of the customer. | +| `Verified` | `*bool` | Optional | - | +| `TaxExempt` | `*bool` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `VatNumber` | `*string` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | +| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | +| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | + +## 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" +} +``` + diff --git a/doc/models/customer-billing-address-change.md b/doc/models/customer-billing-address-change.md deleted file mode 100644 index 793f8c70..00000000 --- a/doc/models/customer-billing-address-change.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Customer Billing Address Change - -## Structure - -`CustomerBillingAddressChange` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Before` | `*interface{}` | Optional | - | -| `After` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } -} -``` - diff --git a/doc/models/customer-change.md b/doc/models/customer-change.md index 641b5066..8d9b4b81 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -1,94 +1,110 @@ - -# Customer Change - -## Structure - -`CustomerChange` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Payer` | [`*models.CustomerPayerChange`](../../doc/models/customer-payer-change.md) | Optional | - | -| `ShippingAddress` | [`*models.CustomerShippingAddressChange`](../../doc/models/customer-shipping-address-change.md) | Optional | - | -| `BillingAddress` | [`*models.CustomerBillingAddressChange`](../../doc/models/customer-billing-address-change.md) | Optional | - | -| `CustomFields` | [`*models.CustomerCustomFieldsChange`](../../doc/models/customer-custom-fields-change.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "payer": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "shipping_address": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "billing_address": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "owner_type2", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "owner_type2", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] - } -} -``` - + +# Customer Change + +## Structure + +`CustomerChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Payer` | [`Optional[models.CustomerPayerChange]`](../../doc/models/customer-payer-change.md) | Optional | - | +| `ShippingAddress` | [`Optional[models.AddressChange]`](../../doc/models/address-change.md) | Optional | - | +| `BillingAddress` | [`Optional[models.AddressChange]`](../../doc/models/address-change.md) | Optional | - | +| `CustomFields` | [`Optional[models.CustomerCustomFieldsChange]`](../../doc/models/customer-custom-fields-change.md) | Optional | - | + +## Example (as JSON) + +```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 + } + ] + } +} +``` + diff --git a/doc/models/customer-changes-preview-response.md b/doc/models/customer-changes-preview-response.md index d34e0fa9..36cd56e8 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -1,93 +1,109 @@ - -# Customer Changes Preview Response - -## Structure - -`CustomerChangesPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Changes` | [`models.CustomerChange`](../../doc/models/customer-change.md) | Required | - | - -## Example (as JSON) - -```json -{ - "changes": { - "payer": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "shipping_address": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "billing_address": { - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "owner_type2", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "owner_type2", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] - } - } -} -``` - + +# Customer Changes Preview Response + +## Structure + +`CustomerChangesPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Changes` | [`models.CustomerChange`](../../doc/models/customer-change.md) | Required | - | + +## Example (as JSON) + +```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 + } + ] + } + } +} +``` + diff --git a/doc/models/customer-custom-fields-change.md b/doc/models/customer-custom-fields-change.md index cd4e6fd6..9131ec4c 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -1,46 +1,39 @@ - -# Customer Custom Fields Change - -## Structure - -`CustomerCustomFieldsChange` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Before` | [`[]models.ProformaCustomField`](../../doc/models/proforma-custom-field.md) | Optional | - | -| `After` | [`[]models.ProformaCustomField`](../../doc/models/proforma-custom-field.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "before": [ - { - "owner_id": 26, - "owner_type": "owner_type2", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "owner_type4", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] -} -``` - + +# Customer Custom Fields Change + +## Structure + +`CustomerCustomFieldsChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Before` | [`[]models.InvoiceCustomField`](../../doc/models/invoice-custom-field.md) | Required | - | +| `After` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/customer-error-response-exception.md b/doc/models/customer-error-response-exception.md index be4cc7ee..b63fd683 100644 --- a/doc/models/customer-error-response-exception.md +++ b/doc/models/customer-error-response-exception.md @@ -1,24 +1,24 @@ - -# Customer Error Response Exception - -## Structure - -`CustomerErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Customer Error Response Exception + +## Structure + +`CustomerErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `*interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index 816d5ee9..4056efdd 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -1,29 +1,33 @@ - -# Customer Payer Change - -## Structure - -`CustomerPayerChange` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Before` | `*interface{}` | Optional | - | -| `After` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Customer Payer Change + +## Structure + +`CustomerPayerChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Before` | [`models.InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | +| `After` | [`models.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" + } +} +``` + diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 36a39d59..3b96bc6b 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -1,27 +1,27 @@ - -# Customer Response - -## Structure - -`CustomerResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Customer` | [`models.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" - } -} -``` - + +# Customer Response + +## Structure + +`CustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Customer` | [`models.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" + } +} +``` + diff --git a/doc/models/customer-shipping-address-change.md b/doc/models/customer-shipping-address-change.md deleted file mode 100644 index cb2116f2..00000000 --- a/doc/models/customer-shipping-address-change.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Customer Shipping Address Change - -## Structure - -`CustomerShippingAddressChange` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Before` | `*interface{}` | Optional | - | -| `After` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "before": { - "key1": "val1", - "key2": "val2" - }, - "after": { - "key1": "val1", - "key2": "val2" - } -} -``` - diff --git a/doc/models/customer.md b/doc/models/customer.md index cd3a95a4..c600d5b0 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -1,51 +1,51 @@ - -# Customer - -## Structure - -`Customer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | The first name of the customer | -| `LastName` | `*string` | Optional | The last name of the customer | -| `Email` | `*string` | Optional | The email address of the customer | -| `CcEmails` | `Optional[string]` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | -| `Organization` | `Optional[string]` | Optional | The organization of the customer | -| `Reference` | `Optional[string]` | Optional | The unique identifier used within your own application for this customer | -| `Id` | `*int` | Optional | The customer ID in Chargify | -| `CreatedAt` | `*string` | Optional | The timestamp in which the customer object was created in Chargify | -| `UpdatedAt` | `*string` | Optional | The timestamp in which the customer object was last edited | -| `Address` | `Optional[string]` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | -| `Address2` | `Optional[string]` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | -| `City` | `Optional[string]` | Optional | The customer’s shipping address city (i.e. “Boston”) | -| `State` | `Optional[string]` | Optional | The customer’s shipping address state (i.e. “MA”) | -| `StateName` | `Optional[string]` | Optional | The customer's full name of state | -| `Zip` | `Optional[string]` | Optional | The customer’s shipping address zip code (i.e. “12345”) | -| `Country` | `Optional[string]` | Optional | The customer shipping address country | -| `CountryName` | `Optional[string]` | Optional | The customer's full name of country | -| `Phone` | `Optional[string]` | Optional | The phone number of the customer | -| `Verified` | `Optional[bool]` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | -| `PortalCustomerCreatedAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal entry was created at for the customer | -| `PortalInviteLastSentAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal invite was last sent at | -| `PortalInviteLastAcceptedAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal invite was last accepted | -| `TaxExempt` | `*bool` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | -| `VatNumber` | `Optional[string]` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | -| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | -| `Locale` | `Optional[string]` | Optional | The locale for the customer to identify language-region | -| `DefaultSubscriptionGroupUid` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} -``` - + +# Customer + +## Structure + +`Customer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | The first name of the customer | +| `LastName` | `*string` | Optional | The last name of the customer | +| `Email` | `*string` | Optional | The email address of the customer | +| `CcEmails` | `Optional[string]` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | +| `Organization` | `Optional[string]` | Optional | The organization of the customer | +| `Reference` | `Optional[string]` | Optional | The unique identifier used within your own application for this customer | +| `Id` | `*int` | Optional | The customer ID in Chargify | +| `CreatedAt` | `*string` | Optional | The timestamp in which the customer object was created in Chargify | +| `UpdatedAt` | `*string` | Optional | The timestamp in which the customer object was last edited | +| `Address` | `Optional[string]` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | +| `Address2` | `Optional[string]` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | +| `City` | `Optional[string]` | Optional | The customer’s shipping address city (i.e. “Boston”) | +| `State` | `Optional[string]` | Optional | The customer’s shipping address state (i.e. “MA”) | +| `StateName` | `Optional[string]` | Optional | The customer's full name of state | +| `Zip` | `Optional[string]` | Optional | The customer’s shipping address zip code (i.e. “12345”) | +| `Country` | `Optional[string]` | Optional | The customer shipping address country | +| `CountryName` | `Optional[string]` | Optional | The customer's full name of country | +| `Phone` | `Optional[string]` | Optional | The phone number of the customer | +| `Verified` | `Optional[bool]` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | +| `PortalCustomerCreatedAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal entry was created at for the customer | +| `PortalInviteLastSentAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal invite was last sent at | +| `PortalInviteLastAcceptedAt` | `Optional[string]` | Optional | The timestamp of when the Billing Portal invite was last accepted | +| `TaxExempt` | `*bool` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `VatNumber` | `Optional[string]` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | +| `ParentId` | `Optional[int]` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | +| `Locale` | `Optional[string]` | Optional | The locale for the customer to identify language-region | +| `DefaultSubscriptionGroupUid` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name8", + "last_name": "last_name6", + "email": "email8", + "cc_emails": "cc_emails2", + "organization": "organization8" +} +``` + diff --git a/doc/models/deduct-service-credit-request.md b/doc/models/deduct-service-credit-request.md index 442b6be8..d7796f9d 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -1,27 +1,27 @@ - -# Deduct Service Credit Request - -## Structure - -`DeductServiceCreditRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Deduction` | [`models.DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | - -## Example (as JSON) - -```json -{ - "deduction": { - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo0" - } -} -``` - + +# Deduct Service Credit Request + +## Structure + +`DeductServiceCreditRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Deduction` | [`models.DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | + +## Example (as JSON) + +```json +{ + "deduction": { + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo0" + } +} +``` + diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index 5d4ddffd..9fa7b3a3 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -1,26 +1,26 @@ - -# Deduct Service Credit - -## Structure - -`DeductServiceCredit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `interface{}` | Required | - | -| `Memo` | `string` | Required | - | - -## Example (as JSON) - -```json -{ - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo2" -} -``` - + +# Deduct Service Credit + +## Structure + +`DeductServiceCredit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `interface{}` | Required | - | +| `Memo` | `string` | Required | - | + +## Example (as JSON) + +```json +{ + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo2" +} +``` + diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index e95c99de..365c4377 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -1,21 +1,21 @@ - -# Delayed Cancellation Response - -## Structure - -`DelayedCancellationResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Message` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "message": "message8" -} -``` - + +# Delayed Cancellation Response + +## Structure + +`DelayedCancellationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Message` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "message": "message8" +} +``` + diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index 6cf3d340..ca2131ad 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -1,23 +1,23 @@ - -# Delete Subscription Group Response - -## Structure - -`DeleteSubscriptionGroupResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Deleted` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "deleted": false -} -``` - + +# Delete Subscription Group Response + +## Structure + +`DeleteSubscriptionGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Deleted` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "deleted": false +} +``` + diff --git a/doc/models/direction.md b/doc/models/direction.md index ef6c29da..d2e77390 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -1,14 +1,14 @@ - -# Direction - -## Enumeration - -`Direction` - -## Fields - -| Name | -| --- | -| `ASC` | -| `DESC` | - + +# Direction + +## Enumeration + +`Direction` + +## Fields + +| Name | +| --- | +| `ASC` | +| `DESC` | + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index 77357ece..d134aec1 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -1,14 +1,14 @@ - -# Discount Type - -## Enumeration - -`DiscountType` - -## Fields - -| Name | -| --- | -| `AMOUNT` | -| `PERCENT` | - + +# Discount Type + +## Enumeration + +`DiscountType` + +## Fields + +| Name | +| --- | +| `AMOUNT` | +| `PERCENT` | + diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index ebbf137b..c4cc74cb 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -1,60 +1,60 @@ - -# EBB Component - -## Structure - -`EBBComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | -| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | 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 | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | -| `EventBasedBillingMetricId` | `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. | -| `IntervalUnit` | [`*models.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": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "full", - "event_based_billing_metric_id": 190 -} -``` - + +# EBB Component + +## Structure + +`EBBComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | +| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | 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 | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | +| `EventBasedBillingMetricId` | `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. | +| `IntervalUnit` | [`*models.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": "name0", + "unit_name": "unit_name2", + "description": "description0", + "handle": "handle6", + "taxable": false, + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "full", + "event_based_billing_metric_id": 190 +} +``` + diff --git a/doc/models/ebb-event.md b/doc/models/ebb-event.md index 9f3735be..ab6a248e 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -1,38 +1,38 @@ - -# EBB Event - -## Structure - -`EBBEvent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Chargify` | [`*models.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": "created_at4", - "uniqueness_token": "uniqueness_token2" - }, - "messages": 150, - "country": "US", - "customer": { - "name": "John", - "lastName": "Doe", - "address": { - "street": "Maple Street", - "zip": 4888, - "state": "MA" - } - } -} -``` - + +# EBB Event + +## Structure + +`EBBEvent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Chargify` | [`*models.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": "created_at4", + "uniqueness_token": "uniqueness_token2" + }, + "messages": 150, + "country": "US", + "customer": { + "name": "John", + "lastName": "Doe", + "address": { + "street": "Maple Street", + "zip": 4888, + "state": "MA" + } + } +} +``` + diff --git a/doc/models/enable-webhooks-request.md b/doc/models/enable-webhooks-request.md index 317c4289..113a7e1e 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -1,21 +1,21 @@ - -# Enable Webhooks Request - -## Structure - -`EnableWebhooksRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `WebhooksEnabled` | `bool` | Required | - | - -## Example (as JSON) - -```json -{ - "webhooks_enabled": false -} -``` - + +# Enable Webhooks Request + +## Structure + +`EnableWebhooksRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `WebhooksEnabled` | `bool` | Required | - | + +## Example (as JSON) + +```json +{ + "webhooks_enabled": false +} +``` + diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index c386f6c1..eb925269 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -1,21 +1,21 @@ - -# Enable Webhooks Response - -## Structure - -`EnableWebhooksResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `WebhooksEnabled` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "webhooks_enabled": false -} -``` - + +# Enable Webhooks Response + +## Structure + +`EnableWebhooksResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `WebhooksEnabled` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "webhooks_enabled": false +} +``` + diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index 39d3484d..69662bb3 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -1,29 +1,29 @@ - -# Endpoint Response - -## Structure - -`EndpointResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Endpoint` | [`*models.Endpoint`](../../doc/models/endpoint.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "endpoint": { - "id": 202, - "url": "url2", - "site_id": 128, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4" - ] - } -} -``` - + +# Endpoint Response + +## Structure + +`EndpointResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Endpoint` | [`*models.Endpoint`](../../doc/models/endpoint.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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 c8e5a3a3..39552de5 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -1,32 +1,32 @@ - -# Endpoint - -## Structure - -`Endpoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Url` | `*string` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `Status` | `*string` | Optional | - | -| `WebhookSubscriptions` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" - ] -} -``` - + +# Endpoint + +## Structure + +`Endpoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Url` | `*string` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `Status` | `*string` | Optional | - | +| `WebhookSubscriptions` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 196, + "url": "url2", + "site_id": 122, + "status": "status0", + "webhook_subscriptions": [ + "webhook_subscriptions4", + "webhook_subscriptions3" + ] +} +``` + diff --git a/doc/models/error-array-map-response-exception.md b/doc/models/error-array-map-response-exception.md index 0f48ab98..960a0f69 100644 --- a/doc/models/error-array-map-response-exception.md +++ b/doc/models/error-array-map-response-exception.md @@ -1,26 +1,26 @@ - -# Error Array Map Response Exception - -## Structure - -`ErrorArrayMapResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `map[string]interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } -} -``` - + +# Error Array Map Response Exception + +## Structure + +`ErrorArrayMapResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `map[string]interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "key0": { + "key1": "val1", + "key2": "val2" + } + } +} +``` + diff --git a/doc/models/error-list-response-exception.md b/doc/models/error-list-response-exception.md index b76a2b99..c183004f 100644 --- a/doc/models/error-list-response-exception.md +++ b/doc/models/error-list-response-exception.md @@ -1,27 +1,27 @@ - -# Error List Response Exception - -Error which contains list of messages. - -## Structure - -`ErrorListResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `[]string` | Required | - | - -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] -} -``` - + +# Error List Response Exception + +Error which contains list of messages. + +## Structure + +`ErrorListResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `[]string` | Required | - | + +## Example (as JSON) + +```json +{ + "errors": [ + "errors5", + "errors6", + "errors7" + ] +} +``` + diff --git a/doc/models/error-string-map-response-exception.md b/doc/models/error-string-map-response-exception.md index 7da28ab8..9cf6bb0c 100644 --- a/doc/models/error-string-map-response-exception.md +++ b/doc/models/error-string-map-response-exception.md @@ -1,24 +1,24 @@ - -# Error String Map Response Exception - -## Structure - -`ErrorStringMapResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `map[string]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" - } -} -``` - + +# Error String Map Response Exception + +## Structure + +`ErrorStringMapResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `map[string]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "key0": "errors3", + "key1": "errors4" + } +} +``` + diff --git a/doc/models/errors.md b/doc/models/errors.md index 706c5718..c3d56b85 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -1,29 +1,29 @@ - -# Errors - -## Structure - -`Errors` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PerPage` | `[]string` | Optional | - | -| `PricePoint` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "per_page": [ - "per_page7", - "per_page8" - ], - "price_point": [ - "price_point6", - "price_point7" - ] -} -``` - + +# Errors + +## Structure + +`Errors` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PerPage` | `[]string` | Optional | - | +| `PricePoint` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "per_page": [ + "per_page7", + "per_page8" + ], + "price_point": [ + "price_point6", + "price_point7" + ] +} +``` + 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 18aff644..7f4b3a36 100644 --- a/doc/models/event-based-billing-list-segments-errors-exception.md +++ b/doc/models/event-based-billing-list-segments-errors-exception.md @@ -1,32 +1,32 @@ - -# Event Based Billing List Segments Errors Exception - -## Structure - -`EventBasedBillingListSegmentsErrorsException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`*models.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" - ] - } -} -``` - + +# Event Based Billing List Segments Errors Exception + +## Structure + +`EventBasedBillingListSegmentsErrorsException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`*models.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" + ] + } +} +``` + diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index 33c80a63..af60c450 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -1,30 +1,30 @@ - -# Event Based Billing Segment Error - -## Structure - -`EventBasedBillingSegmentError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segments` | `map[string]interface{}` | 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" - } - } -} -``` - + +# Event Based Billing Segment Error + +## Structure + +`EventBasedBillingSegmentError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segments` | `map[string]interface{}` | 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" + } + } +} +``` + diff --git a/doc/models/event-based-billing-segment-errors-exception.md b/doc/models/event-based-billing-segment-errors-exception.md index ec4919dd..f8c4ab47 100644 --- a/doc/models/event-based-billing-segment-errors-exception.md +++ b/doc/models/event-based-billing-segment-errors-exception.md @@ -1,34 +1,34 @@ - -# Event Based Billing Segment Errors Exception - -## Structure - -`EventBasedBillingSegmentErrorsException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `map[string]interface{}` | 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" - } - } -} -``` - + +# Event Based Billing Segment Errors Exception + +## Structure + +`EventBasedBillingSegmentErrorsException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `map[string]interface{}` | 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" + } + } +} +``` + diff --git a/doc/models/event-based-billing-segment-exception.md b/doc/models/event-based-billing-segment-exception.md index 99ffedaf..10f7226e 100644 --- a/doc/models/event-based-billing-segment-exception.md +++ b/doc/models/event-based-billing-segment-exception.md @@ -1,28 +1,28 @@ - -# Event Based Billing Segment Exception - -## Structure - -`EventBasedBillingSegmentException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`models.EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | - -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } - } -} -``` - + +# Event Based Billing Segment Exception + +## Structure + +`EventBasedBillingSegmentException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`models.EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | + +## Example (as JSON) + +```json +{ + "errors": { + "segments": { + "key0": { + "key1": "val1", + "key2": "val2" + } + } + } +} +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index df71f31f..81d3242d 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -1,32 +1,32 @@ - -# Event Response - -## Structure - -`EventResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Event` | [`models.Event`](../../doc/models/event.md) | Required | - | - -## Example (as JSON) - -```json -{ - "event": { - "id": 242, - "key": "key0", - "message": "message0", - "subscription_id": 96, - "customer_id": 24, - "created_at": "created_at8", - "event_specific_data": { - "key1": "val1", - "key2": "val2" - } - } -} -``` - + +# Event Response + +## Structure + +`EventResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Event` | [`models.Event`](../../doc/models/event.md) | Required | - | + +## Example (as JSON) + +```json +{ + "event": { + "id": 242, + "key": "key0", + "message": "message0", + "subscription_id": 96, + "customer_id": 24, + "created_at": "created_at8", + "event_specific_data": { + "key1": "val1", + "key2": "val2" + } + } +} +``` + diff --git a/doc/models/event-type.md b/doc/models/event-type.md index da8af062..5689fa9f 100644 --- a/doc/models/event-type.md +++ b/doc/models/event-type.md @@ -1,46 +1,46 @@ - -# Event Type - -## Enumeration - -`EventType` - -## Fields - -| Name | -| --- | -| `ACCOUNTTRANSACTIONCHANGED` | -| `BILLINGDATECHANGE` | -| `COMPONENTALLOCATIONCHANGE` | -| `CUSTOMERUPDATE` | -| `CUSTOMERCREATE` | -| `DUNNINGSTEPREACHED` | -| `EXPIRATIONDATECHANGE` | -| `EXPIRINGCARD` | -| `METEREDUSAGE` | -| `PAYMENTSUCCESS` | -| `PAYMENTSUCCESSRECREATED` | -| `PAYMENTFAILURE` | -| `PAYMENTFAILURERECREATED` | -| `REFUNDFAILURE` | -| `REFUNDSUCCESS` | -| `RENEWALSUCCESS` | -| `RENEWALSUCCESSRECREATED` | -| `RENEWALFAILURE` | -| `SIGNUPSUCCESS` | -| `SIGNUPFAILURE` | -| `STATEMENTCLOSED` | -| `STATEMENTSETTLED` | -| `SUBSCRIPTIONBANKACCOUNTUPDATE` | -| `SUBSCRIPTIONDELETION` | -| `SUBSCRIPTIONPAYPALACCOUNTUPDATE` | -| `SUBSCRIPTIONPRODUCTCHANGE` | -| `SUBSCRIPTIONSTATECHANGE` | -| `TRIALENDNOTICE` | -| `UPGRADEDOWNGRADESUCCESS` | -| `UPGRADEDOWNGRADEFAILURE` | -| `UPCOMINGRENEWALNOTICE` | -| `CUSTOMFIELDVALUECHANGE` | -| `SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED` | -| `SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED` | - + +# Event Type + +## Enumeration + +`EventType` + +## Fields + +| Name | +| --- | +| `ACCOUNTTRANSACTIONCHANGED` | +| `BILLINGDATECHANGE` | +| `COMPONENTALLOCATIONCHANGE` | +| `CUSTOMERUPDATE` | +| `CUSTOMERCREATE` | +| `DUNNINGSTEPREACHED` | +| `EXPIRATIONDATECHANGE` | +| `EXPIRINGCARD` | +| `METEREDUSAGE` | +| `PAYMENTSUCCESS` | +| `PAYMENTSUCCESSRECREATED` | +| `PAYMENTFAILURE` | +| `PAYMENTFAILURERECREATED` | +| `REFUNDFAILURE` | +| `REFUNDSUCCESS` | +| `RENEWALSUCCESS` | +| `RENEWALSUCCESSRECREATED` | +| `RENEWALFAILURE` | +| `SIGNUPSUCCESS` | +| `SIGNUPFAILURE` | +| `STATEMENTCLOSED` | +| `STATEMENTSETTLED` | +| `SUBSCRIPTIONBANKACCOUNTUPDATE` | +| `SUBSCRIPTIONDELETION` | +| `SUBSCRIPTIONPAYPALACCOUNTUPDATE` | +| `SUBSCRIPTIONPRODUCTCHANGE` | +| `SUBSCRIPTIONSTATECHANGE` | +| `TRIALENDNOTICE` | +| `UPGRADEDOWNGRADESUCCESS` | +| `UPGRADEDOWNGRADEFAILURE` | +| `UPCOMINGRENEWALNOTICE` | +| `CUSTOMFIELDVALUECHANGE` | +| `SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED` | +| `SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED` | + diff --git a/doc/models/event.md b/doc/models/event.md index c0e70a81..e02c3edd 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -1,36 +1,36 @@ - -# Event - -## Structure - -`Event` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `int` | Required | - | -| `Key` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `Message` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `SubscriptionId` | `*int` | Required | - | -| `CustomerId` | `int` | Required | - | -| `CreatedAt` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `EventSpecificData` | `interface{}` | Required | - | - -## Example (as JSON) - -```json -{ - "id": 40, - "key": "key2", - "message": "message8", - "subscription_id": 150, - "customer_id": 78, - "created_at": "created_at0", - "event_specific_data": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Event + +## Structure + +`Event` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `int` | Required | - | +| `Key` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `Message` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `SubscriptionId` | `*int` | Required | - | +| `CustomerId` | `int` | Required | - | +| `CreatedAt` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `EventSpecificData` | `interface{}` | Required | - | + +## Example (as JSON) + +```json +{ + "id": 40, + "key": "key2", + "message": "message8", + "subscription_id": 150, + "customer_id": 78, + "created_at": "created_at0", + "event_specific_data": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/extended-interval-unit.md b/doc/models/extended-interval-unit.md index f51e38fc..9b4bfbef 100644 --- a/doc/models/extended-interval-unit.md +++ b/doc/models/extended-interval-unit.md @@ -1,15 +1,15 @@ - -# Extended Interval Unit - -## Enumeration - -`ExtendedIntervalUnit` - -## Fields - -| Name | -| --- | -| `DAY` | -| `MONTH` | -| `NEVER` | - + +# Extended Interval Unit + +## Enumeration + +`ExtendedIntervalUnit` + +## Fields + +| Name | +| --- | +| `DAY` | +| `MONTH` | +| `NEVER` | + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 99b4c95c..2344516b 100644 --- a/doc/models/failed-payment-action.md +++ b/doc/models/failed-payment-action.md @@ -1,21 +1,21 @@ - -# Failed Payment Action - + +# Failed Payment Action + 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). - -## Enumeration - -`FailedPaymentAction` - -## Fields - -| Name | -| --- | -| `LEAVEOPENINVOICE` | -| `ROLLBACKTOPENDING` | -| `INITIATEDUNNING` | - +- `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 + +`FailedPaymentAction` + +## Fields + +| Name | +| --- | +| `LEAVEOPENINVOICE` | +| `ROLLBACKTOPENDING` | +| `INITIATEDUNNING` | + diff --git a/doc/models/first-charge-type.md b/doc/models/first-charge-type.md index 9fa953d6..767122d9 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -1,15 +1,15 @@ - -# First Charge Type - -## Enumeration - -`FirstChargeType` - -## Fields - -| Name | -| --- | -| `PRORATED` | -| `IMMEDIATE` | -| `DELAYED` | - + +# First Charge Type + +## Enumeration + +`FirstChargeType` + +## Fields + +| Name | +| --- | +| `PRORATED` | +| `IMMEDIATE` | +| `DELAYED` | + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 5b96907a..6d4f9e90 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -1,40 +1,40 @@ - -# Full Subscription Group Response - -## Structure - -`FullSubscriptionGroupResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Scheme` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `PaymentProfileId` | `*int` | Optional | - | -| `SubscriptionIds` | `[]int` | Optional | - | -| `PrimarySubscriptionId` | `*int` | Optional | - | -| `NextAssessmentAt` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `CancelAtEndOfPeriod` | `*bool` | Optional | - | -| `CurrentBillingAmountInCents` | `*int64` | Optional | - | -| `Customer` | [`*models.SubscriptionGroupCustomer`](../../doc/models/subscription-group-customer.md) | Optional | - | -| `AccountBalances` | [`*models.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 - ] -} -``` - + +# Full Subscription Group Response + +## Structure + +`FullSubscriptionGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Scheme` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `PaymentProfileId` | `*int` | Optional | - | +| `SubscriptionIds` | `[]int` | Optional | - | +| `PrimarySubscriptionId` | `*int` | Optional | - | +| `NextAssessmentAt` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `CancelAtEndOfPeriod` | `*bool` | Optional | - | +| `CurrentBillingAmountInCents` | `*int64` | Optional | - | +| `Customer` | [`*models.SubscriptionGroupCustomer`](../../doc/models/subscription-group-customer.md) | Optional | - | +| `AccountBalances` | [`*models.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 + ] +} +``` + diff --git a/doc/models/get-one-time-token-payment-profile.md b/doc/models/get-one-time-token-payment-profile.md index fd241c27..eb4e5c30 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -1,61 +1,61 @@ - -# Get One Time Token Payment Profile - -## Structure - -`GetOneTimeTokenPaymentProfile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `Optional[string]` | Optional | - | -| `FirstName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `LastName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `MaskedCardNumber` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `CardType` | [`models.CardType`](../../doc/models/card-type.md) | Required | The type of card used. | -| `ExpirationMonth` | `float64` | Required | - | -| `ExpirationYear` | `float64` | Required | - | -| `CustomerId` | `Optional[string]` | Optional | - | -| `CurrentVault` | [`models.CurrentVault`](../../doc/models/current-vault.md) | Required | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `VaultToken` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `BillingAddress` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `BillingAddress2` | `*string` | Optional | - | -| `BillingCity` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `BillingCountry` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `BillingState` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `BillingZip` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `PaymentType` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `Disabled` | `bool` | Required | - | -| `SiteGatewaySettingId` | `int` | Required | - | -| `CustomerVaultToken` | `Optional[string]` | Optional | - | -| `GatewayHandle` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": "id2", - "first_name": "first_name2", - "last_name": "last_name0", - "masked_card_number": "masked_card_number0", - "card_type": "routex", - "expiration_month": 187.78, - "expiration_year": 164.44, - "customer_id": "customer_id0", - "current_vault": "firstdata", - "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" -} -``` - + +# Get One Time Token Payment Profile + +## Structure + +`GetOneTimeTokenPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `Optional[string]` | Optional | - | +| `FirstName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `LastName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `MaskedCardNumber` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `CardType` | [`models.CardType`](../../doc/models/card-type.md) | Required | The type of card used. | +| `ExpirationMonth` | `float64` | Required | - | +| `ExpirationYear` | `float64` | Required | - | +| `CustomerId` | `Optional[string]` | Optional | - | +| `CurrentVault` | [`models.CurrentVault`](../../doc/models/current-vault.md) | Required | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | +| `VaultToken` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `BillingAddress` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `BillingAddress2` | `*string` | Optional | - | +| `BillingCity` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `BillingCountry` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `BillingState` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `BillingZip` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `PaymentType` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `Disabled` | `bool` | Required | - | +| `SiteGatewaySettingId` | `int` | Required | - | +| `CustomerVaultToken` | `Optional[string]` | Optional | - | +| `GatewayHandle` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": "id2", + "first_name": "first_name2", + "last_name": "last_name0", + "masked_card_number": "masked_card_number0", + "card_type": "routex", + "expiration_month": 187.78, + "expiration_year": 164.44, + "customer_id": "customer_id0", + "current_vault": "firstdata", + "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" +} +``` + diff --git a/doc/models/get-one-time-token-request.md b/doc/models/get-one-time-token-request.md index 5a0576a9..0fa94e18 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -1,43 +1,43 @@ - -# Get One Time Token Request - -## Structure - -`GetOneTimeTokenRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfile` | [`models.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": "eway", - "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" - } -} -``` - + +# Get One Time Token Request + +## Structure + +`GetOneTimeTokenRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfile` | [`models.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": "eway", + "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" + } +} +``` + diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 66f4e20c..b7245c38 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -1,27 +1,27 @@ - -# Group Billing - -Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. - -## Structure - -`GroupBilling` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Accrue` | `*bool` | Optional | A flag indicating whether or not to accrue charges on the new subscription.
**Default**: `false` | -| `AlignDate` | `*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) - -```json -{ - "accrue": false, - "align_date": false, - "prorate": false -} -``` - + +# Group Billing + +Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. + +## Structure + +`GroupBilling` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Accrue` | `*bool` | Optional | A flag indicating whether or not to accrue charges on the new subscription.
**Default**: `false` | +| `AlignDate` | `*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) + +```json +{ + "accrue": false, + "align_date": false, + "prorate": false +} +``` + diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index 3e883ae1..d1330aa9 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -1,30 +1,30 @@ - -# Group Settings - -## Structure - -`GroupSettings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Target` | [`models.GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | -| `Billing` | [`*models.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 - } -} -``` - + +# Group Settings + +## Structure + +`GroupSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Target` | [`models.GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | +| `Billing` | [`*models.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 + } +} +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index 431d4fba..db084c71 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -1,19 +1,19 @@ - -# Group Target Type - -The type of object indicated by the id attribute. - -## Enumeration - -`GroupTargetType` - -## Fields - -| Name | -| --- | -| `CUSTOMER` | -| `SUBSCRIPTION` | -| `SELF` | -| `PARENT` | -| `ELDEST` | - + +# Group Target Type + +The type of object indicated by the id attribute. + +## Enumeration + +`GroupTargetType` + +## Fields + +| Name | +| --- | +| `CUSTOMER` | +| `SUBSCRIPTION` | +| `SELF` | +| `PARENT` | +| `ELDEST` | + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index ef8ece31..25832710 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -1,25 +1,25 @@ - -# Group Target - -Attributes of the target customer who will be the responsible payer of the created subscription. Required. - -## Structure - -`GroupTarget` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Type` | [`models.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" | - -## Example (as JSON) - -```json -{ - "type": "self", - "id": 134 -} -``` - + +# Group Target + +Attributes of the target customer who will be the responsible payer of the created subscription. Required. + +## Structure + +`GroupTarget` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Type` | [`models.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" | + +## Example (as JSON) + +```json +{ + "type": "self", + "id": 134 +} +``` + diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 6b1f65fe..de91e8ca 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -1,21 +1,21 @@ - -# Include Not Null - -Passed as a parameter to list methods to return only non null values. - -## Enumeration - -`IncludeNotNull` - -## Fields - -| Name | -| --- | -| `NOTNULL` | - -## Example - -``` -not_null -``` - + +# Include Not Null + +Passed as a parameter to list methods to return only non null values. + +## Enumeration + +`IncludeNotNull` + +## Fields + +| Name | +| --- | +| `NOTNULL` | + +## Example + +``` +not_null +``` + diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 0ad125f0..e30fa605 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -1,14 +1,14 @@ - -# Include Option - -## Enumeration - -`IncludeOption` - -## Fields - -| Name | -| --- | -| `EXCLUDE` | -| `INCLUDE` | - + +# Include Option + +## Enumeration + +`IncludeOption` + +## Fields + +| Name | +| --- | +| `EXCLUDE` | +| `INCLUDE` | + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 7e4cab3b..2ed5712f 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -1,14 +1,14 @@ - -# Interval Unit - -## Enumeration - -`IntervalUnit` - -## Fields - -| Name | -| --- | -| `DAY` | -| `MONTH` | - + +# Interval Unit + +## Enumeration + +`IntervalUnit` + +## Fields + +| Name | +| --- | +| `DAY` | +| `MONTH` | + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index bba20591..b86d363e 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -1,30 +1,30 @@ - -# Invoice Address - -## Structure - -`InvoiceAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Street` | `Optional[string]` | Optional | - | -| `Line2` | `Optional[string]` | Optional | - | -| `City` | `Optional[string]` | Optional | - | -| `State` | `Optional[string]` | Optional | - | -| `Zip` | `Optional[string]` | Optional | - | -| `Country` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} -``` - + +# Invoice Address + +## Structure + +`InvoiceAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Street` | `Optional[string]` | Optional | - | +| `Line2` | `Optional[string]` | Optional | - | +| `City` | `Optional[string]` | Optional | - | +| `State` | `Optional[string]` | Optional | - | +| `Zip` | `Optional[string]` | Optional | - | +| `Country` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "street": "street0", + "line2": "line24", + "city": "city0", + "state": "state6", + "zip": "zip4" +} +``` + diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index c4bfa6c1..32537a35 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -1,25 +1,25 @@ - -# Invoice Balance Item - -## Structure - -`InvoiceBalanceItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Number` | `*string` | Optional | - | -| `OutstandingAmount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} -``` - + +# Invoice Balance Item + +## Structure + +`InvoiceBalanceItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Number` | `*string` | Optional | - | +| `OutstandingAmount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "number": "number6", + "outstanding_amount": "outstanding_amount6" +} +``` + diff --git a/doc/models/invoice-consolidation-level.md b/doc/models/invoice-consolidation-level.md index b45b4b2a..fcd54172 100644 --- a/doc/models/invoice-consolidation-level.md +++ b/doc/models/invoice-consolidation-level.md @@ -1,6 +1,6 @@ - -# Invoice Consolidation Level - + +# Invoice Consolidation Level + 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. @@ -9,17 +9,17 @@ Consolidation level of the invoice, which is applicable to invoice consolidation "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://chargify.zendesk.com/hc/en-us/articles/4407746391835). - -## Enumeration - -`InvoiceConsolidationLevel` - -## Fields - -| Name | -| --- | -| `NONE` | -| `CHILD` | -| `PARENT` | - +See also the [invoice consolidation documentation](https://chargify.zendesk.com/hc/en-us/articles/4407746391835). + +## Enumeration + +`InvoiceConsolidationLevel` + +## Fields + +| Name | +| --- | +| `NONE` | +| `CHILD` | +| `PARENT` | + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index b8566c36..9f10d48b 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -1,31 +1,31 @@ - -# Invoice Credit - -## Structure - -`InvoiceCredit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `CreditNoteNumber` | `*string` | Optional | - | -| `CreditNoteUid` | `*string` | Optional | - | -| `TransactionTime` | `*time.Time` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `OriginalAmount` | `*string` | Optional | - | -| `AppliedAmount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0" -} -``` - + +# Invoice Credit + +## Structure + +`InvoiceCredit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `CreditNoteNumber` | `*string` | Optional | - | +| `CreditNoteUid` | `*string` | Optional | - | +| `TransactionTime` | `*time.Time` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `OriginalAmount` | `*string` | Optional | - | +| `AppliedAmount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid6", + "credit_note_number": "credit_note_number0", + "credit_note_uid": "credit_note_uid0", + "transaction_time": "2016-03-13T12:52:32.123Z", + "memo": "memo0" +} +``` + diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md index e3ad2037..3c71647d 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -1,27 +1,29 @@ - -# Invoice Custom Field - -## Structure - -`InvoiceCustomField` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Value` | `*string` | Optional | - | -| `OwnerId` | `*int` | Optional | - | -| `OwnerType` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "value": "value2", - "owner_id": 142, - "owner_type": "owner_type2" -} -``` - + +# Invoice Custom Field + +## Structure + +`InvoiceCustomField` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `OwnerId` | `*int` | Optional | - | +| `OwnerType` | [`*models.CustomFieldOwner`](../../doc/models/custom-field-owner.md) | Optional | - | +| `Name` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Value` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `MetadatumId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "owner_id": 142, + "owner_type": "Customer", + "name": "name0", + "value": "value2", + "metadatum_id": 142 +} +``` + diff --git a/doc/models/invoice-customer.md b/doc/models/invoice-customer.md index c5d529c5..03bff7bf 100644 --- a/doc/models/invoice-customer.md +++ b/doc/models/invoice-customer.md @@ -1,33 +1,33 @@ - -# Invoice Customer - -Information about the customer who is owner or recipient the invoiced subscription. - -## Structure - -`InvoiceCustomer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyId` | `*int` | Optional | - | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Organization` | `Optional[string]` | Optional | - | -| `Email` | `*string` | Optional | - | -| `VatNumber` | `Optional[string]` | Optional | - | -| `Reference` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} -``` - + +# Invoice Customer + +Information about the customer who is owner or recipient the invoiced subscription. + +## Structure + +`InvoiceCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyId` | `*int` | Optional | - | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Organization` | `Optional[string]` | Optional | - | +| `Email` | `*string` | Optional | - | +| `VatNumber` | `Optional[string]` | Optional | - | +| `Reference` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "chargify_id": 236, + "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 b79fe41a..05322faa 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -1,23 +1,23 @@ - -# Invoice Date Field - -## Enumeration - -`InvoiceDateField` - -## Fields - -| Name | -| --- | -| `CREATEDAT` | -| `DUEDATE` | -| `ISSUEDATE` | -| `UPDATEDAT` | -| `PAIDDATE` | - -## Example - -``` -issue_date -``` - + +# Invoice Date Field + +## Enumeration + +`InvoiceDateField` + +## Fields + +| Name | +| --- | +| `CREATEDAT` | +| `DUEDATE` | +| `ISSUEDATE` | +| `UPDATEDAT` | +| `PAIDDATE` | + +## Example + +``` +issue_date +``` + diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index 9cfe690f..86b1975d 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -1,25 +1,25 @@ - -# Invoice Discount Breakout - -## Structure - -`InvoiceDiscountBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `EligibleAmount` | `*string` | Optional | - | -| `DiscountAmount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} -``` - + +# Invoice Discount Breakout + +## Structure + +`InvoiceDiscountBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `EligibleAmount` | `*string` | Optional | - | +| `DiscountAmount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "eligible_amount": "eligible_amount0", + "discount_amount": "discount_amount8" +} +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index f55e34b3..88c52dfa 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -1,36 +1,36 @@ - -# Invoice Discount - -## Structure - -`InvoiceDiscount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Title` | `*string` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | -| `Code` | `*string` | Optional | - | -| `SourceType` | `*string` | Optional | - | -| `SourceId` | `*int` | Optional | - | -| `DiscountType` | `*string` | Optional | - | -| `Percentage` | `*string` | Optional | - | -| `EligibleAmount` | `*string` | Optional | - | -| `DiscountAmount` | `*string` | Optional | - | -| `TransactionId` | `*int` | Optional | - | -| `LineItemBreakouts` | [`[]models.InvoiceDiscountBreakout`](../../doc/models/invoice-discount-breakout.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "source_type0" -} -``` - + +# Invoice Discount + +## Structure + +`InvoiceDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Title` | `*string` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | +| `Code` | `*string` | Optional | - | +| `SourceType` | `*string` | Optional | - | +| `SourceId` | `*int` | Optional | - | +| `DiscountType` | `*string` | Optional | - | +| `Percentage` | `*string` | Optional | - | +| `EligibleAmount` | `*string` | Optional | - | +| `DiscountAmount` | `*string` | Optional | - | +| `TransactionId` | `*int` | Optional | - | +| `LineItemBreakouts` | [`[]models.InvoiceDiscountBreakout`](../../doc/models/invoice-discount-breakout.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "title": "title4", + "description": "description0", + "code": "code8", + "source_type": "source_type0" +} +``` + diff --git a/doc/models/invoice-display-settings.md b/doc/models/invoice-display-settings.md index 9d3bff6c..747192b4 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -1,23 +1,23 @@ - -# Invoice Display Settings - -## Structure - -`InvoiceDisplaySettings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `HideZeroSubtotalLines` | `*bool` | Optional | - | -| `IncludeDiscountsOnLines` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} -``` - + +# Invoice Display Settings + +## Structure + +`InvoiceDisplaySettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `HideZeroSubtotalLines` | `*bool` | Optional | - | +| `IncludeDiscountsOnLines` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "hide_zero_subtotal_lines": false, + "include_discounts_on_lines": false +} +``` + diff --git a/doc/models/invoice-event-1.md b/doc/models/invoice-event-data.md similarity index 88% rename from doc/models/invoice-event-1.md rename to doc/models/invoice-event-data.md index 1e7f2027..5b0caeb2 100644 --- a/doc/models/invoice-event-1.md +++ b/doc/models/invoice-event-data.md @@ -1,54 +1,58 @@ - -# Invoice Event 1 - -The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. - -## Structure - -`InvoiceEvent1` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | Unique identifier for the credit note application. It is generated automatically by Chargify and has the prefix "cdt_" followed by alphanumeric characters. | -| `CreditNoteNumber` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it is referenced. | -| `CreditNoteUid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | -| `OriginalAmount` | `*string` | Optional | The full, original amount of the credit note. | -| `AppliedAmount` | `*string` | Optional | The amount of the credit note applied to invoice. | -| `TransactionTime` | `*time.Time` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -| `Memo` | `*string` | Optional | The credit note memo. | -| `Role` | `*string` | Optional | The role of the credit note (e.g. 'general') | -| `ConsolidatedInvoice` | `*bool` | Optional | Shows whether it was applied to consolidated invoice or not | -| `AppliedCreditNotes` | [`[]models.AppliedCreditNoteData`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | -| `DebitNoteNumber` | `*string` | Optional | A unique, identifying string that appears on the debit note and in places it is referenced. | -| `DebitNoteUid` | `*string` | Optional | Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. | -| `PaymentMethod` | [`*models.PaymentMethodNestedData`](../../doc/models/payment-method-nested-data.md) | Optional | A nested data structure detailing the method of payment | -| `TransactionId` | `*int` | Optional | The Chargify id of the original payment | -| `FromCollectionMethod` | `*string` | Optional | The previous collection method of the invoice. | -| `ToCollectionMethod` | `*string` | Optional | The new collection method of the invoice. | -| `ConsolidationLevel` | [`*models.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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | -| `FromStatus` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | -| `ToStatus` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | -| `DueAmount` | `*string` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | -| `TotalAmount` | `*string` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | -| `ApplyCredit` | `*bool` | Optional | If true, credit was created and applied it to the invoice. | -| `CreditNoteAttributes` | [`*models.CreditNote1`](../../doc/models/credit-note-1.md) | Optional | - | -| `PaymentId` | `*int` | Optional | The ID of the payment transaction to be refunded. | -| `RefundAmount` | `*string` | Optional | The amount of the refund. | -| `RefundId` | `*int` | Optional | The ID of the refund transaction. | -| `Prepayment` | `*bool` | Optional | The flag that shows whether the original payment was a prepayment or not | -| `IsAdvanceInvoice` | `*bool` | Optional | If true, the invoice is an advance invoice. | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "credit_note_number": "credit_note_number4", - "credit_note_uid": "credit_note_uid4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8" -} -``` - + +# Invoice Event Data + +The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. + +## Structure + +`InvoiceEventData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | Unique identifier for the credit note application. It is generated automatically by Chargify and has the prefix "cdt_" followed by alphanumeric characters. | +| `CreditNoteNumber` | `*string` | Optional | A unique, identifying string that appears on the credit note and in places it is referenced. | +| `CreditNoteUid` | `*string` | Optional | Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. | +| `OriginalAmount` | `*string` | Optional | The full, original amount of the credit note. | +| `AppliedAmount` | `*string` | Optional | The amount of the credit note applied to invoice. | +| `TransactionTime` | `*time.Time` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | +| `Memo` | `*string` | Optional | The credit note memo. | +| `Role` | `*string` | Optional | The role of the credit note (e.g. 'general') | +| `ConsolidatedInvoice` | `*bool` | Optional | Shows whether it was applied to consolidated invoice or not | +| `AppliedCreditNotes` | [`[]models.AppliedCreditNoteData`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | +| `DebitNoteNumber` | `*string` | Optional | A unique, identifying string that appears on the debit note and in places it is referenced. | +| `DebitNoteUid` | `*string` | Optional | Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. | +| `PaymentMethod` | [`*models.InvoiceEventPayment1`](../../doc/models/invoice-event-payment-1.md) | Optional | A nested data structure detailing the method of payment | +| `TransactionId` | `*int` | Optional | The Chargify id of the original payment | +| `ParentInvoiceNumber` | `Optional[int]` | Optional | - | +| `RemainingPrepaymentAmount` | `Optional[string]` | Optional | - | +| `Prepayment` | `*bool` | Optional | The flag that shows whether the original payment was a prepayment or not | +| `External` | `*bool` | Optional | - | +| `FromCollectionMethod` | `*string` | Optional | The previous collection method of the invoice. | +| `ToCollectionMethod` | `*string` | Optional | The new collection method of the invoice. | +| `ConsolidationLevel` | [`*models.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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | +| `FromStatus` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | +| `ToStatus` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | +| `DueAmount` | `*string` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | +| `TotalAmount` | `*string` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `ApplyCredit` | `*bool` | Optional | If true, credit was created and applied it to the invoice. | +| `CreditNoteAttributes` | [`*models.CreditNote1`](../../doc/models/credit-note-1.md) | Optional | - | +| `PaymentId` | `*int` | Optional | The ID of the payment transaction to be refunded. | +| `RefundAmount` | `*string` | Optional | The amount of the refund. | +| `RefundId` | `*int` | Optional | The ID of the refund transaction. | +| `IsAdvanceInvoice` | `*bool` | Optional | If true, the invoice is an advance invoice. | +| `Reason` | `*string` | Optional | The reason for the void. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "credit_note_number": "credit_note_number6", + "credit_note_uid": "credit_note_uid6", + "original_amount": "original_amount4", + "applied_amount": "applied_amount8" +} +``` + diff --git a/doc/models/invoice-event-payment-1.md b/doc/models/invoice-event-payment-1.md new file mode 100644 index 00000000..7d13b6bf --- /dev/null +++ b/doc/models/invoice-event-payment-1.md @@ -0,0 +1,43 @@ + +# Invoice Event Payment 1 + +A nested data structure detailing the method of payment + +## Structure + +`InvoiceEventPayment1` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Type` | `*string` | Optional | - | +| `MaskedAccountNumber` | `string` | Required | - | +| `MaskedRoutingNumber` | `string` | Required | - | +| `CardBrand` | `string` | Required | - | +| `CardExpiration` | `*string` | Optional | - | +| `LastFour` | `Optional[string]` | Optional | - | +| `MaskedCardNumber` | `string` | Required | - | +| `Details` | `*string` | Required | - | +| `Kind` | `string` | Required | - | +| `Memo` | `*string` | Required | - | +| `Email` | `string` | Required | - | + +## Example (as JSON) + +```json +{ + "type": "Invoice Event Payment1", + "masked_account_number": "masked_account_number4", + "masked_routing_number": "masked_routing_number4", + "card_brand": "card_brand8", + "card_expiration": "card_expiration4", + "last_four": "last_four2", + "masked_card_number": "masked_card_number6", + "details": "details8", + "kind": "kind6", + "memo": "memo2", + "email": "email8" +} +``` + diff --git a/doc/models/invoice-event-payment-method.md b/doc/models/invoice-event-payment-method.md new file mode 100644 index 00000000..1a53670f --- /dev/null +++ b/doc/models/invoice-event-payment-method.md @@ -0,0 +1,17 @@ + +# Invoice Event Payment Method + +## Enumeration + +`InvoiceEventPaymentMethod` + +## Fields + +| Name | +| --- | +| `APPLEPAY` | +| `BANKACCOUNT` | +| `CREDITCARD` | +| `EXTERNAL` | +| `PAYPALACCOUNT` | + diff --git a/doc/models/payment-method-nested-data.md b/doc/models/invoice-event-payment.md similarity index 74% rename from doc/models/payment-method-nested-data.md rename to doc/models/invoice-event-payment.md index ec49e845..948c56ae 100644 --- a/doc/models/payment-method-nested-data.md +++ b/doc/models/invoice-event-payment.md @@ -1,37 +1,37 @@ - -# Payment Method Nested Data - -A nested data structure detailing the method of payment - -## Structure - -`PaymentMethodNestedData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Type` | `*string` | Optional | **Default**: `"apple_pay"` | -| `MaskedAccountNumber` | `*string` | Optional | - | -| `MaskedRoutingNumber` | `*string` | Optional | - | -| `CardBrand` | `*string` | Optional | - | -| `CardExpiration` | `*string` | Optional | - | -| `LastFour` | `Optional[string]` | Optional | - | -| `MaskedCardNumber` | `*string` | Optional | - | -| `Details` | `*string` | Optional | - | -| `Kind` | `*string` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `Email` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "type": "apple_pay", - "masked_account_number": "masked_account_number8", - "masked_routing_number": "masked_routing_number8", - "card_brand": "card_brand4", - "card_expiration": "card_expiration2" -} -``` - + +# Invoice Event Payment + +A nested data structure detailing the method of payment + +## Structure + +`InvoiceEventPayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Type` | `*string` | Optional | - | +| `MaskedAccountNumber` | `*string` | Optional | - | +| `MaskedRoutingNumber` | `*string` | Optional | - | +| `CardBrand` | `*string` | Optional | - | +| `CardExpiration` | `*string` | Optional | - | +| `LastFour` | `Optional[string]` | Optional | - | +| `MaskedCardNumber` | `*string` | Optional | - | +| `Details` | `Optional[string]` | Optional | - | +| `Kind` | `*string` | Optional | - | +| `Memo` | `Optional[string]` | Optional | - | +| `Email` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "type": "Invoice Event Payment", + "masked_account_number": "masked_account_number8", + "masked_routing_number": "masked_routing_number8", + "card_brand": "card_brand4", + "card_expiration": "card_expiration2" +} +``` + diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index fea1486a..ff7d9c78 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -1,28 +1,28 @@ - -# Invoice Event Type - -Invoice Event Type - -## Enumeration - -`InvoiceEventType` - -## Fields - -| Name | -| --- | -| `ISSUEINVOICE` | -| `APPLYCREDITNOTE` | -| `CREATECREDITNOTE` | -| `APPLYPAYMENT` | -| `APPLYDEBITNOTE` | -| `REFUNDINVOICE` | -| `VOIDINVOICE` | -| `VOIDREMAINDER` | -| `BACKPORTINVOICE` | -| `CHANGEINVOICESTATUS` | -| `CHANGEINVOICECOLLECTIONMETHOD` | -| `REMOVEPAYMENT` | -| `FAILEDPAYMENT` | -| `CHANGECHARGEBACKSTATUS` | - + +# Invoice Event Type + +Invoice Event Type + +## Enumeration + +`InvoiceEventType` + +## Fields + +| Name | +| --- | +| `ISSUEINVOICE` | +| `APPLYCREDITNOTE` | +| `CREATECREDITNOTE` | +| `APPLYPAYMENT` | +| `APPLYDEBITNOTE` | +| `REFUNDINVOICE` | +| `VOIDINVOICE` | +| `VOIDREMAINDER` | +| `BACKPORTINVOICE` | +| `CHANGEINVOICESTATUS` | +| `CHANGEINVOICECOLLECTIONMETHOD` | +| `REMOVEPAYMENT` | +| `FAILEDPAYMENT` | +| `CHANGECHARGEBACKSTATUS` | + diff --git a/doc/models/invoice-event.md b/doc/models/invoice-event.md index eaaca577..9601c5c7 100644 --- a/doc/models/invoice-event.md +++ b/doc/models/invoice-event.md @@ -1,41 +1,41 @@ - -# Invoice Event - -## Structure - -`InvoiceEvent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `EventType` | [`*models.InvoiceEventType`](../../doc/models/invoice-event-type.md) | Optional | Invoice Event Type | -| `EventData` | [`*models.InvoiceEvent1`](../../doc/models/invoice-event-1.md) | Optional | The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. | -| `Timestamp` | `*string` | Optional | - | -| `Invoice` | [`*models.Invoice`](../../doc/models/invoice.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 78, - "event_type": "void_invoice", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2" - }, - "timestamp": "timestamp8", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} -``` - + +# Invoice Event + +## Structure + +`InvoiceEvent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `EventType` | [`*models.InvoiceEventType`](../../doc/models/invoice-event-type.md) | Optional | Invoice Event Type | +| `EventData` | [`*models.InvoiceEventData`](../../doc/models/invoice-event-data.md) | Optional | The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. | +| `Timestamp` | `*string` | Optional | - | +| `Invoice` | [`*models.Invoice`](../../doc/models/invoice.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 78, + "event_type": "void_invoice", + "event_data": { + "uid": "uid6", + "credit_note_number": "credit_note_number0", + "credit_note_uid": "credit_note_uid0", + "original_amount": "original_amount0", + "applied_amount": "applied_amount2" + }, + "timestamp": "timestamp8", + "invoice": { + "id": 166, + "uid": "uid6", + "site_id": 92, + "customer_id": 204, + "subscription_id": 20 + } +} +``` + diff --git a/doc/models/invoice-line-item-component-cost-data.md b/doc/models/invoice-line-item-component-cost-data.md index 635a9faa..5168aa78 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -1,43 +1,43 @@ - -# Invoice Line Item Component Cost Data - -## Structure - -`InvoiceLineItemComponentCostData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Rates` | [`[]models.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" - } - ] -} -``` - + +# Invoice Line Item Component Cost Data + +## Structure + +`InvoiceLineItemComponentCostData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Rates` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index 68ba78b8..f9890c0c 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -1,45 +1,45 @@ - -# Invoice Line Item - -## Structure - -`InvoiceLineItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | -| `Title` | `*string` | Optional | A short descriptor for the charge or item represented by this line. | -| `Description` | `*string` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

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

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

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

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

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | -| `TotalAmount` | `*string` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | -| `TieredUnitPrice` | `*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. | -| `PeriodRangeStart` | `*time.Time` | 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. | -| `PeriodRangeEnd` | `*time.Time` | 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. | -| `TransactionId` | `*int` | Optional | - | -| `ProductId` | `Optional[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`. | -| `ProductVersion` | `Optional[int]` | Optional | The version of the product subscribed when the charge was made. | -| `ComponentId` | `Optional[int]` | Optional | The ID of the component being billed. Will be `nil` for non-component charges. | -| `PricePointId` | `Optional[int]` | Optional | The price point ID of the component being billed. Will be `nil` for non-component charges. | -| `Hide` | `*bool` | Optional | - | -| `ComponentCostData` | [`Optional[models.InvoiceLineItemComponentCostData]`](../../doc/models/invoice-line-item-component-cost-data.md) | Optional | - | -| `ProductPricePointId` | `Optional[int]` | Optional | The price point ID of the line item's product | -| `CustomItem` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description4", - "quantity": "quantity0", - "unit_price": "unit_price2" -} -``` - + +# Invoice Line Item + +## Structure + +`InvoiceLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `Title` | `*string` | Optional | A short descriptor for the charge or item represented by this line. | +| `Description` | `*string` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

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

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

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

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

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | +| `TotalAmount` | `*string` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | +| `TieredUnitPrice` | `*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. | +| `PeriodRangeStart` | `*time.Time` | 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. | +| `PeriodRangeEnd` | `*time.Time` | 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. | +| `TransactionId` | `*int` | Optional | - | +| `ProductId` | `Optional[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`. | +| `ProductVersion` | `Optional[int]` | Optional | The version of the product subscribed when the charge was made. | +| `ComponentId` | `Optional[int]` | Optional | The ID of the component being billed. Will be `nil` for non-component charges. | +| `PricePointId` | `Optional[int]` | Optional | The price point ID of the component being billed. Will be `nil` for non-component charges. | +| `Hide` | `*bool` | Optional | - | +| `ComponentCostData` | [`Optional[models.InvoiceLineItemComponentCostData]`](../../doc/models/invoice-line-item-component-cost-data.md) | Optional | - | +| `ProductPricePointId` | `Optional[int]` | Optional | The price point ID of the line item's product | +| `CustomItem` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "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 new file mode 100644 index 00000000..201fc39d --- /dev/null +++ b/doc/models/invoice-payer-change.md @@ -0,0 +1,27 @@ + +# Invoice Payer Change + +## Structure + +`InvoicePayerChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Organization` | `*string` | Optional | - | +| `Email` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name2", + "last_name": "last_name0", + "organization": "organization4", + "email": "email4" +} +``` + diff --git a/doc/models/invoice-payer.md b/doc/models/invoice-payer.md index b941e077..192c5ad9 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -1,30 +1,30 @@ - -# Invoice Payer - -## Structure - -`InvoicePayer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyId` | `*int` | Optional | - | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Organization` | `Optional[string]` | Optional | - | -| `Email` | `*string` | Optional | - | -| `VatNumber` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} -``` - + +# Invoice Payer + +## Structure + +`InvoicePayer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyId` | `*int` | Optional | - | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Organization` | `Optional[string]` | Optional | - | +| `Email` | `*string` | Optional | - | +| `VatNumber` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "chargify_id": 46, + "first_name": "first_name4", + "last_name": "last_name2", + "organization": "organization8", + "email": "email2" +} +``` + diff --git a/doc/models/invoice-payment-application.md b/doc/models/invoice-payment-application.md index 53753c85..7f46147d 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -1,25 +1,25 @@ - -# Invoice Payment Application - -## Structure - -`InvoicePaymentApplication` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `InvoiceUid` | `*string` | Optional | Unique identifier for the paid invoice. It has the prefix "inv_" followed by alphanumeric characters. | -| `ApplicationUid` | `*string` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | -| `AppliedAmount` | `*string` | Optional | Dollar amount of the paid invoice. | - -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} -``` - + +# Invoice Payment Application + +## Structure + +`InvoicePaymentApplication` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `InvoiceUid` | `*string` | Optional | Unique identifier for the paid invoice. It has the prefix "inv_" followed by alphanumeric characters. | +| `ApplicationUid` | `*string` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | +| `AppliedAmount` | `*string` | Optional | Dollar amount of the paid invoice. | + +## Example (as JSON) + +```json +{ + "invoice_uid": "invoice_uid2", + "application_uid": "application_uid4", + "applied_amount": "applied_amount6" +} +``` + diff --git a/doc/models/invoice-payment-method-type.md b/doc/models/invoice-payment-method-type.md index 46652e8e..dcf93ab0 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -1,20 +1,20 @@ - -# Invoice Payment Method Type - -The type of payment method used. - -## Enumeration - -`InvoicePaymentMethodType` - -## Fields - -| Name | -| --- | -| `CREDITCARD` | -| `CHECK` | -| `CASH` | -| `MONEYORDER` | -| `ACH` | -| `OTHER` | - + +# Invoice Payment Method Type + +The type of payment method used. Defaults to other. + +## Enumeration + +`InvoicePaymentMethodType` + +## Fields + +| Name | +| --- | +| `CREDITCARD` | +| `CHECK` | +| `CASH` | +| `MONEYORDER` | +| `ACH` | +| `OTHER` | + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index 29c8b5ac..4332049c 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -1,32 +1,32 @@ - -# Invoice Payment Method - -## Structure - -`InvoicePaymentMethod` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Details` | `*string` | Optional | - | -| `Kind` | `*string` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `Type` | `*string` | Optional | - | -| `CardBrand` | `*string` | Optional | - | -| `CardExpiration` | `*string` | Optional | - | -| `LastFour` | `Optional[string]` | Optional | - | -| `MaskedCardNumber` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} -``` - + +# Invoice Payment Method + +## Structure + +`InvoicePaymentMethod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Details` | `*string` | Optional | - | +| `Kind` | `*string` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `Type` | `*string` | Optional | - | +| `CardBrand` | `*string` | Optional | - | +| `CardExpiration` | `*string` | Optional | - | +| `LastFour` | `Optional[string]` | Optional | - | +| `MaskedCardNumber` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "details": "details8", + "kind": "kind6", + "memo": "memo2", + "type": "type8", + "card_brand": "card_brand8" +} +``` + diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 3d3bc81c..aa77d6fa 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -1,18 +1,18 @@ - -# Invoice Payment Type - -The type of payment to be applied to an Invoice. - -## Enumeration - -`InvoicePaymentType` - -## Fields - -| Name | -| --- | -| `EXTERNAL` | -| `PREPAYMENT` | -| `SERVICECREDIT` | -| `PAYMENT` | - + +# Invoice Payment Type + +The type of payment to be applied to an Invoice. Defaults to external. + +## Enumeration + +`InvoicePaymentType` + +## Fields + +| Name | +| --- | +| `EXTERNAL` | +| `PREPAYMENT` | +| `SERVICECREDIT` | +| `PAYMENT` | + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 714ac0d8..a3ac1b2f 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -1,40 +1,40 @@ - -# Invoice Payment - -## Structure - -`InvoicePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionTime` | `*time.Time` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `OriginalAmount` | `*string` | Optional | - | -| `AppliedAmount` | `*string` | Optional | - | -| `PaymentMethod` | [`*models.InvoicePaymentMethod`](../../doc/models/invoice-payment-method.md) | Optional | - | -| `TransactionId` | `*int` | Optional | - | -| `Prepayment` | `*bool` | Optional | - | -| `GatewayHandle` | `Optional[string]` | Optional | - | -| `GatewayUsed` | `*string` | Optional | - | -| `GatewayTransactionId` | `Optional[string]` | Optional | The transaction ID for the payment as returned from the payment gateway | - -## 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" - } -} -``` - + +# Invoice Payment + +## Structure + +`InvoicePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionTime` | `*time.Time` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `OriginalAmount` | `*string` | Optional | - | +| `AppliedAmount` | `*string` | Optional | - | +| `PaymentMethod` | [`*models.InvoicePaymentMethod`](../../doc/models/invoice-payment-method.md) | Optional | - | +| `TransactionId` | `*int` | Optional | - | +| `Prepayment` | `*bool` | Optional | - | +| `GatewayHandle` | `Optional[string]` | Optional | - | +| `GatewayUsed` | `*string` | Optional | - | +| `GatewayTransactionId` | `Optional[string]` | Optional | The transaction ID for the payment as returned from the payment gateway | + +## 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" + } +} +``` + diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index d69ca6c5..d30acb6d 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -1,25 +1,25 @@ - -# Invoice Pre Payment - -## Structure - -`InvoicePrePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionId` | `*string` | Optional | The subscription id for the prepayment account | -| `AmountInCents` | `*string` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | -| `EndingBalanceInCents` | `*string` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | - -## Example (as JSON) - -```json -{ - "subscription_id": "subscription_id0", - "amount_in_cents": "amount_in_cents2", - "ending_balance_in_cents": "ending_balance_in_cents4" -} -``` - + +# Invoice Pre Payment + +## Structure + +`InvoicePrePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionId` | `*string` | Optional | The subscription id for the prepayment account | +| `AmountInCents` | `*string` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | +| `EndingBalanceInCents` | `*string` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | + +## Example (as JSON) + +```json +{ + "subscription_id": "subscription_id0", + "amount_in_cents": "amount_in_cents2", + "ending_balance_in_cents": "ending_balance_in_cents4" +} +``` + diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index e4d0b8ce..a5b15144 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -1,29 +1,29 @@ - -# Invoice Previous Balance - -## Structure - -`InvoicePreviousBalance` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CapturedAt` | `*time.Time` | Optional | - | -| `Invoices` | [`[]models.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" - } - ] -} -``` - + +# Invoice Previous Balance + +## Structure + +`InvoicePreviousBalance` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CapturedAt` | `*time.Time` | Optional | - | +| `Invoices` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index cde8efc4..d0236020 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -1,30 +1,30 @@ - -# Invoice Refund - -## Structure - -`InvoiceRefund` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionId` | `*int` | Optional | - | -| `PaymentId` | `*int` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `OriginalAmount` | `*string` | Optional | - | -| `AppliedAmount` | `*string` | Optional | - | -| `GatewayTransactionId` | `Optional[string]` | Optional | The transaction ID for the refund as returned from the payment gateway | - -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} -``` - + +# Invoice Refund + +## Structure + +`InvoiceRefund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionId` | `*int` | Optional | - | +| `PaymentId` | `*int` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `OriginalAmount` | `*string` | Optional | - | +| `AppliedAmount` | `*string` | Optional | - | +| `GatewayTransactionId` | `Optional[string]` | Optional | The transaction ID for the refund as returned from the payment gateway | + +## Example (as JSON) + +```json +{ + "transaction_id": 172, + "payment_id": 42, + "memo": "memo6", + "original_amount": "original_amount6", + "applied_amount": "applied_amount6" +} +``` + diff --git a/doc/models/invoice-response.md b/doc/models/invoice-response.md index 9f537353..ebb6d559 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -1,30 +1,31 @@ - -# Invoice Response - -## Structure - -`InvoiceResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Invoice` | [`models.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", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} -``` - + +# Invoice Response + +## Structure + +`InvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Invoice` | [`models.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", + "collection_method": "automatic", + "id": 166, + "uid": "uid6", + "site_id": 92, + "customer_id": 204, + "subscription_id": 20 + } +} +``` + diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md new file mode 100644 index 00000000..bbfa6721 --- /dev/null +++ b/doc/models/invoice-role.md @@ -0,0 +1,22 @@ + +# Invoice Role + +## Enumeration + +`InvoiceRole` + +## Fields + +| Name | +| --- | +| `UNSET` | +| `SIGNUP` | +| `RENEWAL` | +| `USAGE` | +| `REACTIVATION` | +| `PRORATION` | +| `MIGRATION` | +| `ADHOC` | +| `BACKPORT` | +| `BACKPORTBALANCERECONCILIATION` | + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index ffb2d082..5c71141d 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -1,35 +1,35 @@ - -# Invoice Seller - -Information about the seller (merchant) listed on the masthead of the invoice. - -## Structure - -`InvoiceSeller` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Address` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `Phone` | `*string` | Optional | - | -| `LogoUrl` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" - }, - "phone": "phone0", - "logo_url": "logo_url0" -} -``` - + +# Invoice Seller + +Information about the seller (merchant) listed on the masthead of the invoice. + +## Structure + +`InvoiceSeller` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Address` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `Phone` | `*string` | Optional | - | +| `LogoUrl` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name0", + "address": { + "street": "street6", + "line2": "line20", + "city": "city6", + "state": "state2", + "zip": "zip0" + }, + "phone": "phone0", + "logo_url": "logo_url0" +} +``` + diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 5e1c6a2b..24de9e6d 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -1,26 +1,26 @@ - -# Invoice Sort Field - -## Enumeration - -`InvoiceSortField` - -## Fields - -| Name | -| --- | -| `STATUS` | -| `TOTALAMOUNT` | -| `DUEAMOUNT` | -| `CREATEDAT` | -| `UPDATEDAT` | -| `ISSUEDATE` | -| `DUEDATE` | -| `NUMBER` | - -## Example - -``` -total_amount -``` - + +# Invoice Sort Field + +## Enumeration + +`InvoiceSortField` + +## Fields + +| Name | +| --- | +| `STATUS` | +| `TOTALAMOUNT` | +| `DUEAMOUNT` | +| `CREATEDAT` | +| `UPDATEDAT` | +| `ISSUEDATE` | +| `DUEDATE` | +| `NUMBER` | + +## Example + +``` +total_amount +``` + diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 4e690dea..e20a446c 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -1,20 +1,20 @@ - -# Invoice Status - -The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. - -## Enumeration - -`InvoiceStatus` - -## Fields - -| Name | -| --- | -| `DRAFT` | -| `OPEN` | -| `PAID` | -| `PENDING` | -| `VOIDED` | -| `CANCELED` | - + +# Invoice Status + +The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. + +## Enumeration + +`InvoiceStatus` + +## Fields + +| Name | +| --- | +| `DRAFT` | +| `OPEN` | +| `PAID` | +| `PENDING` | +| `VOIDED` | +| `CANCELED` | + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index dca5d735..6a2dfce8 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -1,25 +1,25 @@ - -# Invoice Tax Breakout - -## Structure - -`InvoiceTaxBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `TaxableAmount` | `*string` | Optional | - | -| `TaxAmount` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6" -} -``` - + +# Invoice Tax Breakout + +## Structure + +`InvoiceTaxBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `TaxableAmount` | `*string` | Optional | - | +| `TaxAmount` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "taxable_amount": "taxable_amount6", + "tax_amount": "tax_amount6" +} +``` + diff --git a/doc/models/invoice-tax-component-breakout.md b/doc/models/invoice-tax-component-breakout.md index ccac38a3..956a1ac3 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -1,27 +1,27 @@ - -# Invoice Tax Component Breakout - -## Structure - -`InvoiceTaxComponentBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TaxRuleId` | `*int` | Optional | - | -| `Percentage` | `*string` | Optional | - | -| `CountryCode` | `*string` | Optional | - | -| `SubdivisionCode` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6" -} -``` - + +# Invoice Tax Component Breakout + +## Structure + +`InvoiceTaxComponentBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TaxRuleId` | `*int` | Optional | - | +| `Percentage` | `*string` | Optional | - | +| `CountryCode` | `*string` | Optional | - | +| `SubdivisionCode` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "tax_rule_id": 226, + "percentage": "percentage0", + "country_code": "country_code8", + "subdivision_code": "subdivision_code6" +} +``` + diff --git a/doc/models/invoice-tax.md b/doc/models/invoice-tax.md index cafd2d10..927d949d 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -1,35 +1,35 @@ - -# Invoice Tax - -## Structure - -`InvoiceTax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Title` | `*string` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | -| `SourceType` | `*string` | Optional | - | -| `SourceId` | `*int` | Optional | - | -| `Percentage` | `*string` | Optional | - | -| `TaxableAmount` | `*string` | Optional | - | -| `TaxAmount` | `*string` | Optional | - | -| `TransactionId` | `*int` | Optional | - | -| `LineItemBreakouts` | [`[]models.InvoiceTaxBreakout`](../../doc/models/invoice-tax-breakout.md) | Optional | - | -| `TaxComponentBreakouts` | [`[]models.InvoiceTaxComponentBreakout`](../../doc/models/invoice-tax-component-breakout.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "source_type8", - "source_id": 164 -} -``` - + +# Invoice Tax + +## Structure + +`InvoiceTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Title` | `*string` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | +| `SourceType` | `*string` | Optional | - | +| `SourceId` | `*int` | Optional | - | +| `Percentage` | `*string` | Optional | - | +| `TaxableAmount` | `*string` | Optional | - | +| `TaxAmount` | `*string` | Optional | - | +| `TransactionId` | `*int` | Optional | - | +| `LineItemBreakouts` | [`[]models.InvoiceTaxBreakout`](../../doc/models/invoice-tax-breakout.md) | Optional | - | +| `TaxComponentBreakouts` | [`[]models.InvoiceTaxComponentBreakout`](../../doc/models/invoice-tax-component-breakout.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "title": "title6", + "description": "description2", + "source_type": "source_type8", + "source_id": 164 +} +``` + diff --git a/doc/models/invoice.md b/doc/models/invoice.md index f6f991fe..83565790 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -1,79 +1,80 @@ - -# Invoice - -## Structure - -`Invoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int64` | Optional | - | -| `Uid` | `*string` | Optional | Unique identifier for the invoice. It is generated automatically by Chargify and has the prefix "inv_" followed by alphanumeric characters. | -| `SiteId` | `*int` | Optional | ID of the site to which the invoice belongs. | -| `CustomerId` | `*int` | Optional | ID of the customer to which the invoice belongs. | -| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the invoice. | -| `Number` | `*string` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `SequenceNumber` | `*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. | -| `TransactionTime` | `*time.Time` | Optional | - | -| `CreatedAt` | `*time.Time` | Optional | - | -| `UpdatedAt` | `*time.Time` | Optional | - | -| `IssueDate` | `*time.Time` | 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"`. | -| `DueDate` | `*time.Time` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | -| `PaidDate` | `Optional[time.Time]` | 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` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | -| `Role` | `*string` | Optional | - | -| `ParentInvoiceId` | `Optional[int]` | Optional | - | -| `CollectionMethod` | `*string` | Optional | The collection method of the invoice, which is either "automatic" (tried and retried on an existing payment method by Chargify) or "remittance" (payment must be remitted by the customer or keyed in by the merchant). | -| `PaymentInstructions` | `*string` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | -| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | -| `ConsolidationLevel` | [`*models.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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | -| `ParentInvoiceUid` | `Optional[string]` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | -| `SubscriptionGroupId` | `Optional[int]` | Optional | - | -| `ParentInvoiceNumber` | `Optional[int]` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | -| `GroupPrimarySubscriptionId` | `Optional[int]` | Optional | For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice. | -| `ProductName` | `*string` | Optional | The name of the product subscribed when the invoice was generated. | -| `ProductFamilyName` | `*string` | Optional | The name of the product family subscribed when the invoice was generated. | -| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | -| `Payer` | [`*models.InvoicePayer`](../../doc/models/invoice-payer.md) | Optional | - | -| `RecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | -| `NetTerms` | `*int` | Optional | - | -| `Memo` | `*string` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | -| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | -| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | -| `SubtotalAmount` | `*string` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | -| `DiscountAmount` | `*string` | Optional | Total discount applied to the invoice. | -| `TaxAmount` | `*string` | Optional | Total tax on the invoice. | -| `TotalAmount` | `*string` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | -| `CreditAmount` | `*string` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | -| `RefundAmount` | `*string` | Optional | - | -| `PaidAmount` | `*string` | Optional | The amount paid on the invoice by the customer. | -| `DueAmount` | `*string` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | -| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | Line items on the invoice. | -| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | -| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | -| `Credits` | [`[]models.InvoiceCredit`](../../doc/models/invoice-credit.md) | Optional | - | -| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | -| `Payments` | [`[]models.InvoicePayment`](../../doc/models/invoice-payment.md) | Optional | - | -| `CustomFields` | [`[]models.InvoiceCustomField`](../../doc/models/invoice-custom-field.md) | Optional | - | -| `DisplaySettings` | [`*models.InvoiceDisplaySettings`](../../doc/models/invoice-display-settings.md) | Optional | - | -| `PublicUrl` | `*string` | Optional | The public URL of the invoice | -| `PreviousBalanceData` | [`*models.InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "id": 252, - "uid": "uid0", - "site_id": 178, - "customer_id": 34, - "subscription_id": 106 -} -``` - + +# Invoice + +## Structure + +`Invoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int64` | Optional | - | +| `Uid` | `*string` | Optional | Unique identifier for the invoice. It is generated automatically by Chargify and has the prefix "inv_" followed by alphanumeric characters. | +| `SiteId` | `*int` | Optional | ID of the site to which the invoice belongs. | +| `CustomerId` | `*int` | Optional | ID of the customer to which the invoice belongs. | +| `SubscriptionId` | `*int` | Optional | ID of the subscription that generated the invoice. | +| `Number` | `*string` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | +| `SequenceNumber` | `*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. | +| `TransactionTime` | `*time.Time` | Optional | - | +| `CreatedAt` | `*time.Time` | Optional | - | +| `UpdatedAt` | `*time.Time` | Optional | - | +| `IssueDate` | `*time.Time` | 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"`. | +| `DueDate` | `*time.Time` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | +| `PaidDate` | `Optional[time.Time]` | 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` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | +| `Role` | [`*models.InvoiceRole`](../../doc/models/invoice-role.md) | Optional | - | +| `ParentInvoiceId` | `Optional[int]` | Optional | - | +| `CollectionMethod` | [`*models.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`.
**Default**: `"automatic"` | +| `PaymentInstructions` | `*string` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | +| `Currency` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `ConsolidationLevel` | [`*models.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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | +| `ParentInvoiceUid` | `Optional[string]` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | +| `SubscriptionGroupId` | `Optional[int]` | Optional | - | +| `ParentInvoiceNumber` | `Optional[int]` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | +| `GroupPrimarySubscriptionId` | `Optional[int]` | Optional | For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice. | +| `ProductName` | `*string` | Optional | The name of the product subscribed when the invoice was generated. | +| `ProductFamilyName` | `*string` | Optional | The name of the product family subscribed when the invoice was generated. | +| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | +| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `Payer` | [`*models.InvoicePayer`](../../doc/models/invoice-payer.md) | Optional | - | +| `RecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | +| `NetTerms` | `*int` | Optional | - | +| `Memo` | `*string` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | +| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | +| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | +| `SubtotalAmount` | `*string` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | +| `DiscountAmount` | `*string` | Optional | Total discount applied to the invoice. | +| `TaxAmount` | `*string` | Optional | Total tax on the invoice. | +| `TotalAmount` | `*string` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `CreditAmount` | `*string` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | +| `RefundAmount` | `*string` | Optional | - | +| `PaidAmount` | `*string` | Optional | The amount paid on the invoice by the customer. | +| `DueAmount` | `*string` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | +| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | Line items on the invoice. | +| `Discounts` | [`[]models.InvoiceDiscount`](../../doc/models/invoice-discount.md) | Optional | - | +| `Taxes` | [`[]models.InvoiceTax`](../../doc/models/invoice-tax.md) | Optional | - | +| `Credits` | [`[]models.InvoiceCredit`](../../doc/models/invoice-credit.md) | Optional | - | +| `Refunds` | [`[]models.InvoiceRefund`](../../doc/models/invoice-refund.md) | Optional | - | +| `Payments` | [`[]models.InvoicePayment`](../../doc/models/invoice-payment.md) | Optional | - | +| `CustomFields` | [`[]models.InvoiceCustomField`](../../doc/models/invoice-custom-field.md) | Optional | - | +| `DisplaySettings` | [`*models.InvoiceDisplaySettings`](../../doc/models/invoice-display-settings.md) | Optional | - | +| `PublicUrl` | `*string` | Optional | The public URL of the invoice | +| `PreviousBalanceData` | [`*models.InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "issue_date": "2024-01-01", + "due_date": "2024-01-01", + "paid_date": "2024-01-01", + "collection_method": "automatic", + "id": 252, + "uid": "uid0", + "site_id": 178, + "customer_id": 34, + "subscription_id": 106 +} +``` + diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index eb04bb6a..b3dc1ffd 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -1,21 +1,21 @@ - -# Issue Advance Invoice Request - -## Structure - -`IssueAdvanceInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Force` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "force": false -} -``` - + +# Issue Advance Invoice Request + +## Structure + +`IssueAdvanceInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Force` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "force": false +} +``` + diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 5ca46798..831c899f 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -1,21 +1,21 @@ - -# Issue Invoice Request - -## Structure - -`IssueInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `OnFailedPayment` | [`*models.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) - -```json -{ - "on_failed_payment": "leave_open_invoice" -} -``` - + +# Issue Invoice Request + +## Structure + +`IssueInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `OnFailedPayment` | [`*models.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) + +```json +{ + "on_failed_payment": "leave_open_invoice" +} +``` + diff --git a/doc/models/issue-service-credit-request.md b/doc/models/issue-service-credit-request.md index a0dc3b8d..0f3bc8ad 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -1,27 +1,27 @@ - -# Issue Service Credit Request - -## Structure - -`IssueServiceCreditRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ServiceCredit` | [`models.IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | - -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo0" - } -} -``` - + +# Issue Service Credit Request + +## Structure + +`IssueServiceCreditRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ServiceCredit` | [`models.IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | + +## Example (as JSON) + +```json +{ + "service_credit": { + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo0" + } +} +``` + diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index 96e2499a..20cc80cb 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -1,26 +1,26 @@ - -# Issue Service Credit - -## Structure - -`IssueServiceCredit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `interface{}` | Required | - | -| `Memo` | `string` | Required | - | - -## Example (as JSON) - -```json -{ - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo4" -} -``` - + +# Issue Service Credit + +## Structure + +`IssueServiceCredit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `interface{}` | Required | - | +| `Memo` | `string` | Required | - | + +## Example (as JSON) + +```json +{ + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo4" +} +``` + diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 94f93a04..cedcdd2f 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -1,25 +1,25 @@ - -# Item Category - -One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other - -## Enumeration - -`ItemCategory` - -## Fields - -| Name | -| --- | -| `ENUMBUSINESSSOFTWARE` | -| `ENUMCONSUMERSOFTWARE` | -| `ENUMDIGITALSERVICES` | -| `ENUMPHYSICALGOODS` | -| `OTHER` | - -## Example - -``` -Business Software -``` - + +# Item Category + +One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other + +## Enumeration + +`ItemCategory` + +## Fields + +| Name | +| --- | +| `ENUMBUSINESSSOFTWARE` | +| `ENUMCONSUMERSOFTWARE` | +| `ENUMDIGITALSERVICES` | +| `ENUMPHYSICALGOODS` | +| `OTHER` | + +## Example + +``` +Business Software +``` + diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 5acf41b6..4a364f88 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -1,24 +1,24 @@ - -# Line Item Kind - -A handle for the line item kind - -## Enumeration - -`LineItemKind` - -## Fields - -| Name | -| --- | -| `BASELINE` | -| `INITIAL` | -| `TRIAL` | -| `QUANTITYBASEDCOMPONENT` | -| `PREPAIDUSAGECOMPONENT` | -| `ONOFFCOMPONENT` | -| `METEREDCOMPONENT` | -| `EVENTBASEDCOMPONENT` | -| `COUPON` | -| `TAX` | - + +# Line Item Kind + +A handle for the line item kind + +## Enumeration + +`LineItemKind` + +## Fields + +| Name | +| --- | +| `BASELINE` | +| `INITIAL` | +| `TRIAL` | +| `QUANTITYBASEDCOMPONENT` | +| `PREPAIDUSAGECOMPONENT` | +| `ONOFFCOMPONENT` | +| `METEREDCOMPONENT` | +| `EVENTBASEDCOMPONENT` | +| `COUPON` | +| `TAX` | + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md index ca5b83db..0c8d0a2d 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -1,21 +1,21 @@ - -# Line Item Transaction Type - -A handle for the line item transaction type - -## Enumeration - -`LineItemTransactionType` - -## Fields - -| Name | -| --- | -| `CHARGE` | -| `CREDIT` | -| `ADJUSTMENT` | -| `PAYMENT` | -| `REFUND` | -| `INFOTRANSACTION` | -| `PAYMENTAUTHORIZATION` | - + +# Line Item Transaction Type + +A handle for the line item transaction type + +## Enumeration + +`LineItemTransactionType` + +## Fields + +| Name | +| --- | +| `CHARGE` | +| `CREDIT` | +| `ADJUSTMENT` | +| `PAYMENT` | +| `REFUND` | +| `INFOTRANSACTION` | +| `PAYMENTAUTHORIZATION` | + diff --git a/doc/models/list-components-price-points-include.md b/doc/models/list-components-price-points-include.md index 49459716..a2df15ed 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -1,19 +1,19 @@ - -# List Components Price Points Include - -## Enumeration - -`ListComponentsPricePointsInclude` - -## Fields - -| Name | -| --- | -| `CURRENCYPRICES` | - -## Example - -``` -currency_prices -``` - + +# List Components Price Points Include + +## Enumeration + +`ListComponentsPricePointsInclude` + +## Fields + +| Name | +| --- | +| `CURRENCYPRICES` | + +## Example + +``` +currency_prices +``` + diff --git a/doc/models/list-components-price-points-response.md b/doc/models/list-components-price-points-response.md index f70a156b..bc44bbae 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -1,30 +1,29 @@ - -# List Components Price Points Response - -## Structure - -`ListComponentsPricePointsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | - -## Example (as JSON) - -```json -{ - "price_points": [ - { - "use_site_exchange_rate": true, - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } - ] -} -``` - + +# List Components Price Points Response + +## Structure + +`ListComponentsPricePointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index 1f8ecbbc..8d8e0202 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -1,29 +1,29 @@ - -# List Credit Notes Response - -## Structure - -`ListCreditNotesResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CreditNotes` | [`[]models.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" - } - ] -} -``` - + +# List Credit Notes Response + +## Structure + +`ListCreditNotesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CreditNotes` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/list-events-date-field.md b/doc/models/list-events-date-field.md index 2063a16f..ce5b4f15 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -1,19 +1,19 @@ - -# List Events Date Field - -## Enumeration - -`ListEventsDateField` - -## Fields - -| Name | -| --- | -| `CREATEDAT` | - -## Example - -``` -created_at -``` - + +# List Events Date Field + +## Enumeration + +`ListEventsDateField` + +## Fields + +| Name | +| --- | +| `CREATEDAT` | + +## Example + +``` +created_at +``` + diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 5eddedb1..cfd60b9a 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -1,47 +1,47 @@ - -# List Invoice Events Response - -## Structure - -`ListInvoiceEventsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Events` | [`[]models.InvoiceEvent`](../../doc/models/invoice-event.md) | Optional | - | -| `Page` | `*int` | Optional | - | -| `PerPage` | `*int` | Optional | - | -| `TotalPages` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "events": [ - { - "id": 68, - "event_type": "void_invoice", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2" - }, - "timestamp": "timestamp8", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } - } - ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} -``` - + +# List Invoice Events Response + +## Structure + +`ListInvoiceEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Events` | [`[]models.InvoiceEvent`](../../doc/models/invoice-event.md) | Optional | - | +| `Page` | `*int` | Optional | - | +| `PerPage` | `*int` | Optional | - | +| `TotalPages` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "events": [ + { + "id": 68, + "event_type": "void_invoice", + "event_data": { + "uid": "uid6", + "credit_note_number": "credit_note_number0", + "credit_note_uid": "credit_note_uid0", + "original_amount": "original_amount0", + "applied_amount": "applied_amount2" + }, + "timestamp": "timestamp8", + "invoice": { + "id": 166, + "uid": "uid6", + "site_id": 92, + "customer_id": 204, + "subscription_id": 20 + } + } + ], + "page": 184, + "per_page": 96, + "total_pages": 194 +} +``` + diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index eb538a21..c4090b52 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -1,32 +1,33 @@ - -# List Invoices Response - -## Structure - -`ListInvoicesResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Invoices` | [`[]models.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", - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } - ] -} -``` - + +# List Invoices Response + +## Structure + +`ListInvoicesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Invoices` | [`[]models.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", + "collection_method": "automatic", + "id": 196, + "uid": "uid6", + "site_id": 122, + "customer_id": 234, + "subscription_id": 50 + } + ] +} +``` + diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index ff017182..0bc4436a 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -1,43 +1,43 @@ - -# List Metafields Response - -## Structure - -`ListMetafieldsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TotalCount` | `*int` | Optional | - | -| `CurrentPage` | `*int` | Optional | - | -| `TotalPages` | `*int` | Optional | - | -| `PerPage` | `*int` | Optional | - | -| `Metafields` | [`[]models.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": "input_type4" - } - ] -} -``` - + +# List Metafields Response + +## Structure + +`ListMetafieldsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TotalCount` | `*int` | Optional | - | +| `CurrentPage` | `*int` | Optional | - | +| `TotalPages` | `*int` | Optional | - | +| `PerPage` | `*int` | Optional | - | +| `Metafields` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 5eaa7858..6eed7919 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -1,31 +1,31 @@ - -# List MRR Response Result - -## Structure - -`ListMRRResponseResult` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Page` | `*int` | Optional | - | -| `PerPage` | `*int` | Optional | - | -| `TotalPages` | `*int` | Optional | - | -| `TotalEntries` | `*int` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `CurrencySymbol` | `*string` | Optional | - | -| `Movements` | [`[]models.Movement`](../../doc/models/movement.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} -``` - + +# List MRR Response Result + +## Structure + +`ListMRRResponseResult` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Page` | `*int` | Optional | - | +| `PerPage` | `*int` | Optional | - | +| `TotalPages` | `*int` | Optional | - | +| `TotalEntries` | `*int` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `CurrencySymbol` | `*string` | Optional | - | +| `Movements` | [`[]models.Movement`](../../doc/models/movement.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "page": 150, + "per_page": 238, + "total_pages": 16, + "total_entries": 112, + "currency": "currency8" +} +``` + diff --git a/doc/models/list-mrr-response.md b/doc/models/list-mrr-response.md index 32c50529..b5691029 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -1,27 +1,27 @@ - -# List MRR Response - -## Structure - -`ListMRRResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Mrr` | [`models.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" - } -} -``` - + +# List MRR Response + +## Structure + +`ListMRRResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Mrr` | [`models.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" + } +} +``` + diff --git a/doc/models/list-offers-response.md b/doc/models/list-offers-response.md index 095224cb..7bbee87a 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -1,43 +1,43 @@ - -# List Offers Response - -## Structure - -`ListOffersResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Offers` | [`[]models.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 - } - ] -} -``` - + +# List Offers Response + +## Structure + +`ListOffersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Offers` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index b9963586..27a81ba8 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -1,29 +1,29 @@ - -# List Product Price Points Response - -## Structure - -`ListProductPricePointsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoints` | [`[]models.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 - } - ] -} -``` - + +# List Product Price Points Response + +## Structure + +`ListProductPricePointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoints` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index 71d90e1b..dbf4c8b1 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -1,19 +1,19 @@ - -# List Products Include - -## Enumeration - -`ListProductsInclude` - -## Fields - -| Name | -| --- | -| `PREPAIDPRODUCTPRICEPOINT` | - -## Example - -``` -prepaid_product_price_point -``` - + +# List Products Include + +## Enumeration + +`ListProductsInclude` + +## Fields + +| Name | +| --- | +| `PREPAIDPRODUCTPRICEPOINT` | + +## Example + +``` +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 3e58e30d..ba6c56fc 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -1,19 +1,19 @@ - -# List Products Price Points Include - -## Enumeration - -`ListProductsPricePointsInclude` - -## Fields - -| Name | -| --- | -| `CURRENCYPRICES` | - -## Example - -``` -currency_prices -``` - + +# List Products Price Points Include + +## Enumeration + +`ListProductsPricePointsInclude` + +## Fields + +| Name | +| --- | +| `CURRENCYPRICES` | + +## Example + +``` +currency_prices +``` + diff --git a/doc/models/list-public-keys-meta.md b/doc/models/list-public-keys-meta.md index 3d570cca..fae8cacf 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -1,27 +1,27 @@ - -# List Public Keys Meta - -## Structure - -`ListPublicKeysMeta` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TotalCount` | `*int` | Optional | - | -| `CurrentPage` | `*int` | Optional | - | -| `TotalPages` | `*int` | Optional | - | -| `PerPage` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} -``` - + +# List Public Keys Meta + +## Structure + +`ListPublicKeysMeta` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TotalCount` | `*int` | Optional | - | +| `CurrentPage` | `*int` | Optional | - | +| `TotalPages` | `*int` | Optional | - | +| `PerPage` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "total_count": 22, + "current_page": 254, + "total_pages": 10, + "per_page": 24 +} +``` + diff --git a/doc/models/list-public-keys-response.md b/doc/models/list-public-keys-response.md index 2f566dbb..15654f31 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -1,39 +1,39 @@ - -# List Public Keys Response - -## Structure - -`ListPublicKeysResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyJsKeys` | [`[]models.PublicKey`](../../doc/models/public-key.md) | Optional | - | -| `Meta` | [`*models.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": "created_at6" - }, - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "created_at6" - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} -``` - + +# List Public Keys Response + +## Structure + +`ListPublicKeysResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyJsKeys` | [`[]models.PublicKey`](../../doc/models/public-key.md) | Optional | - | +| `Meta` | [`*models.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": "created_at6" + }, + { + "public_key": "public_key8", + "requires_security_token": false, + "created_at": "created_at6" + } + ], + "meta": { + "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 7f73ccc1..108b08ac 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -1,45 +1,45 @@ - -# List Sale Rep Item - -## Structure - -`ListSaleRepItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `FullName` | `*string` | Optional | - | -| `SubscriptionsCount` | `*int` | Optional | - | -| `MrrData` | [`map[string]models.SaleRepItemMrr`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | -| `TestMode` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - } - }, - "id": 26, - "full_name": "full_name8", - "subscriptions_count": 154, - "test_mode": false -} -``` - + +# List Sale Rep Item + +## Structure + +`ListSaleRepItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `FullName` | `*string` | Optional | - | +| `SubscriptionsCount` | `*int` | Optional | - | +| `MrrData` | [`map[string]models.SaleRepItemMrr`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | +| `TestMode` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "mrr_data": { + "november_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "december_2019": { + "mrr": "$0.00", + "usage": "$0.00", + "recurring": "$0.00" + }, + "january_2020": { + "mrr": "$400.00", + "usage": "$0.00", + "recurring": "$400.00" + } + }, + "id": 26, + "full_name": "full_name8", + "subscriptions_count": 154, + "test_mode": false +} +``` + diff --git a/doc/models/list-segments-response.md b/doc/models/list-segments-response.md index 8a853448..2ae9bbc0 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -1,29 +1,29 @@ - -# List Segments Response - -## Structure - -`ListSegmentsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segments` | [`[]models.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" - } - ] -} -``` - + +# List Segments Response + +## Structure + +`ListSegmentsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segments` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subcription-group-prepayment-item.md index 0965b43c..8c0add74 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subcription-group-prepayment-item.md @@ -1,33 +1,33 @@ - -# List Subcription Group Prepayment Item - -## Structure - -`ListSubcriptionGroupPrepaymentItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SubscriptionGroupUid` | `*string` | Optional | - | -| `AmountInCents` | `*int64` | Optional | - | -| `RemainingAmountInCents` | `*int64` | Optional | - | -| `Details` | `*string` | Optional | - | -| `External` | `*bool` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `PaymentType` | [`*models.PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | :- 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. | -| `CreatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 254, - "subscription_group_uid": "subscription_group_uid6", - "amount_in_cents": 172, - "remaining_amount_in_cents": 142, - "details": "details2" -} -``` - + +# List Subcription Group Prepayment Item + +## Structure + +`ListSubcriptionGroupPrepaymentItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SubscriptionGroupUid` | `*string` | Optional | - | +| `AmountInCents` | `*int64` | Optional | - | +| `RemainingAmountInCents` | `*int64` | Optional | - | +| `Details` | `*string` | Optional | - | +| `External` | `*bool` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `PaymentType` | [`*models.PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | :- 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. | +| `CreatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 254, + "subscription_group_uid": "subscription_group_uid6", + "amount_in_cents": 172, + "remaining_amount_in_cents": 142, + "details": "details2" +} +``` + diff --git a/doc/models/list-subscription-components-include.md b/doc/models/list-subscription-components-include.md index afc3a353..8ddf0f45 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -1,19 +1,19 @@ - -# List Subscription Components Include - -## Enumeration - -`ListSubscriptionComponentsInclude` - -## Fields - -| Name | -| --- | -| `SUBSCRIPTION` | - -## Example - -``` -subscription -``` - + +# List Subscription Components Include + +## Enumeration + +`ListSubscriptionComponentsInclude` + +## Fields + +| Name | +| --- | +| `SUBSCRIPTION` | + +## Example + +``` +subscription +``` + diff --git a/doc/models/list-subscription-components-response.md b/doc/models/list-subscription-components-response.md index 981ec1bd..92d93138 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -1,29 +1,29 @@ - -# List Subscription Components Response - -## Structure - -`ListSubscriptionComponentsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionsComponents` | [`[]models.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 - } - ] -} -``` - + +# List Subscription Components Response + +## Structure + +`ListSubscriptionComponentsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionsComponents` | [`[]models.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 + } + ] +} +``` + diff --git a/doc/models/list-subscription-components-sort.md b/doc/models/list-subscription-components-sort.md index 848f90d3..f23c5bc8 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -1,20 +1,20 @@ - -# List Subscription Components Sort - -## Enumeration - -`ListSubscriptionComponentsSort` - -## Fields - -| Name | -| --- | -| `ID` | -| `UPDATEDAT` | - -## Example - -``` -updated_at -``` - + +# List Subscription Components Sort + +## Enumeration + +`ListSubscriptionComponentsSort` + +## Fields + +| Name | +| --- | +| `ID` | +| `UPDATEDAT` | + +## Example + +``` +updated_at +``` + diff --git a/doc/models/list-subscription-group-prepayment-date-field.md b/doc/models/list-subscription-group-prepayment-date-field.md index f4c960c2..3a568d1d 100644 --- a/doc/models/list-subscription-group-prepayment-date-field.md +++ b/doc/models/list-subscription-group-prepayment-date-field.md @@ -1,20 +1,20 @@ - -# List Subscription Group Prepayment Date Field - -## Enumeration - -`ListSubscriptionGroupPrepaymentDateField` - -## Fields - -| Name | -| --- | -| `CREATEDAT` | -| `APPLICATIONAT` | - -## Example - -``` -created_at -``` - + +# List Subscription Group Prepayment Date Field + +## Enumeration + +`ListSubscriptionGroupPrepaymentDateField` + +## Fields + +| Name | +| --- | +| `CREATEDAT` | +| `APPLICATIONAT` | + +## Example + +``` +created_at +``` + diff --git a/doc/models/list-subscription-group-prepayment-response.md b/doc/models/list-subscription-group-prepayment-response.md index 2ba8f4e5..15d75fd8 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -1,31 +1,31 @@ - -# List Subscription Group Prepayment Response - -## Structure - -`ListSubscriptionGroupPrepaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayments` | [`[]models.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" - } - } - ] -} -``` - + +# List Subscription Group Prepayment Response + +## Structure + +`ListSubscriptionGroupPrepaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayments` | [`[]models.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" + } + } + ] +} +``` + diff --git a/doc/models/list-subscription-group-prepayment.md b/doc/models/list-subscription-group-prepayment.md index 907568a3..1e679f14 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -1,27 +1,27 @@ - -# List Subscription Group Prepayment - -## Structure - -`ListSubscriptionGroupPrepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayment` | [`models.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" - } -} -``` - + +# List Subscription Group Prepayment + +## Structure + +`ListSubscriptionGroupPrepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayment` | [`models.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" + } +} +``` + diff --git a/doc/models/list-subscription-groups-item.md b/doc/models/list-subscription-groups-item.md index 48d5ac34..5edd655a 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -1,36 +1,36 @@ - -# List Subscription Groups Item - -## Structure - -`ListSubscriptionGroupsItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Scheme` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `PaymentProfileId` | `*int` | Optional | - | -| `SubscriptionIds` | `[]int` | Optional | - | -| `PrimarySubscriptionId` | `*int` | Optional | - | -| `NextAssessmentAt` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `CancelAtEndOfPeriod` | `*bool` | Optional | - | -| `AccountBalances` | [`*models.SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "scheme": 124, - "customer_id": 144, - "payment_profile_id": 52, - "subscription_ids": [ - 254 - ] -} -``` - + +# List Subscription Groups Item + +## Structure + +`ListSubscriptionGroupsItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Scheme` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `PaymentProfileId` | `*int` | Optional | - | +| `SubscriptionIds` | `[]int` | Optional | - | +| `PrimarySubscriptionId` | `*int` | Optional | - | +| `NextAssessmentAt` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `CancelAtEndOfPeriod` | `*bool` | Optional | - | +| `AccountBalances` | [`*models.SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "scheme": 124, + "customer_id": 144, + "payment_profile_id": 52, + "subscription_ids": [ + 254 + ] +} +``` + diff --git a/doc/models/list-subscription-groups-meta.md b/doc/models/list-subscription-groups-meta.md index 316d617d..ed614246 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -1,23 +1,23 @@ - -# List Subscription Groups Meta - -## Structure - -`ListSubscriptionGroupsMeta` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrentPage` | `*int` | Optional | - | -| `TotalCount` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "current_page": 14, - "total_count": 38 -} -``` - + +# List Subscription Groups Meta + +## Structure + +`ListSubscriptionGroupsMeta` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrentPage` | `*int` | Optional | - | +| `TotalCount` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "current_page": 14, + "total_count": 38 +} +``` + diff --git a/doc/models/list-subscription-groups-response.md b/doc/models/list-subscription-groups-response.md index 579cd448..b3e64cbb 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -1,54 +1,54 @@ - -# List Subscription Groups Response - -## Structure - -`ListSubscriptionGroupsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionGroups` | [`[]models.ListSubscriptionGroupsItem`](../../doc/models/list-subscription-groups-item.md) | Optional | - | -| `Meta` | [`*models.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 - } -} -``` - + +# List Subscription Groups Response + +## Structure + +`ListSubscriptionGroupsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionGroups` | [`[]models.ListSubscriptionGroupsItem`](../../doc/models/list-subscription-groups-item.md) | Optional | - | +| `Meta` | [`*models.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 + } +} +``` + diff --git a/doc/models/metadata.md b/doc/models/metadata.md index 52e3eeec..e02db8de 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -1,30 +1,30 @@ - -# Metadata - -## Structure - -`Metadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Value` | `*string` | Optional | - | -| `ResourceId` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `DeletedAt` | `Optional[string]` | Optional | - | -| `MetafieldId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "deleted_at6" -} -``` - + +# Metadata + +## Structure + +`Metadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `Optional[int]` | Optional | - | +| `Value` | `Optional[string]` | Optional | - | +| `ResourceId` | `Optional[int]` | Optional | - | +| `Name` | `*string` | Optional | - | +| `DeletedAt` | `Optional[string]` | Optional | - | +| `MetafieldId` | `Optional[int]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 12, + "value": "value0", + "resource_id": 96, + "name": "name8", + "deleted_at": "deleted_at6" +} +``` + diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md new file mode 100644 index 00000000..ee83a437 --- /dev/null +++ b/doc/models/metafield-input.md @@ -0,0 +1,18 @@ + +# Metafield Input + +Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' + +## Enumeration + +`MetafieldInput` + +## Fields + +| Name | +| --- | +| `BALANCETRACKER` | +| `TEXT` | +| `RADIO` | +| `DROPDOWN` | + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index ce8cc9c4..2bfcfc41 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -1,33 +1,33 @@ - -# Metafield Scope - -Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. - -## Structure - -`MetafieldScope` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Csv` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from the csv export. | -| `Invoices` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from invoices. | -| `Statements` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from statements. | -| `Portal` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from the portal. | -| `PublicShow` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being viewable by your ecosystem. | -| `PublicEdit` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being edited by your ecosystem. | -| `Hosted` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} -``` - + +# Metafield Scope + +Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. + +## Structure + +`MetafieldScope` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Csv` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from the csv export. | +| `Invoices` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from invoices. | +| `Statements` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from statements. | +| `Portal` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from the portal. | +| `PublicShow` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being viewable by your ecosystem. | +| `PublicEdit` | [`*models.IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields from being edited by your ecosystem. | +| `Hosted` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "csv": "0", + "invoices": "0", + "statements": "0", + "portal": "0", + "public_show": "0" +} +``` + diff --git a/doc/models/metafield.md b/doc/models/metafield.md index c19069f6..dec9a3eb 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -1,36 +1,36 @@ - -# Metafield - -## Structure - -`Metafield` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Scope` | [`*models.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. | -| `DataCount` | `*int` | Optional | the amount of subscriptions this metafield has been applied to in Chargify | -| `InputType` | `*string` | Optional | - | -| `Enum` | `Optional[interface{}]` | Optional | - | - -## 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": "input_type0" -} -``` - + +# Metafield + +## Structure + +`Metafield` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Scope` | [`*models.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. | +| `DataCount` | `*int` | Optional | the amount of subscriptions this metafield has been applied to in Chargify | +| `InputType` | [`*models.MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' | +| `Enum` | `Optional[interface{}]` | Optional | - | + +## 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" +} +``` + diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 45879a4a..1ec91a61 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -1,61 +1,61 @@ - -# Metered Component - -## Structure - -`MeteredComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | -| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | -| `DisplayOnHostedPage` | `*bool` | Optional | - | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `PublicSignupPageIds` | `[]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. | -| `IntervalUnit` | [`*models.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": "name4", - "unit_name": "unit_name6", - "description": "description6", - "handle": "handle0", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "full" -} -``` - + +# Metered Component + +## Structure + +`MeteredComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | +| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | +| `DisplayOnHostedPage` | `*bool` | Optional | - | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `PublicSignupPageIds` | `[]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. | +| `IntervalUnit` | [`*models.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": "name4", + "unit_name": "unit_name6", + "description": "description6", + "handle": "handle0", + "taxable": false, + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "full" +} +``` + diff --git a/doc/models/movement-line-item.md b/doc/models/movement-line-item.md index 0e6f6ceb..92600324 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -1,33 +1,33 @@ - -# Movement Line Item - -## Structure - -`MovementLineItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductId` | `*int` | Optional | - | -| `ComponentId` | `*int` | Optional | For Product (or "baseline") line items, this field will have a value of `0`. | -| `PricePointId` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Mrr` | `*int` | Optional | - | -| `MrrMovements` | [`[]models.MRRMovement`](../../doc/models/mrr-movement.md) | Optional | - | -| `Quantity` | `*int` | Optional | - | -| `PrevQuantity` | `*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 -} -``` - + +# Movement Line Item + +## Structure + +`MovementLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductId` | `*int` | Optional | - | +| `ComponentId` | `*int` | Optional | For Product (or "baseline") line items, this field will have a value of `0`. | +| `PricePointId` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Mrr` | `*int` | Optional | - | +| `MrrMovements` | [`[]models.MRRMovement`](../../doc/models/mrr-movement.md) | Optional | - | +| `Quantity` | `*int` | Optional | - | +| `PrevQuantity` | `*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 +} +``` + diff --git a/doc/models/movement.md b/doc/models/movement.md index 55372527..4217a310 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -1,33 +1,33 @@ - -# Movement - -## Structure - -`Movement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Timestamp` | `*string` | Optional | - | -| `AmountInCents` | `*int64` | Optional | - | -| `AmountFormatted` | `*string` | Optional | - | -| `Description` | `*string` | Optional | - | -| `Category` | `*string` | Optional | - | -| `Breakouts` | [`*models.Breakouts`](../../doc/models/breakouts.md) | Optional | - | -| `LineItems` | [`[]models.MovementLineItem`](../../doc/models/movement-line-item.md) | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `SubscriberName` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "timestamp": "timestamp0", - "amount_in_cents": 174, - "amount_formatted": "amount_formatted4", - "description": "description2", - "category": "category0" -} -``` - + +# Movement + +## Structure + +`Movement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Timestamp` | `*string` | Optional | - | +| `AmountInCents` | `*int64` | Optional | - | +| `AmountFormatted` | `*string` | Optional | - | +| `Description` | `*string` | Optional | - | +| `Category` | `*string` | Optional | - | +| `Breakouts` | [`*models.Breakouts`](../../doc/models/breakouts.md) | Optional | - | +| `LineItems` | [`[]models.MovementLineItem`](../../doc/models/movement-line-item.md) | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `SubscriberName` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "timestamp": "timestamp0", + "amount_in_cents": 174, + "amount_formatted": "amount_formatted4", + "description": "description2", + "category": "category0" +} +``` + diff --git a/doc/models/mrr-movement.md b/doc/models/mrr-movement.md index ad2e4ff7..eb21eb18 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -1,27 +1,27 @@ - -# MRR Movement - -## Structure - -`MRRMovement` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `*int` | Optional | - | -| `Category` | `*string` | Optional | - | -| `SubscriberDelta` | `*int` | Optional | - | -| `LeadDelta` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} -``` - + +# MRR Movement + +## Structure + +`MRRMovement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `*int` | Optional | - | +| `Category` | `*string` | Optional | - | +| `SubscriberDelta` | `*int` | Optional | - | +| `LeadDelta` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "amount": 210, + "category": "category0", + "subscriber_delta": 170, + "lead_delta": 198 +} +``` + diff --git a/doc/models/mrr-response.md b/doc/models/mrr-response.md index 27883856..14ead27c 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -1,32 +1,32 @@ - -# MRR Response - -## Structure - -`MRRResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Mrr` | [`models.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" - } - } -} -``` - + +# MRR Response + +## Structure + +`MRRResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Mrr` | [`models.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" + } + } +} +``` + diff --git a/doc/models/mrr.md b/doc/models/mrr.md index f70e7184..d6b7385d 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -1,35 +1,35 @@ - -# MRR - -## Structure - -`MRR` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AmountInCents` | `*int64` | Optional | - | -| `AmountFormatted` | `*string` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `CurrencySymbol` | `*string` | Optional | - | -| `Breakouts` | [`*models.Breakouts`](../../doc/models/breakouts.md) | Optional | - | -| `AtTime` | `*string` | 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" - } -} -``` - + +# MRR + +## Structure + +`MRR` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AmountInCents` | `*int64` | Optional | - | +| `AmountFormatted` | `*string` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `CurrencySymbol` | `*string` | Optional | - | +| `Breakouts` | [`*models.Breakouts`](../../doc/models/breakouts.md) | Optional | - | +| `AtTime` | `*string` | 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" + } +} +``` + diff --git a/doc/models/multi-invoice-payment-response.md b/doc/models/multi-invoice-payment-response.md index dbc04ecf..8302cf03 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -1,42 +1,42 @@ - -# Multi Invoice Payment Response - -## Structure - -`MultiInvoicePaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Payment` | [`models.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" - } - ] - } -} -``` - + +# Multi Invoice Payment Response + +## Structure + +`MultiInvoicePaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Payment` | [`models.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" + } + ] + } +} +``` + diff --git a/doc/models/multi-invoice-payment.md b/doc/models/multi-invoice-payment.md index cff26b17..19015da6 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -1,33 +1,33 @@ - -# Multi Invoice Payment - -## Structure - -`MultiInvoicePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionId` | `*int` | Optional | The numeric ID of the transaction. | -| `TotalAmount` | `*string` | Optional | Dollar amount of the sum of the paid invoices. | -| `CurrencyCode` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | -| `Applications` | [`[]models.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" - } - ] -} -``` - + +# Multi Invoice Payment + +## Structure + +`MultiInvoicePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionId` | `*int` | Optional | The numeric ID of the transaction. | +| `TotalAmount` | `*string` | Optional | Dollar amount of the sum of the paid invoices. | +| `CurrencyCode` | `*string` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `Applications` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/nested-subscription-group.md b/doc/models/nested-subscription-group.md index 91481466..e17d50c3 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -1,27 +1,27 @@ - -# Nested Subscription Group - -## Structure - -`NestedSubscriptionGroup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | The UID for the group | -| `Scheme` | `*int` | Optional | Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1. | -| `PrimarySubscriptionId` | `*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 -} -``` - + +# Nested Subscription Group + +## Structure + +`NestedSubscriptionGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | The UID for the group | +| `Scheme` | `*int` | Optional | Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1. | +| `PrimarySubscriptionId` | `*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 +} +``` + diff --git a/doc/models/net-terms.md b/doc/models/net-terms.md index a5e286c4..1ea81d91 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -1,29 +1,29 @@ - -# Net Terms - -## Structure - -`NetTerms` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `DefaultNetTerms` | `*int` | Optional | **Default**: `0` | -| `AutomaticNetTerms` | `*int` | Optional | **Default**: `0` | -| `RemittanceNetTerms` | `*int` | Optional | **Default**: `0` | -| `NetTermsOnRemittanceSignupsEnabled` | `*bool` | Optional | **Default**: `false` | -| `CustomNetTermsEnabled` | `*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 -} -``` - + +# Net Terms + +## Structure + +`NetTerms` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `DefaultNetTerms` | `*int` | Optional | **Default**: `0` | +| `AutomaticNetTerms` | `*int` | Optional | **Default**: `0` | +| `RemittanceNetTerms` | `*int` | Optional | **Default**: `0` | +| `NetTermsOnRemittanceSignupsEnabled` | `*bool` | Optional | **Default**: `false` | +| `CustomNetTermsEnabled` | `*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 +} +``` + diff --git a/doc/models/offer-discount.md b/doc/models/offer-discount.md index 5516795c..84d5baf5 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -1,25 +1,25 @@ - -# Offer Discount - -## Structure - -`OfferDiscount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CouponCode` | `*string` | Optional | - | -| `CouponId` | `*int` | Optional | - | -| `CouponName` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} -``` - + +# Offer Discount + +## Structure + +`OfferDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CouponCode` | `*string` | Optional | - | +| `CouponId` | `*int` | Optional | - | +| `CouponName` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "coupon_code": "coupon_code8", + "coupon_id": 86, + "coupon_name": "coupon_name4" +} +``` + diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index af75c492..4894ccc2 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -1,34 +1,34 @@ - -# Offer Item - -## Structure - -`OfferItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `StartingQuantity` | `*string` | Optional | - | -| `Editable` | `*bool` | Optional | - | -| `ComponentUnitPrice` | `*string` | Optional | - | -| `ComponentName` | `*string` | Optional | - | -| `PricePointName` | `*string` | Optional | - | -| `CurrencyPrices` | [`[]models.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. | -| `IntervalUnit` | [`*models.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) - -```json -{ - "component_id": 216, - "price_point_id": 16, - "starting_quantity": "starting_quantity0", - "editable": false, - "component_unit_price": "component_unit_price8" -} -``` - + +# Offer Item + +## Structure + +`OfferItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `StartingQuantity` | `*string` | Optional | - | +| `Editable` | `*bool` | Optional | - | +| `ComponentUnitPrice` | `*string` | Optional | - | +| `ComponentName` | `*string` | Optional | - | +| `PricePointName` | `*string` | Optional | - | +| `CurrencyPrices` | [`[]models.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. | +| `IntervalUnit` | [`*models.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) + +```json +{ + "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 4c5480eb..21b52066 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -1,27 +1,27 @@ - -# Offer Response - -## Structure - -`OfferResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Offer` | [`*models.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 - } -} -``` - + +# Offer Response + +## Structure + +`OfferResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Offer` | [`*models.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 + } +} +``` + diff --git a/doc/models/offer-signup-page.md b/doc/models/offer-signup-page.md index 49ce4440..b97b7b6b 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -1,30 +1,30 @@ - -# Offer Signup Page - -## Structure - -`OfferSignupPage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Nickname` | `*string` | Optional | - | -| `Enabled` | `*bool` | Optional | - | -| `ReturnUrl` | `*string` | Optional | - | -| `ReturnParams` | `*string` | Optional | - | -| `Url` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} -``` - + +# Offer Signup Page + +## Structure + +`OfferSignupPage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Nickname` | `*string` | Optional | - | +| `Enabled` | `*bool` | Optional | - | +| `ReturnUrl` | `*string` | Optional | - | +| `ReturnParams` | `*string` | Optional | - | +| `Url` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 50, + "nickname": "nickname8", + "enabled": false, + "return_url": "return_url2", + "return_params": "return_params0" +} +``` + diff --git a/doc/models/offer.md b/doc/models/offer.md index f8e7008b..2681d4d4 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -1,43 +1,43 @@ - -# Offer - -## Structure - -`Offer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `ProductFamilyId` | `*int` | Optional | - | -| `ProductId` | `*int` | Optional | - | -| `ProductPricePointId` | `*int` | Optional | - | -| `ProductRevisableNumber` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | -| `ArchivedAt` | `Optional[string]` | Optional | - | -| `OfferItems` | [`[]models.OfferItem`](../../doc/models/offer-item.md) | Optional | - | -| `OfferDiscounts` | [`[]models.OfferDiscount`](../../doc/models/offer-discount.md) | Optional | - | -| `ProductFamilyName` | `*string` | Optional | - | -| `ProductName` | `*string` | Optional | - | -| `ProductPricePointName` | `*string` | Optional | - | -| `ProductPriceInCents` | `*int64` | Optional | - | -| `OfferSignupPages` | [`[]models.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 -} -``` - + +# Offer + +## Structure + +`Offer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `ProductFamilyId` | `*int` | Optional | - | +| `ProductId` | `*int` | Optional | - | +| `ProductPricePointId` | `*int` | Optional | - | +| `ProductRevisableNumber` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | +| `ArchivedAt` | `Optional[string]` | Optional | - | +| `OfferItems` | [`[]models.OfferItem`](../../doc/models/offer-item.md) | Optional | - | +| `OfferDiscounts` | [`[]models.OfferDiscount`](../../doc/models/offer-discount.md) | Optional | - | +| `ProductFamilyName` | `*string` | Optional | - | +| `ProductName` | `*string` | Optional | - | +| `ProductPricePointName` | `*string` | Optional | - | +| `ProductPriceInCents` | `*int64` | Optional | - | +| `OfferSignupPages` | [`[]models.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 +} +``` + diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index c7da78a3..8cab833d 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -1,85 +1,85 @@ - -# On Off Component - -## Structure - -`OnOffComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | -| `DisplayOnHostedPage` | `*bool` | Optional | - | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `PublicSignupPageIds` | `[]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. | -| `IntervalUnit` | [`*models.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, - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "prorated" -} -``` - + +# On Off Component + +## Structure + +`OnOffComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | +| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | +| `DisplayOnHostedPage` | `*bool` | Optional | - | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `PublicSignupPageIds` | `[]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. | +| `IntervalUnit` | [`*models.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, + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "prorated" +} +``` + diff --git a/doc/models/organization-address.md b/doc/models/organization-address.md index 021b33e1..e048b1f3 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -1,32 +1,32 @@ - -# Organization Address - -## Structure - -`OrganizationAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Street` | `Optional[string]` | Optional | - | -| `Line2` | `Optional[string]` | Optional | - | -| `City` | `Optional[string]` | Optional | - | -| `State` | `Optional[string]` | Optional | - | -| `Zip` | `Optional[string]` | Optional | - | -| `Country` | `Optional[string]` | Optional | - | -| `Name` | `Optional[string]` | Optional | - | -| `Phone` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} -``` - + +# Organization Address + +## Structure + +`OrganizationAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Street` | `Optional[string]` | Optional | - | +| `Line2` | `Optional[string]` | Optional | - | +| `City` | `Optional[string]` | Optional | - | +| `State` | `Optional[string]` | Optional | - | +| `Zip` | `Optional[string]` | Optional | - | +| `Country` | `Optional[string]` | Optional | - | +| `Name` | `Optional[string]` | Optional | - | +| `Phone` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "street": "street4", + "line2": "line28", + "city": "city4", + "state": "state0", + "zip": "zip2" +} +``` + diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index c36f090b..c99b6738 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -1,23 +1,23 @@ - -# Origin Invoice - -## Structure - -`OriginInvoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | The UID of the invoice serving as an origin invoice. | -| `Number` | `*string` | Optional | The number of the invoice serving as an origin invoice. | - -## Example (as JSON) - -```json -{ - "uid": "uid0", - "number": "number8" -} -``` - + +# Origin Invoice + +## Structure + +`OriginInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | The UID of the invoice serving as an origin invoice. | +| `Number` | `*string` | Optional | The number of the invoice serving as an origin invoice. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "number": "number8" +} +``` + diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index 4b67c545..0f9fccb9 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -1,66 +1,66 @@ - -# Overage Pricing - -## Structure - -`OveragePricing` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Overage Pricing + +## Structure + +`OveragePricing` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/override-subscription-request.md b/doc/models/override-subscription-request.md index 3ac3df60..0a809fe0 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -1,27 +1,27 @@ - -# Override Subscription Request - -## Structure - -`OverrideSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`models.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" - } -} -``` - + +# Override Subscription Request + +## Structure + +`OverrideSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`models.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" + } +} +``` + diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index 9c2eb3bf..273fc1f2 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -1,29 +1,29 @@ - -# Override Subscription - -## Structure - -`OverrideSubscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ActivatedAt` | `*time.Time` | Optional | Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. | -| `CanceledAt` | `*time.Time` | Optional | Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. | -| `CancellationMessage` | `*string` | Optional | Can be used to record a reason for the original cancellation. | -| `ExpiresAt` | `*time.Time` | 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. | -| `CurrentPeriodStartsAt` | `*time.Time` | 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" -} -``` - + +# Override Subscription + +## Structure + +`OverrideSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ActivatedAt` | `*time.Time` | Optional | Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. | +| `CanceledAt` | `*time.Time` | Optional | Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. | +| `CancellationMessage` | `*string` | Optional | Can be used to record a reason for the original cancellation. | +| `ExpiresAt` | `*time.Time` | 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. | +| `CurrentPeriodStartsAt` | `*time.Time` | 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" +} +``` + diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index cdf830d1..958d43d8 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -1,44 +1,44 @@ - -# Paginated Metadata - -## Structure - -`PaginatedMetadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TotalCount` | `*int` | Optional | - | -| `CurrentPage` | `*int` | Optional | - | -| `TotalPages` | `*int` | Optional | - | -| `PerPage` | `*int` | Optional | - | -| `Metadata` | [`[]models.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": "deleted_at4" - }, - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "deleted_at4" - } - ] -} -``` - + +# Paginated Metadata + +## Structure + +`PaginatedMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TotalCount` | `*int` | Optional | - | +| `CurrentPage` | `*int` | Optional | - | +| `TotalPages` | `*int` | Optional | - | +| `PerPage` | `*int` | Optional | - | +| `Metadata` | [`[]models.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": "deleted_at4" + }, + { + "id": 50, + "value": "value8", + "resource_id": 134, + "name": "name6", + "deleted_at": "deleted_at4" + } + ] +} +``` + diff --git a/doc/models/pause-request.md b/doc/models/pause-request.md index 64018ab5..728f1d7b 100644 --- a/doc/models/pause-request.md +++ b/doc/models/pause-request.md @@ -1,25 +1,25 @@ - -# Pause Request - -Allows to pause a Subscription - -## Structure - -`PauseRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Hold` | [`*models.AutoResume`](../../doc/models/auto-resume.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "hold": { - "automatically_resume_at": "2016-03-13T12:52:32.123Z" - } -} -``` - + +# Pause Request + +Allows to pause a Subscription + +## Structure + +`PauseRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Hold` | [`*models.AutoResume`](../../doc/models/auto-resume.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "hold": { + "automatically_resume_at": "2016-03-13T12:52:32.123Z" + } +} +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 6cda502d..36cf0f62 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -1,46 +1,46 @@ - -# Payer Attributes - -## Structure - -`PayerAttributes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Email` | `*string` | Optional | - | -| `CcEmails` | `*string` | Optional | - | -| `Organization` | `*string` | Optional | - | -| `Reference` | `*string` | Optional | - | -| `Address` | `*string` | Optional | - | -| `Address2` | `*string` | Optional | - | -| `City` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `Zip` | `*string` | Optional | - | -| `Country` | `*string` | Optional | - | -| `Phone` | `*string` | Optional | - | -| `Locale` | `*string` | Optional | - | -| `VatNumber` | `*string` | Optional | - | -| `TaxExempt` | `*string` | Optional | - | -| `TaxExemptReason` | `*string` | Optional | - | -| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | - -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails4", - "organization": "organization8" -} -``` - + +# Payer Attributes + +## Structure + +`PayerAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Email` | `*string` | Optional | - | +| `CcEmails` | `*string` | Optional | - | +| `Organization` | `*string` | Optional | - | +| `Reference` | `*string` | Optional | - | +| `Address` | `*string` | Optional | - | +| `Address2` | `*string` | Optional | - | +| `City` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `Zip` | `*string` | Optional | - | +| `Country` | `*string` | Optional | - | +| `Phone` | `*string` | Optional | - | +| `Locale` | `*string` | Optional | - | +| `VatNumber` | `*string` | Optional | - | +| `TaxExempt` | `*string` | Optional | - | +| `TaxExemptReason` | `*string` | Optional | - | +| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | + +## Example (as JSON) + +```json +{ + "metafields": { + "custom_field_name_1": "custom_field_value_1", + "custom_field_name_2": "custom_field_value_2" + }, + "first_name": "first_name4", + "last_name": "last_name2", + "email": "email2", + "cc_emails": "cc_emails4", + "organization": "organization8" +} +``` + diff --git a/doc/models/payer-error.md b/doc/models/payer-error.md index 35f6854d..f9a1a1ce 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -1,34 +1,34 @@ - -# Payer Error - -## Structure - -`PayerError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `LastName` | `[]string` | Optional | - | -| `FirstName` | `[]string` | Optional | - | -| `Email` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" - ], - "first_name": [ - "first_name4", - "first_name5" - ], - "email": [ - "email4" - ] -} -``` - + +# Payer Error + +## Structure + +`PayerError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `LastName` | `[]string` | Optional | - | +| `FirstName` | `[]string` | Optional | - | +| `Email` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "last_name": [ + "last_name1", + "last_name2", + "last_name3" + ], + "first_name": [ + "first_name4", + "first_name5" + ], + "email": [ + "email4" + ] +} +``` + diff --git a/doc/models/payment-collection-method-1.md b/doc/models/payment-collection-method-1.md deleted file mode 100644 index d689308d..00000000 --- a/doc/models/payment-collection-method-1.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Payment Collection Method 1 - -(Optional) If not passed, the allocation(s) will use the payment collection method on the subscription - -## Enumeration - -`PaymentCollectionMethod1` - -## Fields - -| Name | -| --- | -| `AUTOMATIC` | -| `REMITTANCE` | -| `PREPAID` | -| `INVOICE` | - diff --git a/doc/models/payment-for-allocation.md b/doc/models/payment-for-allocation.md index 343ba68b..4ffac3e9 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -1,29 +1,29 @@ - -# Payment for Allocation - -Information for captured payment, if applicable - -## Structure - -`PaymentForAllocation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `AmountInCents` | `*int64` | Optional | - | -| `Success` | `*bool` | Optional | - | -| `Memo` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} -``` - + +# Payment for Allocation + +Information for captured payment, if applicable + +## Structure + +`PaymentForAllocation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `AmountInCents` | `*int64` | Optional | - | +| `Success` | `*bool` | Optional | - | +| `Memo` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 72, + "amount_in_cents": 158, + "success": false, + "memo": "memo6" +} +``` + diff --git a/doc/models/payment-method-apple-pay.md b/doc/models/payment-method-apple-pay.md new file mode 100644 index 00000000..5c153d78 --- /dev/null +++ b/doc/models/payment-method-apple-pay.md @@ -0,0 +1,21 @@ + +# Payment Method Apple Pay + +## Structure + +`PaymentMethodApplePay` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Type` | [`models.InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | + +## Example (as JSON) + +```json +{ + "type": "credit_card" +} +``` + diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md new file mode 100644 index 00000000..44e2ff11 --- /dev/null +++ b/doc/models/payment-method-bank-account.md @@ -0,0 +1,25 @@ + +# Payment Method Bank Account + +## Structure + +`PaymentMethodBankAccount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `MaskedAccountNumber` | `string` | Required | - | +| `MaskedRoutingNumber` | `string` | Required | - | +| `Type` | [`models.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": "paypal_account" +} +``` + diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md new file mode 100644 index 00000000..0c467719 --- /dev/null +++ b/doc/models/payment-method-credit-card.md @@ -0,0 +1,29 @@ + +# Payment Method Credit Card + +## Structure + +`PaymentMethodCreditCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CardBrand` | `string` | Required | - | +| `CardExpiration` | `*string` | Optional | - | +| `LastFour` | `Optional[string]` | Optional | - | +| `MaskedCardNumber` | `string` | Required | - | +| `Type` | [`models.InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | + +## Example (as JSON) + +```json +{ + "card_brand": "card_brand4", + "card_expiration": "card_expiration2", + "last_four": "last_four4", + "masked_card_number": "masked_card_number0", + "type": "external" +} +``` + diff --git a/doc/models/payment-method-external.md b/doc/models/payment-method-external.md new file mode 100644 index 00000000..d13b6ee2 --- /dev/null +++ b/doc/models/payment-method-external.md @@ -0,0 +1,27 @@ + +# Payment Method External + +## Structure + +`PaymentMethodExternal` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Details` | `*string` | Required | - | +| `Kind` | `string` | Required | - | +| `Memo` | `*string` | Required | - | +| `Type` | [`models.InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | + +## Example (as JSON) + +```json +{ + "details": "details4", + "kind": "kind2", + "memo": "memo8", + "type": "bank_account" +} +``` + diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md new file mode 100644 index 00000000..c4e1f798 --- /dev/null +++ b/doc/models/payment-method-paypal.md @@ -0,0 +1,23 @@ + +# Payment Method Paypal + +## Structure + +`PaymentMethodPaypal` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Email` | `string` | Required | - | +| `Type` | [`models.InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | + +## Example (as JSON) + +```json +{ + "email": "email2", + "type": "bank_account" +} +``` + diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index b7c651b7..5e3a57f9 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -1,51 +1,51 @@ - -# Payment Profile Attributes - -alias to credit_card_attributes - -## Structure - -`PaymentProfileAttributes` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ChargifyToken` | `*string` | Optional | (Optional) Token received after sending billing informations using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | -| `Id` | `*int` | Optional | - | -| `PaymentType` | `*string` | Optional | - | -| `FirstName` | `*string` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | -| `LastName` | `*string` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | -| `MaskedCardNumber` | `*string` | Optional | - | -| `FullNumber` | `*string` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | -| `CardType` | [`*models.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. | -| `ExpirationMonth` | `*interface{}` | Optional | (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 | -| `ExpirationYear` | `*interface{}` | Optional | (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 | -| `BillingAddress` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `BillingAddress2` | `Optional[string]` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | -| `BillingCity` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `BillingState` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `BillingCountry` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `BillingZip` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | -| `VaultToken` | `*string` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | -| `CustomerVaultToken` | `*string` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | -| `CustomerId` | `*int` | Optional | - | -| `PaypalEmail` | `*string` | Optional | - | -| `PaymentMethodNonce` | `*string` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | -| `GatewayHandle` | `*string` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | -| `Cvv` | `*string` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | -| `LastFour` | `*string` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | - -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token8", - "id": 80, - "payment_type": "payment_type0", - "first_name": "first_name0", - "last_name": "last_name8" -} -``` - + +# Payment Profile Attributes + +alias to credit_card_attributes + +## Structure + +`PaymentProfileAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ChargifyToken` | `*string` | Optional | (Optional) Token received after sending billing informations using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `Id` | `*int` | Optional | - | +| `PaymentType` | `*string` | Optional | - | +| `FirstName` | `*string` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | +| `LastName` | `*string` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | +| `MaskedCardNumber` | `*string` | Optional | - | +| `FullNumber` | `*string` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | +| `CardType` | [`*models.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. | +| `ExpirationMonth` | `*interface{}` | Optional | (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 | +| `ExpirationYear` | `*interface{}` | Optional | (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 | +| `BillingAddress` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | +| `BillingAddress2` | `Optional[string]` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | +| `BillingCity` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | +| `BillingState` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `BillingCountry` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `BillingZip` | `*string` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | +| `VaultToken` | `*string` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | +| `CustomerVaultToken` | `*string` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | +| `CustomerId` | `*int` | Optional | - | +| `PaypalEmail` | `*string` | Optional | - | +| `PaymentMethodNonce` | `*string` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | +| `GatewayHandle` | `*string` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | +| `Cvv` | `*string` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | +| `LastFour` | `*string` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | + +## Example (as JSON) + +```json +{ + "chargify_token": "chargify_token8", + "id": 80, + "payment_type": "payment_type0", + "first_name": "first_name0", + "last_name": "last_name8" +} +``` + diff --git a/doc/models/payment-profile-response.md b/doc/models/payment-profile-response.md index a6215e36..240afb48 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -1,24 +1,24 @@ - -# Payment Profile Response - -## Structure - -`PaymentProfileResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfile` | `interface{}` | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Payment Profile Response + +## Structure + +`PaymentProfileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfile` | `interface{}` | Required | - | + +## Example (as JSON) + +```json +{ + "payment_profile": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/payment-response.md b/doc/models/payment-response.md index ad9352d7..136ccc0e 100644 --- a/doc/models/payment-response.md +++ b/doc/models/payment-response.md @@ -1,34 +1,34 @@ - -# Payment Response - -## Structure - -`PaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaidInvoices` | [`[]models.Payment`](../../doc/models/payment.md) | Optional | - | -| `Prepayment` | [`*models.InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "paid_invoices": [ - { - "invoice_uid": "invoice_uid8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - } - ], - "prepayment": { - "subscription_id": "subscription_id8", - "amount_in_cents": "amount_in_cents6", - "ending_balance_in_cents": "ending_balance_in_cents4" - } -} -``` - + +# Payment Response + +## Structure + +`PaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaidInvoices` | [`[]models.Payment`](../../doc/models/payment.md) | Optional | - | +| `Prepayment` | [`*models.InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "paid_invoices": [ + { + "invoice_uid": "invoice_uid8", + "status": "draft", + "due_amount": "due_amount0", + "paid_amount": "paid_amount0" + } + ], + "prepayment": { + "subscription_id": "subscription_id8", + "amount_in_cents": "amount_in_cents6", + "ending_balance_in_cents": "ending_balance_in_cents4" + } +} +``` + diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 7b0cd1d6..1ad97626 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -1,15 +1,15 @@ - -# Payment Type - -## Enumeration - -`PaymentType` - -## Fields - -| Name | -| --- | -| `CREDITCARD` | -| `BANKACCOUNT` | -| `PAYPALACCOUNT` | - + +# Payment Type + +## Enumeration + +`PaymentType` + +## Fields + +| Name | +| --- | +| `CREDITCARD` | +| `BANKACCOUNT` | +| `PAYPALACCOUNT` | + diff --git a/doc/models/payment.md b/doc/models/payment.md index 6fe02692..e24b6386 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -1,27 +1,27 @@ - -# Payment - -## Structure - -`Payment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `InvoiceUid` | `*string` | Optional | The uid of the paid invoice | -| `Status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | -| `DueAmount` | `*string` | Optional | The remaining due amount on the invoice | -| `PaidAmount` | `*string` | Optional | The total amount paid on this invoice (including any prior payments) | - -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid8", - "status": "voided", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" -} -``` - + +# Payment + +## Structure + +`Payment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `InvoiceUid` | `*string` | Optional | The uid of the paid invoice | +| `Status` | [`*models.InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | +| `DueAmount` | `*string` | Optional | The remaining due amount on the invoice | +| `PaidAmount` | `*string` | Optional | The total amount paid on this invoice (including any prior payments) | + +## Example (as JSON) + +```json +{ + "invoice_uid": "invoice_uid8", + "status": "voided", + "due_amount": "due_amount0", + "paid_amount": "paid_amount0" +} +``` + diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index b60402ab..7cde4c0c 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -1,30 +1,30 @@ - -# Portal Management Link - -## Structure - -`PortalManagementLink` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Url` | `*string` | Optional | - | -| `FetchCount` | `*int` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `NewLinkAvailableAt` | `*string` | Optional | - | -| `ExpiresAt` | `*string` | Optional | - | -| `LastInviteSentAt` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "url": "url0", - "fetch_count": 222, - "created_at": "created_at6", - "new_link_available_at": "new_link_available_at0", - "expires_at": "expires_at0" -} -``` - + +# Portal Management Link + +## Structure + +`PortalManagementLink` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Url` | `*string` | Optional | - | +| `FetchCount` | `*int` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `NewLinkAvailableAt` | `*string` | Optional | - | +| `ExpiresAt` | `*string` | Optional | - | +| `LastInviteSentAt` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "url": "url0", + "fetch_count": 222, + "created_at": "created_at6", + "new_link_available_at": "new_link_available_at0", + "expires_at": "expires_at0" +} +``` + diff --git a/doc/models/prepaid-component-price-point.md b/doc/models/prepaid-component-price-point.md index 842e3ceb..9f3e291b 100644 --- a/doc/models/prepaid-component-price-point.md +++ b/doc/models/prepaid-component-price-point.md @@ -1,76 +1,76 @@ - -# Prepaid Component Price Point - -## Structure - -`PrepaidComponentPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | -| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } -} -``` - + +# Prepaid Component Price Point + +## Structure + +`PrepaidComponentPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | +| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name8", + "handle": "handle4", + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "overage_pricing": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } +} +``` + diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index 05c59574..bc684839 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -1,27 +1,27 @@ - -# Prepaid Configuration Response - -## Structure - -`PrepaidConfigurationResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PrepaidConfiguration` | [`models.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 - } -} -``` - + +# Prepaid Configuration Response + +## Structure + +`PrepaidConfigurationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PrepaidConfiguration` | [`models.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 + } +} +``` + diff --git a/doc/models/prepaid-configuration.md b/doc/models/prepaid-configuration.md index dd2f4bd9..0c3b72a3 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -1,29 +1,29 @@ - -# Prepaid Configuration - -## Structure - -`PrepaidConfiguration` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `InitialFundingAmountInCents` | `*int64` | Optional | - | -| `ReplenishToAmountInCents` | `*int64` | Optional | - | -| `AutoReplenish` | `*bool` | Optional | - | -| `ReplenishThresholdAmountInCents` | `*int64` | 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 -} -``` - + +# Prepaid Configuration + +## Structure + +`PrepaidConfiguration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `InitialFundingAmountInCents` | `*int64` | Optional | - | +| `ReplenishToAmountInCents` | `*int64` | Optional | - | +| `AutoReplenish` | `*bool` | Optional | - | +| `ReplenishThresholdAmountInCents` | `*int64` | 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 +} +``` + diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 49ca4c2c..ccbd91b4 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -1,47 +1,47 @@ - -# Prepaid Usage Component - -## Structure - -`PrepaidUsageComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `UnitName` | `*string` | Optional | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | -| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `PricingScheme` | [`*models.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. | -| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePoints` | [`[]models.PrepaidComponentPricePoint`](../../doc/models/prepaid-component-price-point.md) | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | -| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | -| `RolloverPrepaidRemainder` | `*bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `RenewPrepaidAllocation` | `*bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | -| `ExpirationInterval` | `*float64` | 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 | -| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | - | -| `DisplayOnHostedPage` | `*bool` | Optional | - | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `PublicSignupPageIds` | `[]int` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name2", - "unit_name": "unit_name4", - "description": "description8", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "stairstep" -} -``` - + +# Prepaid Usage Component + +## Structure + +`PrepaidUsageComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `UnitName` | `*string` | Optional | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | +| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `PricingScheme` | [`*models.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. | +| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePoints` | [`[]models.PrepaidComponentPricePoint`](../../doc/models/prepaid-component-price-point.md) | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | +| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | +| `RolloverPrepaidRemainder` | `*bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | +| `RenewPrepaidAllocation` | `*bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `ExpirationInterval` | `*float64` | 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 | +| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | - | +| `DisplayOnHostedPage` | `*bool` | Optional | - | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `PublicSignupPageIds` | `[]int` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name2", + "unit_name": "unit_name4", + "description": "description8", + "handle": "handle8", + "taxable": false, + "pricing_scheme": "stairstep" +} +``` + diff --git a/doc/models/prepayment-aggregated-error.md b/doc/models/prepayment-aggregated-error.md index c8373346..c3e713ee 100644 --- a/doc/models/prepayment-aggregated-error.md +++ b/doc/models/prepayment-aggregated-error.md @@ -1,36 +1,36 @@ - -# Prepayment Aggregated Error - -## Structure - -`PrepaymentAggregatedError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AmountInCents` | `[]string` | Optional | - | -| `Base` | `[]string` | Optional | - | -| `External` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "amount_in_cents": [ - "amount_in_cents7", - "amount_in_cents6", - "amount_in_cents5" - ], - "base": [ - "base7", - "base8" - ], - "external": [ - "external0", - "external1", - "external2" - ] -} -``` - + +# Prepayment Aggregated Error + +## Structure + +`PrepaymentAggregatedError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AmountInCents` | `[]string` | Optional | - | +| `Base` | `[]string` | Optional | - | +| `External` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "amount_in_cents": [ + "amount_in_cents7", + "amount_in_cents6", + "amount_in_cents5" + ], + "base": [ + "base7", + "base8" + ], + "external": [ + "external0", + "external1", + "external2" + ] +} +``` + diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index 8e61fcc5..5f405ade 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -1,21 +1,21 @@ - -# 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. - -## Enumeration - -`PrepaymentMethod` - -## Fields - -| Name | -| --- | -| `CHECK` | -| `CASH` | -| `MONEYORDER` | -| `ACH` | -| `PAYPALACCOUNT` | -| `CREDITCARDONFILE` | -| `OTHER` | - + +# 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. + +## Enumeration + +`PrepaymentMethod` + +## Fields + +| Name | +| --- | +| `CHECK` | +| `CASH` | +| `MONEYORDER` | +| `ACH` | +| `PAYPALACCOUNT` | +| `CREDITCARDONFILE` | +| `OTHER` | + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index b12f4953..f66ac68f 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -1,32 +1,32 @@ - -# Prepayment Response - -## Structure - -`PrepaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayment` | [`models.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_on_file", - "created_at": "created_at6" - } -} -``` - + +# Prepayment Response + +## Structure + +`PrepaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayment` | [`models.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_on_file", + "created_at": "created_at6" + } +} +``` + diff --git a/doc/models/prepayment.md b/doc/models/prepayment.md index 5f265628..fc41da3d 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -1,39 +1,39 @@ - -# Prepayment - -## Structure - -`Prepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `int` | Required | - | -| `SubscriptionId` | `int` | Required | - | -| `AmountInCents` | `int64` | Required | - | -| `RemainingAmountInCents` | `int64` | Required | - | -| `RefundedAmountInCents` | `*int64` | Optional | - | -| `Details` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `External` | `bool` | Required | - | -| `Memo` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `PaymentType` | [`*models.PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | -| `CreatedAt` | `string` | Required | **Constraints**: *Minimum Length*: `1` | - -## 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": "created_at8" -} -``` - + +# Prepayment + +## Structure + +`Prepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `int` | Required | - | +| `SubscriptionId` | `int` | Required | - | +| `AmountInCents` | `int64` | Required | - | +| `RemainingAmountInCents` | `int64` | Required | - | +| `RefundedAmountInCents` | `*int64` | Optional | - | +| `Details` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `External` | `bool` | Required | - | +| `Memo` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `PaymentType` | [`*models.PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | +| `CreatedAt` | `string` | Required | **Constraints**: *Minimum Length*: `1` | + +## 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": "created_at8" +} +``` + diff --git a/doc/models/prepayments-response.md b/doc/models/prepayments-response.md index 8e08b22f..adc5db78 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -1,46 +1,46 @@ - -# Prepayments Response - -## Structure - -`PrepaymentsResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayments` | [`[]models.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": "created_at4" - }, - { - "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": "created_at4" - } - ] -} -``` - + +# Prepayments Response + +## Structure + +`PrepaymentsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayments` | [`[]models.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": "created_at4" + }, + { + "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": "created_at4" + } + ] +} +``` + diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index fd1d846a..6ad6025f 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -1,36 +1,36 @@ - -# Preview Allocations Request - -## Structure - -`PreviewAllocationsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Allocations` | [`[]models.CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | -| `EffectiveProrationDate` | `*time.Time` | Optional | To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | - -## Example (as JSON) - -```json -{ - "allocations": [ - { - "quantity": 26.48, - "component_id": 242, - "memo": "memo6", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "accrue_charge": false - } - ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} -``` - + +# Preview Allocations Request + +## Structure + +`PreviewAllocationsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Allocations` | [`[]models.CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | +| `EffectiveProrationDate` | `*time.Time` | Optional | To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | + +## Example (as JSON) + +```json +{ + "allocations": [ + { + "quantity": 26.48, + "component_id": 242, + "memo": "memo6", + "proration_downgrade_scheme": "proration_downgrade_scheme0", + "proration_upgrade_scheme": "proration_upgrade_scheme2", + "accrue_charge": false + } + ], + "effective_proration_date": "2023-12-01", + "upgrade_charge": "none", + "downgrade_credit": "prorated" +} +``` + diff --git a/doc/models/price-point-type.md b/doc/models/price-point-type.md index b9ac10e5..33e8f050 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -1,21 +1,21 @@ - -# Price Point Type - + +# Price Point Type + 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. - -## Enumeration - -`PricePointType` - -## Fields - -| Name | -| --- | -| `CATALOG` | -| `ENUMDEFAULT` | -| `CUSTOM` | - +3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. + +## Enumeration + +`PricePointType` + +## Fields + +| Name | +| --- | +| `CATALOG` | +| `ENUMDEFAULT` | +| `CUSTOM` | + diff --git a/doc/models/price-point.md b/doc/models/price-point.md index 0e0c4992..78bef318 100644 --- a/doc/models/price-point.md +++ b/doc/models/price-point.md @@ -1,52 +1,52 @@ - -# Price Point - -## Structure - -`PricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | -| `UseSiteExchangeRate` | `*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` | -| `TaxIncluded` | `*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 price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | -| `IntervalUnit` | [`*models.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. | -| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | -| `RolloverPrepaidRemainder` | `*bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `RenewPrepaidAllocation` | `*bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | -| `ExpirationInterval` | `*float64` | 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 | -| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "use_site_exchange_rate": true, - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Price Point + +## Structure + +`PricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | +| `UseSiteExchangeRate` | `*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` | +| `TaxIncluded` | `*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 price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `IntervalUnit` | [`*models.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. | +| `OveragePricing` | [`*models.OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | +| `RolloverPrepaidRemainder` | `*bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | +| `RenewPrepaidAllocation` | `*bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `ExpirationInterval` | `*float64` | 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 | +| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "use_site_exchange_rate": true, + "name": "name0", + "handle": "handle6", + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/price.md b/doc/models/price.md index 54cbdabb..bde623a0 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -1,34 +1,34 @@ - -# Price - -## Structure - -`Price` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `StartingQuantity` | `interface{}` | Required | - | -| `EndingQuantity` | `Optional[interface{}]` | Optional | - | -| `UnitPrice` | `interface{}` | Required | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | - -## Example (as JSON) - -```json -{ - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Price + +## Structure + +`Price` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `StartingQuantity` | `interface{}` | Required | - | +| `EndingQuantity` | `Optional[interface{}]` | Optional | - | +| `UnitPrice` | `interface{}` | Required | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | + +## Example (as JSON) + +```json +{ + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 1d1e20b4..96c0ecb8 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -1,18 +1,18 @@ - -# Pricing Scheme - -The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - -## Enumeration - -`PricingScheme` - -## Fields - -| Name | -| --- | -| `STAIRSTEP` | -| `VOLUME` | -| `PERUNIT` | -| `TIERED` | - + +# Pricing Scheme + +The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + +## Enumeration + +`PricingScheme` + +## Fields + +| Name | +| --- | +| `STAIRSTEP` | +| `VOLUME` | +| `PERUNIT` | +| `TIERED` | + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index aca1547e..c488a2f5 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -1,27 +1,27 @@ - -# Product Family Response - -## Structure - -`ProductFamilyResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductFamily` | [`*models.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" - } -} -``` - + +# Product Family Response + +## Structure + +`ProductFamilyResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductFamily` | [`*models.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" + } +} +``` + diff --git a/doc/models/product-family.md b/doc/models/product-family.md index d1843ce0..0b79f577 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -1,31 +1,31 @@ - -# Product Family - -## Structure - -`ProductFamily` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `AccountingCode` | `Optional[string]` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 194, - "name": "name2", - "handle": "handle8", - "accounting_code": "accounting_code8", - "description": "description8" -} -``` - + +# Product Family + +## Structure + +`ProductFamily` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `AccountingCode` | `Optional[string]` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 194, + "name": "name2", + "handle": "handle8", + "accounting_code": "accounting_code8", + "description": "description8" +} +``` + diff --git a/doc/models/product-price-point-error-response-exception.md b/doc/models/product-price-point-error-response-exception.md index a7e795ab..59e72006 100644 --- a/doc/models/product-price-point-error-response-exception.md +++ b/doc/models/product-price-point-error-response-exception.md @@ -1,41 +1,41 @@ - -# Product Price Point Error Response Exception - -## Structure - -`ProductPricePointErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`models.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." - ] - } -} -``` - + +# Product Price Point Error Response Exception + +## Structure + +`ProductPricePointErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`models.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." + ] + } +} +``` + diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index cb829781..66de068f 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -1,44 +1,44 @@ - -# Product Price Point Errors - -## Structure - -`ProductPricePointErrors` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | `*string` | Optional | - | -| `Interval` | `[]string` | Optional | - | -| `IntervalUnit` | `[]string` | Optional | - | -| `Name` | `[]string` | Optional | - | -| `Price` | `[]string` | Optional | - | -| `PriceInCents` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "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." - ] -} -``` - + +# Product Price Point Errors + +## Structure + +`ProductPricePointErrors` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | `*string` | Optional | - | +| `Interval` | `[]string` | Optional | - | +| `IntervalUnit` | `[]string` | Optional | - | +| `Name` | `[]string` | Optional | - | +| `Price` | `[]string` | Optional | - | +| `PriceInCents` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "price_point": "can't be blank", + "interval": [ + "Recurring Interval: cannot be blank.", + "Recurring Interval: must be greater than or equal to 1." + ], + "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 78b744b1..2d7c2b2e 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -1,27 +1,27 @@ - -# Product Price Point Response - -## Structure - -`ProductPricePointResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`models.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 - } -} -``` - + +# Product Price Point Response + +## Structure + +`ProductPricePointResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`models.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 + } +} +``` + diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index eb846092..fb3837a0 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -1,48 +1,48 @@ - -# Product Price Point - -## Structure - -`ProductPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | The product price point name | -| `Handle` | `*string` | Optional | The product price point API handle | -| `PriceInCents` | `*int64` | 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 | -| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | -| `TrialPriceInCents` | `*int64` | Optional | The product price point trial price, in integer cents | -| `TrialInterval` | `*int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | -| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `TrialType` | `*string` | Optional | - | -| `IntroductoryOffer` | `*bool` | Optional | reserved for future use | -| `InitialChargeInCents` | `*int64` | Optional | The product price point initial charge, in integer cents | -| `InitialChargeAfterTrial` | `*bool` | Optional | - | -| `ExpirationInterval` | `*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 every 30 days | -| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | -| `ProductId` | `*int` | Optional | The product id this price point belongs to | -| `ArchivedAt` | `Optional[time.Time]` | Optional | Timestamp indicating when this price point was archived | -| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this price point was created | -| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this price point was last updated | -| `UseSiteExchangeRate` | `*bool` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. | -| `Type` | [`*models.PricePointType`](../../doc/models/price-point-type.md) | Optional | The type of price point | -| `TaxIncluded` | `*bool` | Optional | Whether or not the price point includes tax | -| `SubscriptionId` | `Optional[int]` | Optional | The subscription id this price point belongs to | -| `CurrencyPrices` | [`[]models.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) - -```json -{ - "id": 196, - "name": "name6", - "handle": "handle2", - "price_in_cents": 248, - "interval": 8 -} -``` - + +# Product Price Point + +## Structure + +`ProductPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | The product price point name | +| `Handle` | `*string` | Optional | The product price point API handle | +| `PriceInCents` | `*int64` | 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 | +| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | +| `TrialPriceInCents` | `*int64` | Optional | The product price point trial price, in integer cents | +| `TrialInterval` | `*int` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | +| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | +| `TrialType` | `*string` | Optional | - | +| `IntroductoryOffer` | `*bool` | Optional | reserved for future use | +| `InitialChargeInCents` | `*int64` | Optional | The product price point initial charge, in integer cents | +| `InitialChargeAfterTrial` | `*bool` | Optional | - | +| `ExpirationInterval` | `*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 every 30 days | +| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | +| `ProductId` | `*int` | Optional | The product id this price point belongs to | +| `ArchivedAt` | `Optional[time.Time]` | Optional | Timestamp indicating when this price point was archived | +| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this price point was created | +| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this price point was last updated | +| `UseSiteExchangeRate` | `*bool` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. | +| `Type` | [`*models.PricePointType`](../../doc/models/price-point-type.md) | Optional | The type of price point | +| `TaxIncluded` | `*bool` | Optional | Whether or not the price point includes tax | +| `SubscriptionId` | `Optional[int]` | Optional | The subscription id this price point belongs to | +| `CurrencyPrices` | [`[]models.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) + +```json +{ + "id": 196, + "name": "name6", + "handle": "handle2", + "price_in_cents": 248, + "interval": 8 +} +``` + diff --git a/doc/models/product-response.md b/doc/models/product-response.md index d9682796..fd0a2285 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -1,27 +1,27 @@ - -# Product Response - -## Structure - -`ProductResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Product` | [`models.Product`](../../doc/models/product.md) | Required | - | - -## Example (as JSON) - -```json -{ - "product": { - "id": 134, - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6" - } -} -``` - + +# Product Response + +## Structure + +`ProductResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Product` | [`models.Product`](../../doc/models/product.md) | Required | - | + +## Example (as JSON) + +```json +{ + "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 fb7cb79b..ff529f0d 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -1,61 +1,61 @@ - -# Product - -## Structure - -`Product` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | The product name | -| `Handle` | `Optional[string]` | Optional | The product API handle | -| `Description` | `Optional[string]` | Optional | The product description | -| `AccountingCode` | `Optional[string]` | Optional | E.g. Internal ID or SKU Number | -| `RequestCreditCard` | `*bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | -| `ExpirationInterval` | `Optional[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 | -| `ExpirationIntervalUnit` | [`Optional[models.ExtendedIntervalUnit]`](../../doc/models/extended-interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | -| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this product was created | -| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this product was last updated | -| `PriceInCents` | `*int64` | 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 | -| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | -| `InitialChargeInCents` | `Optional[int64]` | Optional | The up front charge you have specified. | -| `TrialPriceInCents` | `Optional[int64]` | Optional | The price of the trial period for a subscription to this product, in integer cents. | -| `TrialInterval` | `Optional[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 | -| `TrialIntervalUnit` | [`Optional[models.IntervalUnit]`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | -| `ArchivedAt` | `Optional[time.Time]` | Optional | Timestamp indicating when this product was archived | -| `RequireCreditCard` | `*bool` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | -| `ReturnParams` | `Optional[string]` | Optional | - | -| `Taxable` | `*bool` | Optional | - | -| `UpdateReturnUrl` | `Optional[string]` | Optional | The url to which a customer will be returned after a successful account update | -| `InitialChargeAfterTrial` | `*bool` | Optional | - | -| `VersionNumber` | `*int` | Optional | The version of the product | -| `UpdateReturnParams` | `Optional[string]` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | -| `ProductFamily` | [`*models.ProductFamily`](../../doc/models/product-family.md) | Optional | - | -| `PublicSignupPages` | [`[]models.PublicSignupPage`](../../doc/models/public-signup-page.md) | Optional | - | -| `ProductPricePointName` | `*string` | Optional | - | -| `RequestBillingAddress` | `*bool` | Optional | A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product. | -| `RequireBillingAddress` | `*bool` | Optional | A boolean indicating whether a billing address is required to add a payment profile, especially at signup. | -| `RequireShippingAddress` | `*bool` | Optional | A boolean indicating whether a shipping address is required for the customer, especially at signup. | -| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `DefaultProductPricePointId` | `*int` | Optional | - | -| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | -| `ItemCategory` | `Optional[string]` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | -| `ProductPricePointId` | `*int` | Optional | - | -| `ProductPricePointHandle` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} -``` - + +# Product + +## Structure + +`Product` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | The product name | +| `Handle` | `Optional[string]` | Optional | The product API handle | +| `Description` | `Optional[string]` | Optional | The product description | +| `AccountingCode` | `Optional[string]` | Optional | E.g. Internal ID or SKU Number | +| `RequestCreditCard` | `*bool` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. | +| `ExpirationInterval` | `Optional[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 | +| `ExpirationIntervalUnit` | [`Optional[models.ExtendedIntervalUnit]`](../../doc/models/extended-interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | +| `CreatedAt` | `*time.Time` | Optional | Timestamp indicating when this product was created | +| `UpdatedAt` | `*time.Time` | Optional | Timestamp indicating when this product was last updated | +| `PriceInCents` | `*int64` | 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 | +| `IntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | +| `InitialChargeInCents` | `Optional[int64]` | Optional | The up front charge you have specified. | +| `TrialPriceInCents` | `Optional[int64]` | Optional | The price of the trial period for a subscription to this product, in integer cents. | +| `TrialInterval` | `Optional[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 | +| `TrialIntervalUnit` | [`Optional[models.IntervalUnit]`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | +| `ArchivedAt` | `Optional[time.Time]` | Optional | Timestamp indicating when this product was archived | +| `RequireCreditCard` | `*bool` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | +| `ReturnParams` | `Optional[string]` | Optional | - | +| `Taxable` | `*bool` | Optional | - | +| `UpdateReturnUrl` | `Optional[string]` | Optional | The url to which a customer will be returned after a successful account update | +| `InitialChargeAfterTrial` | `*bool` | Optional | - | +| `VersionNumber` | `*int` | Optional | The version of the product | +| `UpdateReturnParams` | `Optional[string]` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | +| `ProductFamily` | [`*models.ProductFamily`](../../doc/models/product-family.md) | Optional | - | +| `PublicSignupPages` | [`[]models.PublicSignupPage`](../../doc/models/public-signup-page.md) | Optional | - | +| `ProductPricePointName` | `*string` | Optional | - | +| `RequestBillingAddress` | `*bool` | Optional | A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product. | +| `RequireBillingAddress` | `*bool` | Optional | A boolean indicating whether a billing address is required to add a payment profile, especially at signup. | +| `RequireShippingAddress` | `*bool` | Optional | A boolean indicating whether a shipping address is required for the customer, especially at signup. | +| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `DefaultProductPricePointId` | `*int` | Optional | - | +| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | +| `ItemCategory` | `Optional[string]` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | +| `ProductPricePointId` | `*int` | Optional | - | +| `ProductPricePointHandle` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 180, + "name": "name4", + "handle": "handle0", + "description": "description4", + "accounting_code": "accounting_code0" +} +``` + diff --git a/doc/models/proforma-bad-request-error-response-exception.md b/doc/models/proforma-bad-request-error-response-exception.md index 0467104d..f01c7d37 100644 --- a/doc/models/proforma-bad-request-error-response-exception.md +++ b/doc/models/proforma-bad-request-error-response-exception.md @@ -1,28 +1,28 @@ - -# Proforma Bad Request Error Response Exception - -## Structure - -`ProformaBadRequestErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`*models.ProformaError`](../../doc/models/proforma-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } - } -} -``` - + +# Proforma Bad Request Error Response Exception + +## Structure + +`ProformaBadRequestErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`*models.ProformaError`](../../doc/models/proforma-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "subscription": { + "base": [ + "base3", + "base4" + ] + } + } +} +``` + diff --git a/doc/models/proforma-custom-field.md b/doc/models/proforma-custom-field.md deleted file mode 100644 index 2f09df99..00000000 --- a/doc/models/proforma-custom-field.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Proforma Custom Field - -## Structure - -`ProformaCustomField` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `OwnerId` | `*int` | Optional | - | -| `OwnerType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Name` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Value` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `MetadatumId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "owner_id": 224, - "owner_type": "owner_type0", - "name": "name8", - "value": "value0", - "metadatum_id": 224 -} -``` - diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index 8125de2c..ad45ed07 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -1,26 +1,26 @@ - -# Proforma Error - -## Structure - -`ProformaError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`*models.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" - ] - } -} -``` - + +# Proforma Error + +## Structure + +`ProformaError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`*models.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" + ] + } +} +``` + diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index 9e65caaf..c29573c4 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -1,27 +1,27 @@ - -# Proforma Invoice Credit - -## Structure - -`ProformaInvoiceCredit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `OriginalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `AppliedAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} -``` - + +# Proforma Invoice Credit + +## Structure + +`ProformaInvoiceCredit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `OriginalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `AppliedAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "memo": "memo2", + "original_amount": "original_amount2", + "applied_amount": "applied_amount0" +} +``` + diff --git a/doc/models/proforma-invoice-discount-breakout.md b/doc/models/proforma-invoice-discount-breakout.md index 7de411ae..e2b4fd53 100644 --- a/doc/models/proforma-invoice-discount-breakout.md +++ b/doc/models/proforma-invoice-discount-breakout.md @@ -1,23 +1,23 @@ - -# Proforma Invoice Discount Breakout - -## Structure - -`ProformaInvoiceDiscountBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `EligibleAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | - -## Example (as JSON) - -```json -{ - "eligible_amount": "eligible_amount6", - "discount_amount": "discount_amount8" -} -``` - + +# Proforma Invoice Discount Breakout + +## Structure + +`ProformaInvoiceDiscountBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `EligibleAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "eligible_amount": "eligible_amount6", + "discount_amount": "discount_amount8" +} +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index 781eca9a..b65d2190 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -1,30 +1,30 @@ - -# Proforma Invoice Discount - -## Structure - -`ProformaInvoiceDiscount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Title` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `SourceType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DiscountType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `EligibleAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `LineItemBreakouts` | [`[]models.ProformaInvoiceDiscountBreakout`](../../doc/models/proforma-invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | - -## Example (as JSON) - -```json -{ - "title": "title8", - "source_type": "source_type2", - "discount_type": "discount_type0", - "eligible_amount": "eligible_amount4", - "discount_amount": "discount_amount6" -} -``` - + +# Proforma Invoice Discount + +## Structure + +`ProformaInvoiceDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Title` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `SourceType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DiscountType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `EligibleAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `LineItemBreakouts` | [`[]models.ProformaInvoiceDiscountBreakout`](../../doc/models/proforma-invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | + +## Example (as JSON) + +```json +{ + "title": "title8", + "source_type": "source_type2", + "discount_type": "discount_type0", + "eligible_amount": "eligible_amount4", + "discount_amount": "discount_amount6" +} +``` + diff --git a/doc/models/proforma-invoice-payment.md b/doc/models/proforma-invoice-payment.md index 471fb799..0e899c5e 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -1,27 +1,27 @@ - -# Proforma Invoice Payment - -## Structure - -`ProformaInvoicePayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `OriginalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `AppliedAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Prepayment` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} -``` - + +# Proforma Invoice Payment + +## Structure + +`ProformaInvoicePayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `OriginalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `AppliedAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Prepayment` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "memo": "memo4", + "original_amount": "original_amount4", + "applied_amount": "applied_amount8", + "prepayment": false +} +``` + diff --git a/doc/models/proforma-invoice-preview.md b/doc/models/proforma-invoice-preview.md index 46d4426d..5d0be41c 100644 --- a/doc/models/proforma-invoice-preview.md +++ b/doc/models/proforma-invoice-preview.md @@ -1,60 +1,60 @@ - -# Proforma Invoice Preview - -## Structure - -`ProformaInvoicePreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `SiteId` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `Number` | `*string` | Optional | - | -| `SequenceNumber` | `*int` | Optional | - | -| `CreatedAt` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DeliveryDate` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Status` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `CollectionMethod` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `PaymentInstructions` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Currency` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `ConsolidationLevel` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `ProductName` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `ProductFamilyName` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Role` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | -| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `SubtotalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `TotalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `CreditAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `PaidAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `RefundAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `DueAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `Discounts` | [`[]models.ProformaInvoiceDiscount`](../../doc/models/proforma-invoice-discount.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `Taxes` | [`[]models.ProformaInvoiceTax`](../../doc/models/proforma-invoice-tax.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `Credits` | [`[]models.ProformaInvoiceCredit`](../../doc/models/proforma-invoice-credit.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `Payments` | [`[]models.ProformaInvoicePayment`](../../doc/models/proforma-invoice-payment.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `CustomFields` | [`[]models.ProformaCustomField`](../../doc/models/proforma-custom-field.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -| `PublicUrl` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 214, - "customer_id": 70, - "subscription_id": 142, - "number": "number0" -} -``` - + +# Proforma Invoice Preview + +## Structure + +`ProformaInvoicePreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `SiteId` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `Number` | `*string` | Optional | - | +| `SequenceNumber` | `*int` | Optional | - | +| `CreatedAt` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DeliveryDate` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Status` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `CollectionMethod` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `PaymentInstructions` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Currency` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `ConsolidationLevel` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `ProductName` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `ProductFamilyName` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Role` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | +| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `Memo` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `SubtotalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DiscountAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `TotalAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `CreditAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `PaidAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `RefundAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `DueAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `Discounts` | [`[]models.ProformaInvoiceDiscount`](../../doc/models/proforma-invoice-discount.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `Taxes` | [`[]models.ProformaInvoiceTax`](../../doc/models/proforma-invoice-tax.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `Credits` | [`[]models.ProformaInvoiceCredit`](../../doc/models/proforma-invoice-credit.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `Payments` | [`[]models.ProformaInvoicePayment`](../../doc/models/proforma-invoice-payment.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `CustomFields` | [`[]models.InvoiceCustomField`](../../doc/models/invoice-custom-field.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | +| `PublicUrl` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "site_id": 214, + "customer_id": 70, + "subscription_id": 142, + "number": "number0" +} +``` + diff --git a/doc/models/proforma-invoice-tax-breakout.md b/doc/models/proforma-invoice-tax-breakout.md index 99f51ea2..e16b10f2 100644 --- a/doc/models/proforma-invoice-tax-breakout.md +++ b/doc/models/proforma-invoice-tax-breakout.md @@ -1,23 +1,23 @@ - -# Proforma Invoice Tax Breakout - -## Structure - -`ProformaInvoiceTaxBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TaxableAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | - -## Example (as JSON) - -```json -{ - "taxable_amount": "taxable_amount8", - "tax_amount": "tax_amount2" -} -``` - + +# Proforma Invoice Tax Breakout + +## Structure + +`ProformaInvoiceTaxBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TaxableAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "taxable_amount": "taxable_amount8", + "tax_amount": "tax_amount2" +} +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index d1192327..5f2141fe 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -1,31 +1,31 @@ - -# Proforma Invoice Tax - -## Structure - -`ProformaInvoiceTax` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Title` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `SourceType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `Percentage` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `TaxableAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | -| `LineItemBreakouts` | [`[]models.ProformaInvoiceTaxBreakout`](../../doc/models/proforma-invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title4", - "source_type": "source_type8", - "percentage": "percentage6", - "taxable_amount": "taxable_amount2" -} -``` - + +# Proforma Invoice Tax + +## Structure + +`ProformaInvoiceTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Title` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `SourceType` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `Percentage` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `TaxableAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `TaxAmount` | `*string` | Optional | **Constraints**: *Minimum Length*: `1` | +| `LineItemBreakouts` | [`[]models.ProformaInvoiceTaxBreakout`](../../doc/models/proforma-invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "title": "title4", + "source_type": "source_type8", + "percentage": "percentage6", + "taxable_amount": "taxable_amount2" +} +``` + diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index 8dd96737..cf0c8dde 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -1,60 +1,60 @@ - -# Proforma Invoice - -## Structure - -`ProformaInvoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `Number` | `*int` | Optional | - | -| `SequenceNumber` | `*int` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `DeliveryDate` | `*string` | Optional | - | -| `Status` | `*string` | Optional | - | -| `CollectionMethod` | `*string` | Optional | - | -| `PaymentInstructions` | `*string` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `ConsolidationLevel` | `*string` | Optional | - | -| `ProductName` | `*string` | Optional | - | -| `ProductFamilyName` | `*string` | Optional | - | -| `Role` | `*string` | Optional | - | -| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | -| `Memo` | `*string` | Optional | - | -| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `SubtotalAmount` | `*string` | Optional | - | -| `DiscountAmount` | `*string` | Optional | - | -| `TaxAmount` | `*string` | Optional | - | -| `TotalAmount` | `*string` | Optional | - | -| `CreditAmount` | `*string` | Optional | - | -| `PaidAmount` | `*string` | Optional | - | -| `RefundAmount` | `*string` | Optional | - | -| `DueAmount` | `*string` | Optional | - | -| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | - | -| `Discounts` | [`[]models.ProformaInvoiceDiscount`](../../doc/models/proforma-invoice-discount.md) | Optional | - | -| `Taxes` | [`[]models.ProformaInvoiceTax`](../../doc/models/proforma-invoice-tax.md) | Optional | - | -| `Credits` | [`[]models.ProformaInvoiceCredit`](../../doc/models/proforma-invoice-credit.md) | Optional | - | -| `Payments` | [`[]models.ProformaInvoicePayment`](../../doc/models/proforma-invoice-payment.md) | Optional | - | -| `CustomFields` | [`[]models.ProformaCustomField`](../../doc/models/proforma-custom-field.md) | Optional | - | -| `PublicUrl` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid6", - "site_id": 196, - "customer_id": 52, - "subscription_id": 124, - "number": 0 -} -``` - + +# Proforma Invoice + +## Structure + +`ProformaInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `Number` | `*int` | Optional | - | +| `SequenceNumber` | `*int` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `DeliveryDate` | `*string` | Optional | - | +| `Status` | `*string` | Optional | - | +| `CollectionMethod` | `*string` | Optional | - | +| `PaymentInstructions` | `*string` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `ConsolidationLevel` | `*string` | Optional | - | +| `ProductName` | `*string` | Optional | - | +| `ProductFamilyName` | `*string` | Optional | - | +| `Role` | `*string` | Optional | - | +| `Seller` | [`*models.InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | +| `Customer` | [`*models.InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `Memo` | `*string` | Optional | - | +| `BillingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `ShippingAddress` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `SubtotalAmount` | `*string` | Optional | - | +| `DiscountAmount` | `*string` | Optional | - | +| `TaxAmount` | `*string` | Optional | - | +| `TotalAmount` | `*string` | Optional | - | +| `CreditAmount` | `*string` | Optional | - | +| `PaidAmount` | `*string` | Optional | - | +| `RefundAmount` | `*string` | Optional | - | +| `DueAmount` | `*string` | Optional | - | +| `LineItems` | [`[]models.InvoiceLineItem`](../../doc/models/invoice-line-item.md) | Optional | - | +| `Discounts` | [`[]models.ProformaInvoiceDiscount`](../../doc/models/proforma-invoice-discount.md) | Optional | - | +| `Taxes` | [`[]models.ProformaInvoiceTax`](../../doc/models/proforma-invoice-tax.md) | Optional | - | +| `Credits` | [`[]models.ProformaInvoiceCredit`](../../doc/models/proforma-invoice-credit.md) | Optional | - | +| `Payments` | [`[]models.ProformaInvoicePayment`](../../doc/models/proforma-invoice-payment.md) | Optional | - | +| `CustomFields` | [`[]models.InvoiceCustomField`](../../doc/models/invoice-custom-field.md) | Optional | - | +| `PublicUrl` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid6", + "site_id": 196, + "customer_id": 52, + "subscription_id": 124, + "number": 0 +} +``` + diff --git a/doc/models/proration.md b/doc/models/proration.md index 3b71324d..bb199af6 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -1,21 +1,21 @@ - -# Proration - -## Structure - -`Proration` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PreservePeriod` | `*bool` | Optional | The alternative to sending preserve_period as a direct attribute to migration | - -## Example (as JSON) - -```json -{ - "preserve_period": false -} -``` - + +# Proration + +## Structure + +`Proration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PreservePeriod` | `*bool` | Optional | The alternative to sending preserve_period as a direct attribute to migration | + +## Example (as JSON) + +```json +{ + "preserve_period": false +} +``` + diff --git a/doc/models/public-key.md b/doc/models/public-key.md index 8a5797ef..3c0cf167 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -1,25 +1,25 @@ - -# Public Key - -## Structure - -`PublicKey` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PublicKey` | `*string` | Optional | - | -| `RequiresSecurityToken` | `*bool` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "created_at6" -} -``` - + +# Public Key + +## Structure + +`PublicKey` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PublicKey` | `*string` | Optional | - | +| `RequiresSecurityToken` | `*bool` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "public_key": "public_key8", + "requires_security_token": false, + "created_at": "created_at6" +} +``` + diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index 3ff0a4fd..4cf3ffe4 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -1,27 +1,27 @@ - -# Public Signup Page - -## Structure - -`PublicSignupPage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | The id of the signup page (public_signup_pages only) | -| `ReturnUrl` | `Optional[string]` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | -| `ReturnParams` | `Optional[string]` | Optional | The params to be appended to the return_url (public_signup_pages only) | -| `Url` | `*string` | Optional | The url where the signup page can be viewed (public_signup_pages only) | - -## Example (as JSON) - -```json -{ - "id": 6, - "return_url": "return_url0", - "return_params": "return_params2", - "url": "url8" -} -``` - + +# Public Signup Page + +## Structure + +`PublicSignupPage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | The id of the signup page (public_signup_pages only) | +| `ReturnUrl` | `Optional[string]` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | +| `ReturnParams` | `Optional[string]` | Optional | The params to be appended to the return_url (public_signup_pages only) | +| `Url` | `*string` | Optional | The url where the signup page can be viewed (public_signup_pages only) | + +## Example (as JSON) + +```json +{ + "id": 6, + "return_url": "return_url0", + "return_params": "return_params2", + "url": "url8" +} +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 1b4f45ac..f0b5d3c4 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -1,62 +1,62 @@ - -# Quantity Based Component - -## Structure - -`QuantityBasedComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | -| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | -| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | -| `Recurring` | `*bool` | Optional | - | -| `DisplayOnHostedPage` | `*bool` | Optional | - | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `PublicSignupPageIds` | `[]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. | -| `IntervalUnit` | [`*models.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": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "upgrade_charge": "full" -} -``` - + +# Quantity Based Component + +## Structure + +`QuantityBasedComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `UnitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `Description` | `*string` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | +| `Handle` | `*string` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `PricingScheme` | [`models.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` | [`[]models.Price`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `PricePoints` | [`[]models.ComponentPricePointItem`](../../doc/models/component-price-point-item.md) | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | +| `TaxCode` | `*string` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `HideDateRangeOnInvoice` | `*bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | +| `PriceInCents` | `*string` | Optional | deprecated May 2011 - use unit_price instead | +| `Recurring` | `*bool` | Optional | - | +| `DisplayOnHostedPage` | `*bool` | Optional | - | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `PublicSignupPageIds` | `[]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. | +| `IntervalUnit` | [`*models.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": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "upgrade_charge": "full" +} +``` + diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index 3326b405..af3c977f 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -1,23 +1,23 @@ - -# Reactivate Subscription Group Request - -## Structure - -`ReactivateSubscriptionGroupRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Resume` | `*bool` | Optional | - | -| `ResumeMembers` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "resume": false, - "resume_members": false -} -``` - + +# Reactivate Subscription Group Request + +## Structure + +`ReactivateSubscriptionGroupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Resume` | `*bool` | Optional | - | +| `ResumeMembers` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "resume": false, + "resume_members": false +} +``` + diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index ffee7078..6f446be5 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -1,36 +1,36 @@ - -# Reactivate Subscription Group Response - -## Structure - -`ReactivateSubscriptionGroupResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Scheme` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `PaymentProfileId` | `*int` | Optional | - | -| `SubscriptionIds` | `[]int` | Optional | - | -| `PrimarySubscriptionId` | `*int` | Optional | - | -| `NextAssessmentAt` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `CancelAtEndOfPeriod` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 - ] -} -``` - + +# Reactivate Subscription Group Response + +## Structure + +`ReactivateSubscriptionGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Scheme` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `PaymentProfileId` | `*int` | Optional | - | +| `SubscriptionIds` | `[]int` | Optional | - | +| `PrimarySubscriptionId` | `*int` | Optional | - | +| `NextAssessmentAt` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `CancelAtEndOfPeriod` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "scheme": 66, + "customer_id": 86, + "payment_profile_id": 250, + "subscription_ids": [ + 196, + 197 + ] +} +``` + diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index 4c711452..ad50084e 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -1,32 +1,32 @@ - -# Reactivate Subscription Request - -## Structure - -`ReactivateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CalendarBilling` | [`*models.ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | -| `IncludeTrial` | `*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. | -| `PreserveBalance` | `*bool` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | -| `CouponCode` | `*string` | Optional | The coupon code to be applied during reactivation. | -| `UseCreditsAndPrepayments` | `*bool` | Optional | If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | -| `Resume` | `*interface{}` | Optional | If `true`, Chargify will attempt to resume the subscription's billing period. if not resumable, the subscription will be reactivated with a new billing period. If `false`: Chargify will only attempt to reactivate the subscription. | - -## Example (as JSON) - -```json -{ - "calendar_billing": { - "reactivation_charge": "prorated" - }, - "include_trial": false, - "preserve_balance": false, - "coupon_code": "coupon_code6", - "use_credits_and_prepayments": false -} -``` - + +# Reactivate Subscription Request + +## Structure + +`ReactivateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CalendarBilling` | [`*models.ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | +| `IncludeTrial` | `*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. | +| `PreserveBalance` | `*bool` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | +| `CouponCode` | `*string` | Optional | The coupon code to be applied during reactivation. | +| `UseCreditsAndPrepayments` | `*bool` | Optional | If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | +| `Resume` | `*interface{}` | Optional | If `true`, Chargify will attempt to resume the subscription's billing period. if not resumable, the subscription will be reactivated with a new billing period. If `false`: Chargify will only attempt to reactivate the subscription. | + +## Example (as JSON) + +```json +{ + "calendar_billing": { + "reactivation_charge": "prorated" + }, + "include_trial": false, + "preserve_balance": false, + "coupon_code": "coupon_code6", + "use_credits_and_prepayments": false +} +``` + diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index 7b63ba59..5683774f 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -1,23 +1,23 @@ - -# Reactivation Billing - -These values are only applicable to subscriptions using calendar billing - -## Structure - -`ReactivationBilling` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ReactivationCharge` | [`*models.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"` | - -## Example (as JSON) - -```json -{ - "reactivation_charge": "prorated" -} -``` - + +# Reactivation Billing + +These values are only applicable to subscriptions using calendar billing + +## Structure + +`ReactivationBilling` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ReactivationCharge` | [`*models.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"` | + +## Example (as JSON) + +```json +{ + "reactivation_charge": "prorated" +} +``` + diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index dbe0bc6e..0e142944 100644 --- a/doc/models/reactivation-charge.md +++ b/doc/models/reactivation-charge.md @@ -1,17 +1,17 @@ - -# 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 - -## Enumeration - -`ReactivationCharge` - -## Fields - -| Name | -| --- | -| `PRORATED` | -| `IMMEDIATE` | -| `DELAYED` | - + +# 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 + +## Enumeration + +`ReactivationCharge` + +## Fields + +| Name | +| --- | +| `PRORATED` | +| `IMMEDIATE` | +| `DELAYED` | + diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index c3127b46..738fa76c 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -1,27 +1,27 @@ - -# Reason Code Response - -## Structure - -`ReasonCodeResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ReasonCode` | [`models.ReasonCode`](../../doc/models/reason-code.md) | Required | - | - -## Example (as JSON) - -```json -{ - "reason_code": { - "id": 240, - "site_id": 166, - "code": "code4", - "description": "description6", - "position": 14 - } -} -``` - + +# Reason Code Response + +## Structure + +`ReasonCodeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ReasonCode` | [`models.ReasonCode`](../../doc/models/reason-code.md) | Required | - | + +## Example (as JSON) + +```json +{ + "reason_code": { + "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 f0c4bbd7..e160f551 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -1,31 +1,31 @@ - -# Reason Code - -## Structure - -`ReasonCode` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `Code` | `*string` | Optional | - | -| `Description` | `*string` | Optional | - | -| `Position` | `*int` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} -``` - + +# Reason Code + +## Structure + +`ReasonCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `Code` | `*string` | Optional | - | +| `Description` | `*string` | Optional | - | +| `Position` | `*int` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 164, + "site_id": 90, + "code": "code0", + "description": "description2", + "position": 194 +} +``` + diff --git a/doc/models/reason-codes-json-response.md b/doc/models/reason-codes-json-response.md index 319fe242..36faea37 100644 --- a/doc/models/reason-codes-json-response.md +++ b/doc/models/reason-codes-json-response.md @@ -1,21 +1,21 @@ - -# Reason Codes Json Response - -## Structure - -`ReasonCodesJsonResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Ok` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "ok": "ok2" -} -``` - + +# Reason Codes Json Response + +## Structure + +`ReasonCodesJsonResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Ok` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "ok": "ok2" +} +``` + diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index f7a79d4c..3aedd5d4 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -1,26 +1,26 @@ - -# Record Payment Request - -## Structure - -`RecordPaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Payment` | [`models.CreatePayment`](../../doc/models/create-payment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment": { - "amount": "amount8", - "memo": "memo0", - "payment_details": "payment_details6", - "payment_method": "payment_method4" - } -} -``` - + +# Record Payment Request + +## Structure + +`RecordPaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Payment` | [`models.CreatePayment`](../../doc/models/create-payment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "payment": { + "amount": "amount8", + "memo": "memo0", + "payment_details": "payment_details6", + "payment_method": "payment_method4" + } +} +``` + diff --git a/doc/models/recurring-scheme.md b/doc/models/recurring-scheme.md index 57f596e1..c7d81f27 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -1,15 +1,15 @@ - -# Recurring Scheme - -## Enumeration - -`RecurringScheme` - -## Fields - -| Name | -| --- | -| `DONOTRECUR` | -| `RECURINDEFINITELY` | -| `RECURWITHDURATION` | - + +# Recurring Scheme + +## Enumeration + +`RecurringScheme` + +## Fields + +| Name | +| --- | +| `DONOTRECUR` | +| `RECURINDEFINITELY` | +| `RECURWITHDURATION` | + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index e91d0c0b..326323c5 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -1,27 +1,27 @@ - -# Referral Code - -## Structure - -`ReferralCode` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `Code` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} -``` - + +# Referral Code + +## Structure + +`ReferralCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `Code` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 42, + "site_id": 224, + "subscription_id": 152, + "code": "code6" +} +``` + diff --git a/doc/models/referral-validation-response.md b/doc/models/referral-validation-response.md index d7e71832..fe4ea5db 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -1,26 +1,26 @@ - -# Referral Validation Response - -## Structure - -`ReferralValidationResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ReferralCode` | [`*models.ReferralCode`](../../doc/models/referral-code.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "referral_code": { - "id": 46, - "site_id": 228, - "subscription_id": 156, - "code": "code0" - } -} -``` - + +# Referral Validation Response + +## Structure + +`ReferralValidationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ReferralCode` | [`*models.ReferralCode`](../../doc/models/referral-code.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "referral_code": { + "id": 46, + "site_id": 228, + "subscription_id": 156, + "code": "code0" + } +} +``` + diff --git a/doc/models/refund-invoice-request.md b/doc/models/refund-invoice-request.md index 5023d2a2..fab8e351 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -1,27 +1,27 @@ - -# Refund Invoice Request - -## Structure - -`RefundInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Refund` | [`models.Refund`](../../doc/models/refund.md) | Required | - | - -## Example (as JSON) - -```json -{ - "refund": { - "amount": "amount0", - "memo": "memo2", - "payment_id": 44, - "external": false, - "apply_credit": false - } -} -``` - + +# Refund Invoice Request + +## Structure + +`RefundInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Refund` | [`models.Refund`](../../doc/models/refund.md) | Required | - | + +## Example (as JSON) + +```json +{ + "refund": { + "amount": "amount0", + "memo": "memo2", + "payment_id": 44, + "external": false, + "apply_credit": false + } +} +``` + diff --git a/doc/models/refund-prepayment-aggregated-error.md b/doc/models/refund-prepayment-aggregated-error.md index 5de498b1..8c0ea63d 100644 --- a/doc/models/refund-prepayment-aggregated-error.md +++ b/doc/models/refund-prepayment-aggregated-error.md @@ -1,32 +1,32 @@ - -# Refund Prepayment Aggregated Error - -## Structure - -`RefundPrepaymentAggregatedError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Refund` | [`*models.PrepaymentAggregatedError`](../../doc/models/prepayment-aggregated-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": [ - "amount_in_cents5" - ], - "base": [ - "base7" - ], - "external": [ - "external0", - "external1" - ] - } -} -``` - + +# Refund Prepayment Aggregated Error + +## Structure + +`RefundPrepaymentAggregatedError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Refund` | [`*models.PrepaymentAggregatedError`](../../doc/models/prepayment-aggregated-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "refund": { + "amount_in_cents": [ + "amount_in_cents5" + ], + "base": [ + "base7" + ], + "external": [ + "external0", + "external1" + ] + } +} +``` + diff --git a/doc/models/refund-prepayment-aggregated-errors-response-exception.md b/doc/models/refund-prepayment-aggregated-errors-response-exception.md index 39fd5d08..756f4826 100644 --- a/doc/models/refund-prepayment-aggregated-errors-response-exception.md +++ b/doc/models/refund-prepayment-aggregated-errors-response-exception.md @@ -1,36 +1,36 @@ - -# Refund Prepayment Aggregated Errors Response Exception - -Errors returned on creating a refund prepayment, grouped by field, as arrays of strings. - -## Structure - -`RefundPrepaymentAggregatedErrorsResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`*models.RefundPrepaymentAggregatedError`](../../doc/models/refund-prepayment-aggregated-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "amount_in_cents": [ - "amount_in_cents5" - ], - "base": [ - "base7" - ], - "external": [ - "external0", - "external1" - ] - } - } -} -``` - + +# Refund Prepayment Aggregated Errors Response Exception + +Errors returned on creating a refund prepayment, grouped by field, as arrays of strings. + +## Structure + +`RefundPrepaymentAggregatedErrorsResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`*models.RefundPrepaymentAggregatedError`](../../doc/models/refund-prepayment-aggregated-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "refund": { + "amount_in_cents": [ + "amount_in_cents5" + ], + "base": [ + "base7" + ], + "external": [ + "external0", + "external1" + ] + } + } +} +``` + diff --git a/doc/models/refund-prepayment-base-errors-response-exception.md b/doc/models/refund-prepayment-base-errors-response-exception.md index ae3869f0..e1ddf21f 100644 --- a/doc/models/refund-prepayment-base-errors-response-exception.md +++ b/doc/models/refund-prepayment-base-errors-response-exception.md @@ -1,32 +1,32 @@ - -# Refund Prepayment Base Errors Response Exception - -Errors returned on creating a refund prepayment when bad request - -## Structure - -`RefundPrepaymentBaseErrorsResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`*models.RefundPrepaymentBaseRefundError`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } - } -} -``` - + +# Refund Prepayment Base Errors Response Exception + +Errors returned on creating a refund prepayment when bad request + +## Structure + +`RefundPrepaymentBaseErrorsResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`*models.RefundPrepaymentBaseRefundError`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "refund": { + "base": [ + { + "key1": "val1", + "key2": "val2" + } + ] + } + } +} +``` + diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index e9658934..f1267ad5 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -1,28 +1,28 @@ - -# Refund Prepayment Base Refund Error - -## Structure - -`RefundPrepaymentBaseRefundError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Refund` | [`*models.BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } -} -``` - + +# Refund Prepayment Base Refund Error + +## Structure + +`RefundPrepaymentBaseRefundError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Refund` | [`*models.BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "refund": { + "base": [ + { + "key1": "val1", + "key2": "val2" + } + ] + } +} +``` + diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 16e01c24..d1f70acb 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -1,29 +1,29 @@ - -# Refund Prepayment Request - -## Structure - -`RefundPrepaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Refund` | [`models.RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo2", - "external": false - } -} -``` - + +# Refund Prepayment Request + +## Structure + +`RefundPrepaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Refund` | [`models.RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "refund": { + "amount_in_cents": 132, + "amount": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo2", + "external": false + } +} +``` + diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index 79470f4e..42b300ef 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -1,30 +1,30 @@ - -# Refund Prepayment - -## Structure - -`RefundPrepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `AmountInCents` | `int64` | Required | `amount` is not required if you pass `amount_in_cents`. | -| `Amount` | `interface{}` | Required | `amount_in_cents` is not required if you pass `amount`. | -| `Memo` | `string` | 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": { - "key1": "val1", - "key2": "val2" - }, - "memo": "memo4", - "external": false -} -``` - + +# Refund Prepayment + +## Structure + +`RefundPrepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `AmountInCents` | `int64` | Required | `amount` is not required if you pass `amount_in_cents`. | +| `Amount` | `interface{}` | Required | `amount_in_cents` is not required if you pass `amount`. | +| `Memo` | `string` | 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": { + "key1": "val1", + "key2": "val2" + }, + "memo": "memo4", + "external": false +} +``` + diff --git a/doc/models/refund.md b/doc/models/refund.md index b6d55add..b5f49712 100644 --- a/doc/models/refund.md +++ b/doc/models/refund.md @@ -1,31 +1,31 @@ - -# Refund - -## Structure - -`Refund` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `*string` | Optional | The amount to be refunded in decimal format as a string. Example: "10.50". Must not exceed the remaining refundable balance of the payment. | -| `Memo` | `*string` | Optional | A description that will be attached to the refund | -| `PaymentId` | `*int` | Optional | 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`. | -| `ApplyCredit` | `*bool` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | -| `VoidInvoice` | `*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`. | -| `SegmentUids` | `*interface{}` | Optional | An array of segment uids to refund or the string 'all' to indicate that all segments should be refunded | - -## Example (as JSON) - -```json -{ - "amount": "amount8", - "memo": "memo0", - "payment_id": 130, - "external": false, - "apply_credit": false -} -``` - + +# Refund + +## Structure + +`Refund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `*string` | Optional | The amount to be refunded in decimal format as a string. Example: "10.50". Must not exceed the remaining refundable balance of the payment. | +| `Memo` | `*string` | Optional | A description that will be attached to the refund | +| `PaymentId` | `*int` | Optional | 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`. | +| `ApplyCredit` | `*bool` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | +| `VoidInvoice` | `*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`. | +| `SegmentUids` | `*interface{}` | Optional | An array of segment uids to refund or the string 'all' to indicate that all segments should be refunded | + +## Example (as JSON) + +```json +{ + "amount": "amount8", + "memo": "memo0", + "payment_id": 130, + "external": false, + "apply_credit": false +} +``` + diff --git a/doc/models/renewal-preview-component.md b/doc/models/renewal-preview-component.md index 17df7ac5..8e9a38cc 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -1,31 +1,31 @@ - -# Renewal Preview Component - -## Structure - -`RenewalPreviewComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*interface{}` | Optional | Either the component's Chargify id or its handle prefixed with `handle:` | -| `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 | -| `PricePointId` | `*interface{}` | Optional | Either the component price point's Chargify id or its handle prefixed with `handle:` | - -## Example (as JSON) - -```json -{ - "component_id": { - "key1": "val1", - "key2": "val2" - }, - "quantity": 174, - "price_point_id": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Renewal Preview Component + +## Structure + +`RenewalPreviewComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*interface{}` | Optional | Either the component's Chargify id or its handle prefixed with `handle:` | +| `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 | +| `PricePointId` | `*interface{}` | Optional | Either the component price point's Chargify id or its handle prefixed with `handle:` | + +## Example (as JSON) + +```json +{ + "component_id": { + "key1": "val1", + "key2": "val2" + }, + "quantity": 174, + "price_point_id": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index 34bd5106..ab1316c5 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -1,38 +1,38 @@ - -# Renewal Preview Line Item - -## Structure - -`RenewalPreviewLineItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | -| `Kind` | [`*models.LineItemKind`](../../doc/models/line-item-kind.md) | Optional | A handle for the line item kind | -| `AmountInCents` | `*int64` | Optional | - | -| `Memo` | `*string` | Optional | - | -| `DiscountAmountInCents` | `*int64` | Optional | - | -| `TaxableAmountInCents` | `*int64` | Optional | - | -| `ProductId` | `*int` | Optional | - | -| `ProductName` | `*string` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `ComponentHandle` | `*string` | Optional | - | -| `ComponentName` | `*string` | Optional | - | -| `ProductHandle` | `*string` | Optional | - | -| `PeriodRangeStart` | `*string` | Optional | - | -| `PeriodRangeEnd` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} -``` - + +# Renewal Preview Line Item + +## Structure + +`RenewalPreviewLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TransactionType` | [`*models.LineItemTransactionType`](../../doc/models/line-item-transaction-type.md) | Optional | A handle for the line item transaction type | +| `Kind` | [`*models.LineItemKind`](../../doc/models/line-item-kind.md) | Optional | A handle for the line item kind | +| `AmountInCents` | `*int64` | Optional | - | +| `Memo` | `*string` | Optional | - | +| `DiscountAmountInCents` | `*int64` | Optional | - | +| `TaxableAmountInCents` | `*int64` | Optional | - | +| `ProductId` | `*int` | Optional | - | +| `ProductName` | `*string` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `ComponentHandle` | `*string` | Optional | - | +| `ComponentName` | `*string` | Optional | - | +| `ProductHandle` | `*string` | Optional | - | +| `PeriodRangeStart` | `*string` | Optional | - | +| `PeriodRangeEnd` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "transaction_type": "charge", + "kind": "prepaid_usage_component", + "amount_in_cents": 154, + "memo": "memo0", + "discount_amount_in_cents": 214 +} +``` + diff --git a/doc/models/renewal-preview-request.md b/doc/models/renewal-preview-request.md index e5581799..6f4defca 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -1,55 +1,55 @@ - -# Renewal Preview Request - -## Structure - -`RenewalPreviewRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Components` | [`[]models.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": { - "key1": "val1", - "key2": "val2" - }, - "quantity": 210, - "price_point_id": { - "key1": "val1", - "key2": "val2" - } - }, - { - "component_id": { - "key1": "val1", - "key2": "val2" - }, - "quantity": 210, - "price_point_id": { - "key1": "val1", - "key2": "val2" - } - }, - { - "component_id": { - "key1": "val1", - "key2": "val2" - }, - "quantity": 210, - "price_point_id": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Renewal Preview Request + +## Structure + +`RenewalPreviewRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Components` | [`[]models.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": { + "key1": "val1", + "key2": "val2" + }, + "quantity": 210, + "price_point_id": { + "key1": "val1", + "key2": "val2" + } + }, + { + "component_id": { + "key1": "val1", + "key2": "val2" + }, + "quantity": 210, + "price_point_id": { + "key1": "val1", + "key2": "val2" + } + }, + { + "component_id": { + "key1": "val1", + "key2": "val2" + }, + "quantity": 210, + "price_point_id": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/renewal-preview-response.md b/doc/models/renewal-preview-response.md index e3b4d04c..21e80df9 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -1,27 +1,27 @@ - -# Renewal Preview Response - -## Structure - -`RenewalPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `RenewalPreview` | [`models.RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | - -## Example (as JSON) - -```json -{ - "renewal_preview": { - "next_assessment_at": "next_assessment_at2", - "subtotal_in_cents": 132, - "total_tax_in_cents": 0, - "total_discount_in_cents": 250, - "total_in_cents": 20 - } -} -``` - + +# Renewal Preview Response + +## Structure + +`RenewalPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `RenewalPreview` | [`models.RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | + +## Example (as JSON) + +```json +{ + "renewal_preview": { + "next_assessment_at": "next_assessment_at2", + "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 6bfdb1a2..bda272d4 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -1,33 +1,33 @@ - -# Renewal Preview - -## Structure - -`RenewalPreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `NextAssessmentAt` | `*string` | Optional | The timestamp for the subscription’s next renewal | -| `SubtotalInCents` | `*int64` | Optional | An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal | -| `TotalTaxInCents` | `*int64` | Optional | An integer representing the total tax charges that will be assessed at the next renewal | -| `TotalDiscountInCents` | `*int64` | Optional | An integer representing the amount of the coupon discounts that will be applied to the next renewal | -| `TotalInCents` | `*int64` | Optional | An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal | -| `ExistingBalanceInCents` | `*int64` | Optional | An integer representing the amount of the subscription’s current balance | -| `TotalAmountDueInCents` | `*int64` | Optional | An integer representing the existing_balance_in_cents plus the total_in_cents | -| `UncalculatedTaxes` | `*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. | -| `LineItems` | [`[]models.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": "next_assessment_at0", - "subtotal_in_cents": 160, - "total_tax_in_cents": 28, - "total_discount_in_cents": 34, - "total_in_cents": 48 -} -``` - + +# Renewal Preview + +## Structure + +`RenewalPreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `NextAssessmentAt` | `*string` | Optional | The timestamp for the subscription’s next renewal | +| `SubtotalInCents` | `*int64` | Optional | An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal | +| `TotalTaxInCents` | `*int64` | Optional | An integer representing the total tax charges that will be assessed at the next renewal | +| `TotalDiscountInCents` | `*int64` | Optional | An integer representing the amount of the coupon discounts that will be applied to the next renewal | +| `TotalInCents` | `*int64` | Optional | An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal | +| `ExistingBalanceInCents` | `*int64` | Optional | An integer representing the amount of the subscription’s current balance | +| `TotalAmountDueInCents` | `*int64` | Optional | An integer representing the existing_balance_in_cents plus the total_in_cents | +| `UncalculatedTaxes` | `*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. | +| `LineItems` | [`[]models.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": "next_assessment_at0", + "subtotal_in_cents": 160, + "total_tax_in_cents": 28, + "total_discount_in_cents": 34, + "total_in_cents": 48 +} +``` + diff --git a/doc/models/replay-webhooks-request.md b/doc/models/replay-webhooks-request.md index dcedfb52..ae326874 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -1,23 +1,23 @@ - -# Replay Webhooks Request - -## Structure - -`ReplayWebhooksRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Ids` | `[]int` | Required | - | - -## Example (as JSON) - -```json -{ - "ids": [ - 15 - ] -} -``` - + +# Replay Webhooks Request + +## Structure + +`ReplayWebhooksRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Ids` | `[]int` | Required | - | + +## Example (as JSON) + +```json +{ + "ids": [ + 15 + ] +} +``` + diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index e3759052..42545a27 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -1,21 +1,21 @@ - -# Replay Webhooks Response - -## Structure - -`ReplayWebhooksResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Status` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "status": "status4" -} -``` - + +# Replay Webhooks Response + +## Structure + +`ReplayWebhooksResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Status` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "status": "status4" +} +``` + diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index c768ff0b..7433700a 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -1,27 +1,27 @@ - -# Resent Invitation - -## Structure - -`ResentInvitation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `LastSentAt` | `*string` | Optional | - | -| `LastAcceptedAt` | `*string` | Optional | - | -| `SendInviteLinkText` | `*string` | Optional | - | -| `UninvitedCount` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at8", - "last_accepted_at": "last_accepted_at8", - "send_invite_link_text": "send_invite_link_text6", - "uninvited_count": 6 -} -``` - + +# Resent Invitation + +## Structure + +`ResentInvitation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `LastSentAt` | `*string` | Optional | - | +| `LastAcceptedAt` | `*string` | Optional | - | +| `SendInviteLinkText` | `*string` | Optional | - | +| `UninvitedCount` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "last_sent_at": "last_sent_at8", + "last_accepted_at": "last_accepted_at8", + "send_invite_link_text": "send_invite_link_text6", + "uninvited_count": 6 +} +``` + diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index 1490b923..d71eb927 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -1,14 +1,14 @@ - -# Resource Type - -## Enumeration - -`ResourceType` - -## Fields - -| Name | -| --- | -| `SUBSCRIPTIONS` | -| `CUSTOMERS` | - + +# Resource Type + +## Enumeration + +`ResourceType` + +## Fields + +| Name | +| --- | +| `SUBSCRIPTIONS` | +| `CUSTOMERS` | + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index 816172f6..0d932a60 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -1,14 +1,14 @@ - -# Restriction Type - -## Enumeration - -`RestrictionType` - -## Fields - -| Name | -| --- | -| `COMPONENT` | -| `PRODUCT` | - + +# Restriction Type + +## Enumeration + +`RestrictionType` + +## Fields + +| Name | +| --- | +| `COMPONENT` | +| `PRODUCT` | + diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index 799f3d35..c4157754 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -1,17 +1,17 @@ - -# Resumption Charge - -(For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled - -## Enumeration - -`ResumptionCharge` - -## Fields - -| Name | -| --- | -| `PRORATED` | -| `IMMEDIATE` | -| `DELAYED` | - + +# Resumption Charge + +(For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled + +## Enumeration + +`ResumptionCharge` + +## Fields + +| Name | +| --- | +| `PRORATED` | +| `IMMEDIATE` | +| `DELAYED` | + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index 1d063e4d..786547fe 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -1,25 +1,25 @@ - -# Revoked Invitation - -## Structure - -`RevokedInvitation` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `LastSentAt` | `*string` | Optional | - | -| `LastAcceptedAt` | `*string` | Optional | - | -| `UninvitedCount` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} -``` - + +# Revoked Invitation + +## Structure + +`RevokedInvitation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `LastSentAt` | `*string` | Optional | - | +| `LastAcceptedAt` | `*string` | Optional | - | +| `UninvitedCount` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "last_sent_at": "last_sent_at2", + "last_accepted_at": "last_accepted_at2", + "uninvited_count": 226 +} +``` + diff --git a/doc/models/sale-rep-item-mrr.md b/doc/models/sale-rep-item-mrr.md index 3a10551b..cb0c39cb 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -1,25 +1,25 @@ - -# Sale Rep Item Mrr - -## Structure - -`SaleRepItemMrr` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Mrr` | `*string` | Optional | - | -| `Usage` | `*string` | Optional | - | -| `Recurring` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} -``` - + +# Sale Rep Item Mrr + +## Structure + +`SaleRepItemMrr` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Mrr` | `*string` | Optional | - | +| `Usage` | `*string` | Optional | - | +| `Recurring` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "mrr": "mrr2", + "usage": "usage0", + "recurring": "recurring4" +} +``` + diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index 1a0d3c23..60adadc5 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -1,31 +1,31 @@ - -# Sale Rep Settings - -## Structure - -`SaleRepSettings` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CustomerName` | `*string` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `SiteLink` | `*string` | Optional | - | -| `SiteName` | `*string` | Optional | - | -| `SubscriptionMrr` | `*string` | Optional | - | -| `SalesRepId` | `*int` | Optional | - | -| `SalesRepName` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "customer_name": "customer_name8", - "subscription_id": 200, - "site_link": "site_link4", - "site_name": "site_name8", - "subscription_mrr": "subscription_mrr6" -} -``` - + +# Sale Rep Settings + +## Structure + +`SaleRepSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CustomerName` | `*string` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `SiteLink` | `*string` | Optional | - | +| `SiteName` | `*string` | Optional | - | +| `SubscriptionMrr` | `*string` | Optional | - | +| `SalesRepId` | `*int` | Optional | - | +| `SalesRepName` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "customer_name": "customer_name8", + "subscription_id": 200, + "site_link": "site_link4", + "site_name": "site_name8", + "subscription_mrr": "subscription_mrr6" +} +``` + diff --git a/doc/models/sale-rep-subscription.md b/doc/models/sale-rep-subscription.md index f79a0b10..bb29bedd 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -1,34 +1,34 @@ - -# Sale Rep Subscription - -## Structure - -`SaleRepSubscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `SiteName` | `*string` | Optional | - | -| `SubscriptionUrl` | `*string` | Optional | - | -| `CustomerName` | `*string` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `Mrr` | `*string` | Optional | - | -| `Usage` | `*string` | Optional | - | -| `Recurring` | `*string` | Optional | - | -| `LastPayment` | `*string` | Optional | - | -| `ChurnDate` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} -``` - + +# Sale Rep Subscription + +## Structure + +`SaleRepSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `SiteName` | `*string` | Optional | - | +| `SubscriptionUrl` | `*string` | Optional | - | +| `CustomerName` | `*string` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `Mrr` | `*string` | Optional | - | +| `Usage` | `*string` | Optional | - | +| `Recurring` | `*string` | Optional | - | +| `LastPayment` | `*string` | Optional | - | +| `ChurnDate` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 18, + "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 0a307eec..8c5efacb 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -1,44 +1,44 @@ - -# Sale Rep - -## Structure - -`SaleRep` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `FullName` | `*string` | Optional | - | -| `SubscriptionsCount` | `*int` | Optional | - | -| `TestMode` | `*bool` | Optional | - | -| `Subscriptions` | [`[]models.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" - } - ] -} -``` - + +# Sale Rep + +## Structure + +`SaleRep` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `FullName` | `*string` | Optional | - | +| `SubscriptionsCount` | `*int` | Optional | - | +| `TestMode` | `*bool` | Optional | - | +| `Subscriptions` | [`[]models.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" + } + ] +} +``` + diff --git a/doc/models/segment-price.md b/doc/models/segment-price.md index 07ddd7d3..b9812acc 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -1,32 +1,32 @@ - -# Segment Price - -## Structure - -`SegmentPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `StartingQuantity` | `*int` | Optional | - | -| `EndingQuantity` | `Optional[int]` | Optional | - | -| `UnitPrice` | `*string` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `FormattedUnitPrice` | `*string` | Optional | - | -| `SegmentId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} -``` - + +# Segment Price + +## Structure + +`SegmentPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `StartingQuantity` | `*int` | Optional | - | +| `EndingQuantity` | `Optional[int]` | Optional | - | +| `UnitPrice` | `*string` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `FormattedUnitPrice` | `*string` | Optional | - | +| `SegmentId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 220, + "component_id": 74, + "starting_quantity": 118, + "ending_quantity": 92, + "unit_price": "unit_price0" +} +``` + diff --git a/doc/models/segment-response.md b/doc/models/segment-response.md index c5282e59..d4d2e5cc 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -1,27 +1,27 @@ - -# Segment Response - -## Structure - -`SegmentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segment` | [`*models.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" - } -} -``` - + +# Segment Response + +## Structure + +`SegmentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segment` | [`*models.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" + } +} +``` + diff --git a/doc/models/segment.md b/doc/models/segment.md index 604b453e..1cd3c38f 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -1,36 +1,36 @@ - -# Segment - -## Structure - -`Segment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `EventBasedBillingMetricId` | `*int` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `SegmentProperty1Value` | `*interface{}` | Optional | - | -| `SegmentProperty2Value` | `*interface{}` | Optional | - | -| `SegmentProperty3Value` | `*interface{}` | Optional | - | -| `SegmentProperty4Value` | `*interface{}` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | -| `Prices` | [`[]models.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" -} -``` - + +# Segment + +## Structure + +`Segment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `EventBasedBillingMetricId` | `*int` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `SegmentProperty1Value` | `*interface{}` | Optional | - | +| `SegmentProperty2Value` | `*interface{}` | Optional | - | +| `SegmentProperty3Value` | `*interface{}` | Optional | - | +| `SegmentProperty4Value` | `*interface{}` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | +| `Prices` | [`[]models.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" +} +``` + diff --git a/doc/models/seller.md b/doc/models/seller.md index ffddd47b..341fa953 100644 --- a/doc/models/seller.md +++ b/doc/models/seller.md @@ -1,33 +1,33 @@ - -# Seller - -## Structure - -`Seller` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Address` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | -| `Phone` | `*string` | Optional | - | -| `LogoUrl` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name6", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" - }, - "phone": "phone6", - "logo_url": "logo_url4" -} -``` - + +# Seller + +## Structure + +`Seller` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Address` | [`*models.InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | +| `Phone` | `*string` | Optional | - | +| `LogoUrl` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name6", + "address": { + "street": "street6", + "line2": "line20", + "city": "city6", + "state": "state2", + "zip": "zip0" + }, + "phone": "phone6", + "logo_url": "logo_url4" +} +``` + diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index 1e7659d5..29d0e584 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -1,33 +1,33 @@ - -# Send Invoice Request - -## Structure - -`SendInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `RecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | -| `CcRecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | -| `BccRecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | - -## 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" - ] -} -``` - + +# Send Invoice Request + +## Structure + +`SendInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `RecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | +| `CcRecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | +| `BccRecipientEmails` | `[]string` | Optional | **Constraints**: *Maximum Items*: `5` | + +## 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" + ] +} +``` + diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index 1e4af594..22efe0d7 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -1,27 +1,27 @@ - -# Service Credit Response - -## Structure - -`ServiceCreditResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ServiceCredit` | [`models.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" - } -} -``` - + +# Service Credit Response + +## Structure + +`ServiceCreditResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ServiceCredit` | [`models.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" + } +} +``` + diff --git a/doc/models/service-credit-type.md b/doc/models/service-credit-type.md index e4763845..7514b30a 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -1,16 +1,16 @@ - -# Service Credit Type - -The type of entry - -## Enumeration - -`ServiceCreditType` - -## Fields - -| Name | -| --- | -| `CREDIT` | -| `DEBIT` | - + +# Service Credit Type + +The type of entry + +## Enumeration + +`ServiceCreditType` + +## Fields + +| Name | +| --- | +| `CREDIT` | +| `DEBIT` | + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index e18a6778..d8b5f110 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -1,29 +1,29 @@ - -# Service Credit - -## Structure - -`ServiceCredit` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `AmountInCents` | `*int64` | Optional | The amount in cents of the entry | -| `EndingBalanceInCents` | `*int64` | Optional | The new balance for the credit account | -| `EntryType` | [`*models.ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | -| `Memo` | `*string` | Optional | The memo attached to the entry | - -## Example (as JSON) - -```json -{ - "id": 216, - "amount_in_cents": 210, - "ending_balance_in_cents": 86, - "entry_type": "Credit", - "memo": "memo2" -} -``` - + +# Service Credit + +## Structure + +`ServiceCredit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `AmountInCents` | `*int64` | Optional | The amount in cents of the entry | +| `EndingBalanceInCents` | `*int64` | Optional | The new balance for the credit account | +| `EntryType` | [`*models.ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | +| `Memo` | `*string` | Optional | The memo attached to the entry | + +## Example (as JSON) + +```json +{ + "id": 216, + "amount_in_cents": 210, + "ending_balance_in_cents": 86, + "entry_type": "Credit", + "memo": "memo2" +} +``` + diff --git a/doc/models/shipping-address.md b/doc/models/shipping-address.md index b2497159..643994db 100644 --- a/doc/models/shipping-address.md +++ b/doc/models/shipping-address.md @@ -1,30 +1,30 @@ - -# Shipping Address - -## Structure - -`ShippingAddress` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Street` | `Optional[string]` | Optional | - | -| `Line2` | `Optional[string]` | Optional | - | -| `City` | `Optional[string]` | Optional | - | -| `State` | `Optional[string]` | Optional | - | -| `Zip` | `Optional[string]` | Optional | - | -| `Country` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state4", - "zip": "zip6" -} -``` - + +# Shipping Address + +## Structure + +`ShippingAddress` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Street` | `Optional[string]` | Optional | - | +| `Line2` | `Optional[string]` | Optional | - | +| `City` | `Optional[string]` | Optional | - | +| `State` | `Optional[string]` | Optional | - | +| `Zip` | `Optional[string]` | Optional | - | +| `Country` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "street": "street0", + "line2": "line24", + "city": "city0", + "state": "state4", + "zip": "zip6" +} +``` + diff --git a/doc/models/signup-proforma-preview-response.md b/doc/models/signup-proforma-preview-response.md index 66a7d8da..908e6215 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -1,36 +1,36 @@ - -# Signup Proforma Preview Response - -## Structure - -`SignupProformaPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProformaInvoicePreview` | [`models.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 - } - } -} -``` - + +# Signup Proforma Preview Response + +## Structure + +`SignupProformaPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProformaInvoicePreview` | [`models.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 + } + } +} +``` + diff --git a/doc/models/signup-proforma-preview.md b/doc/models/signup-proforma-preview.md index b811c7f6..eaa66cbc 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -1,35 +1,35 @@ - -# Signup Proforma Preview - -## Structure - -`SignupProformaPreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrentProformaInvoice` | [`*models.ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | -| `NextProformaInvoice` | [`*models.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 - } -} -``` - + +# Signup Proforma Preview + +## Structure + +`SignupProformaPreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrentProformaInvoice` | [`*models.ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | +| `NextProformaInvoice` | [`*models.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 + } +} +``` + diff --git a/doc/models/single-error-response-exception.md b/doc/models/single-error-response-exception.md index ce5e9aa6..14353407 100644 --- a/doc/models/single-error-response-exception.md +++ b/doc/models/single-error-response-exception.md @@ -1,21 +1,21 @@ - -# Single Error Response Exception - -## Structure - -`SingleErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Error` | `string` | Required | - | - -## Example (as JSON) - -```json -{ - "error": "error2" -} -``` - + +# Single Error Response Exception + +## Structure + +`SingleErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Error` | `string` | Required | - | + +## Example (as JSON) + +```json +{ + "error": "error2" +} +``` + diff --git a/doc/models/single-string-error-response-exception.md b/doc/models/single-string-error-response-exception.md index e0725c08..ff540311 100644 --- a/doc/models/single-string-error-response-exception.md +++ b/doc/models/single-string-error-response-exception.md @@ -1,21 +1,21 @@ - -# Single String Error Response Exception - -## Structure - -`SingleStringErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": "errors4" -} -``` - + +# Single String Error Response Exception + +## Structure + +`SingleStringErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": "errors4" +} +``` + diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 8990f320..febe5822 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -1,27 +1,27 @@ - -# Site Response - -## Structure - -`SiteResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Site` | [`models.Site`](../../doc/models/site.md) | Required | - | - -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} -``` - + +# Site Response + +## Structure + +`SiteResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Site` | [`models.Site`](../../doc/models/site.md) | Required | - | + +## Example (as JSON) + +```json +{ + "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 6c92e738..69c85528 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -1,35 +1,35 @@ - -# Site Statistics - -## Structure - -`SiteStatistics` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `TotalSubscriptions` | `*int` | Optional | - | -| `SubscriptionsToday` | `*int` | Optional | - | -| `TotalRevenue` | `*string` | Optional | - | -| `RevenueToday` | `*string` | Optional | - | -| `RevenueThisMonth` | `*string` | Optional | - | -| `RevenueThisYear` | `*string` | Optional | - | -| `TotalCanceledSubscriptions` | `*int` | Optional | - | -| `TotalActiveSubscriptions` | `*float64` | Optional | - | -| `TotalPastDueSubscriptions` | `*float64` | Optional | - | -| `TotalUnpaidSubscriptions` | `*float64` | Optional | - | -| `TotalDunningSubscriptions` | `*float64` | 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" -} -``` - + +# Site Statistics + +## Structure + +`SiteStatistics` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `TotalSubscriptions` | `*int` | Optional | - | +| `SubscriptionsToday` | `*int` | Optional | - | +| `TotalRevenue` | `*string` | Optional | - | +| `RevenueToday` | `*string` | Optional | - | +| `RevenueThisMonth` | `*string` | Optional | - | +| `RevenueThisYear` | `*string` | Optional | - | +| `TotalCanceledSubscriptions` | `*int` | Optional | - | +| `TotalActiveSubscriptions` | `*float64` | Optional | - | +| `TotalPastDueSubscriptions` | `*float64` | Optional | - | +| `TotalUnpaidSubscriptions` | `*float64` | Optional | - | +| `TotalDunningSubscriptions` | `*float64` | 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" +} +``` + diff --git a/doc/models/site-summary.md b/doc/models/site-summary.md index 29e52e9b..234a634e 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -1,35 +1,35 @@ - -# Site Summary - -## Structure - -`SiteSummary` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SellerName` | `*string` | Optional | - | -| `SiteName` | `*string` | Optional | - | -| `SiteId` | `*int` | Optional | - | -| `SiteCurrency` | `*string` | Optional | - | -| `Stats` | [`*models.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" - } -} -``` - + +# Site Summary + +## Structure + +`SiteSummary` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SellerName` | `*string` | Optional | - | +| `SiteName` | `*string` | Optional | - | +| `SiteId` | `*int` | Optional | - | +| `SiteCurrency` | `*string` | Optional | - | +| `Stats` | [`*models.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" + } +} +``` + diff --git a/doc/models/site.md b/doc/models/site.md index 9c4bee2a..4e4e439a 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -1,40 +1,40 @@ - -# Site - -## Structure - -`Site` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Subdomain` | `*string` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `SellerId` | `*int` | Optional | - | -| `NonPrimaryCurrencies` | `[]string` | Optional | - | -| `RelationshipInvoicingEnabled` | `*bool` | Optional | - | -| `CustomerHierarchyEnabled` | `*bool` | Optional | - | -| `WhopaysEnabled` | `*bool` | Optional | - | -| `WhopaysDefaultPayer` | `*string` | Optional | - | -| `AllocationSettings` | [`*models.AllocationSettings`](../../doc/models/allocation-settings.md) | Optional | - | -| `DefaultPaymentCollectionMethod` | `*string` | Optional | - | -| `OrganizationAddress` | [`*models.OrganizationAddress`](../../doc/models/organization-address.md) | Optional | - | -| `TaxConfiguration` | [`*models.TaxConfiguration`](../../doc/models/tax-configuration.md) | Optional | - | -| `NetTerms` | [`*models.NetTerms`](../../doc/models/net-terms.md) | Optional | - | -| `Test` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} -``` - + +# Site + +## Structure + +`Site` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Subdomain` | `*string` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `SellerId` | `*int` | Optional | - | +| `NonPrimaryCurrencies` | `[]string` | Optional | - | +| `RelationshipInvoicingEnabled` | `*bool` | Optional | - | +| `CustomerHierarchyEnabled` | `*bool` | Optional | - | +| `WhopaysEnabled` | `*bool` | Optional | - | +| `WhopaysDefaultPayer` | `*string` | Optional | - | +| `AllocationSettings` | [`*models.AllocationSettings`](../../doc/models/allocation-settings.md) | Optional | - | +| `DefaultPaymentCollectionMethod` | `*string` | Optional | - | +| `OrganizationAddress` | [`*models.OrganizationAddress`](../../doc/models/organization-address.md) | Optional | - | +| `TaxConfiguration` | [`*models.TaxConfiguration`](../../doc/models/tax-configuration.md) | Optional | - | +| `NetTerms` | [`*models.NetTerms`](../../doc/models/net-terms.md) | Optional | - | +| `Test` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 34, + "name": "name0", + "subdomain": "subdomain4", + "currency": "currency0", + "seller_id": 198 +} +``` + diff --git a/doc/models/sorting-direction.md b/doc/models/sorting-direction.md index 547aa444..ae2b3d62 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -1,16 +1,16 @@ - -# Sorting Direction - -Used for sorting results. - -## Enumeration - -`SortingDirection` - -## Fields - -| Name | -| --- | -| `ASC` | -| `DESC` | - + +# Sorting Direction + +Used for sorting results. + +## Enumeration + +`SortingDirection` + +## Fields + +| Name | +| --- | +| `ASC` | +| `DESC` | + diff --git a/doc/models/subscription-add-coupon-error-exception.md b/doc/models/subscription-add-coupon-error-exception.md index 0a276360..df96f1a6 100644 --- a/doc/models/subscription-add-coupon-error-exception.md +++ b/doc/models/subscription-add-coupon-error-exception.md @@ -1,38 +1,38 @@ - -# Subscription Add Coupon Error Exception - -## Structure - -`SubscriptionAddCouponErrorException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Codes` | `[]string` | Optional | - | -| `CouponCode` | `[]string` | Optional | - | -| `CouponCodes` | `[]string` | Optional | - | -| `Subscription` | `[]string` | Optional | - | - -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] -} -``` - + +# Subscription Add Coupon Error Exception + +## Structure + +`SubscriptionAddCouponErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Codes` | `[]string` | Optional | - | +| `CouponCode` | `[]string` | Optional | - | +| `CouponCodes` | `[]string` | Optional | - | +| `Subscription` | `[]string` | Optional | - | + +## Example (as JSON) + +```json +{ + "codes": [ + "codes6", + "codes7", + "codes8" + ], + "coupon_code": [ + "coupon_code8", + "coupon_code7" + ], + "coupon_codes": [ + "coupon_codes2" + ], + "subscription": [ + "subscription8" + ] +} +``` + diff --git a/doc/models/subscription-component-allocation-error-exception.md b/doc/models/subscription-component-allocation-error-exception.md index 91817c94..653df7a9 100644 --- a/doc/models/subscription-component-allocation-error-exception.md +++ b/doc/models/subscription-component-allocation-error-exception.md @@ -1,26 +1,26 @@ - -# Subscription Component Allocation Error Exception - -## Structure - -`SubscriptionComponentAllocationErrorException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`[]models.SubscriptionComponentAllocationErrorItem`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] -} -``` - + +# Subscription Component Allocation Error Exception + +## Structure + +`SubscriptionComponentAllocationErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`[]models.SubscriptionComponentAllocationErrorItem`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "kind": "kind8", + "message": "message0" + } + ] +} +``` + diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 663f70cc..8deca32e 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -1,23 +1,23 @@ - -# Subscription Component Allocation Error Item - -## Structure - -`SubscriptionComponentAllocationErrorItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Kind` | `*string` | Optional | - | -| `Message` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "kind": "kind0", - "message": "message8" -} -``` - + +# Subscription Component Allocation Error Item + +## Structure + +`SubscriptionComponentAllocationErrorItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Kind` | `*string` | Optional | - | +| `Message` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "kind": "kind0", + "message": "message8" +} +``` + diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index f6116672..610ac904 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -1,27 +1,27 @@ - -# Subscription Component Response - -## Structure - -`SubscriptionComponentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Component` | [`*models.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 - } -} -``` - + +# Subscription Component Response + +## Structure + +`SubscriptionComponentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Component` | [`*models.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 + } +} +``` + diff --git a/doc/models/subscription-component-subscription.md b/doc/models/subscription-component-subscription.md index 0cc48ade..72a98dce 100644 --- a/doc/models/subscription-component-subscription.md +++ b/doc/models/subscription-component-subscription.md @@ -1,25 +1,25 @@ - -# Subscription Component Subscription - -An optional object, will be returned if provided `include=subscription` query param. - -## Structure - -`SubscriptionComponentSubscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `State` | [`*models.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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.

See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. | -| `UpdatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "state": "paused", - "updated_at": "updated_at0" -} -``` - + +# Subscription Component Subscription + +An optional object, will be returned if provided `include=subscription` query param. + +## Structure + +`SubscriptionComponentSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `State` | [`*models.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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.

See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. | +| `UpdatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "state": "paused", + "updated_at": "updated_at0" +} +``` + diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 6a552ce4..f29f803f 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -1,55 +1,55 @@ - -# Subscription Component - -## Structure - -`SubscriptionComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Kind` | [`*models.ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | -| `UnitName` | `*string` | Optional | - | -| `Enabled` | `*bool` | Optional | (for on/off components) indicates if the component is enabled for the subscription | -| `UnitBalance` | `*int` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `AllocatedQuantity` | `*interface{}` | Optional | For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off. | -| `PricingScheme` | [`Optional[models.PricingScheme]`](../../doc/models/pricing-scheme.md) | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `ComponentHandle` | `Optional[string]` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `Recurring` | `*bool` | Optional | - | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `ArchivedAt` | `Optional[string]` | Optional | - | -| `PricePointId` | `Optional[int]` | Optional | - | -| `PricePointHandle` | `Optional[string]` | Optional | - | -| `PricePointType` | `*interface{}` | Optional | - | -| `PricePointName` | `Optional[string]` | Optional | - | -| `ProductFamilyId` | `*int` | Optional | - | -| `ProductFamilyHandle` | `*string` | Optional | - | -| `CreatedAt` | `*time.Time` | Optional | - | -| `UpdatedAt` | `*time.Time` | Optional | - | -| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | -| `Description` | `Optional[string]` | Optional | - | -| `AllowFractionalQuantities` | `*bool` | Optional | - | -| `Subscription` | [`*models.SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | -| `DisplayOnHostedPage` | `*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. | -| `IntervalUnit` | [`*models.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) - -```json -{ - "id": 20, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false -} -``` - + +# Subscription Component + +## Structure + +`SubscriptionComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Kind` | [`*models.ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | +| `UnitName` | `*string` | Optional | - | +| `Enabled` | `*bool` | Optional | (for on/off components) indicates if the component is enabled for the subscription | +| `UnitBalance` | `*int` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `AllocatedQuantity` | `*interface{}` | Optional | For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off. | +| `PricingScheme` | [`Optional[models.PricingScheme]`](../../doc/models/pricing-scheme.md) | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `ComponentHandle` | `Optional[string]` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `Recurring` | `*bool` | Optional | - | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `DowngradeCredit` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `ArchivedAt` | `Optional[string]` | Optional | - | +| `PricePointId` | `Optional[int]` | Optional | - | +| `PricePointHandle` | `Optional[string]` | Optional | - | +| `PricePointType` | `*interface{}` | Optional | - | +| `PricePointName` | `Optional[string]` | Optional | - | +| `ProductFamilyId` | `*int` | Optional | - | +| `ProductFamilyHandle` | `*string` | Optional | - | +| `CreatedAt` | `*time.Time` | Optional | - | +| `UpdatedAt` | `*time.Time` | Optional | - | +| `UseSiteExchangeRate` | `Optional[bool]` | Optional | - | +| `Description` | `Optional[string]` | Optional | - | +| `AllowFractionalQuantities` | `*bool` | Optional | - | +| `Subscription` | [`*models.SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | +| `DisplayOnHostedPage` | `*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. | +| `IntervalUnit` | [`*models.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) + +```json +{ + "id": 20, + "name": "name8", + "kind": "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 62c06018..73a3758b 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -1,54 +1,54 @@ - -# Subscription Custom Price - -(Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription - -## Structure - -`SubscriptionCustomPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | (Optional) | -| `Handle` | `*string` | Optional | (Optional) | -| `PriceInCents` | `interface{}` | Required | Required if using `custom_price` attribute. | -| `Interval` | `interface{}` | Required | Required if using `custom_price` attribute. | -| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | -| `TrialPriceInCents` | `*interface{}` | Optional | (Optional) | -| `TrialInterval` | `*interface{}` | Optional | (Optional) | -| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | -| `InitialChargeInCents` | `*interface{}` | Optional | (Optional) | -| `InitialChargeAfterTrial` | `*bool` | Optional | (Optional) | -| `ExpirationInterval` | `*interface{}` | Optional | (Optional) | -| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | -| `TaxIncluded` | `*bool` | Optional | (Optional) | - -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": { - "key1": "val1", - "key2": "val2" - }, - "interval": { - "key1": "val1", - "key2": "val2" - }, - "interval_unit": "day", - "trial_price_in_cents": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval": { - "key1": "val1", - "key2": "val2" - }, - "trial_interval_unit": "day" -} -``` - + +# Subscription Custom Price + +(Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription + +## Structure + +`SubscriptionCustomPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | (Optional) | +| `Handle` | `*string` | Optional | (Optional) | +| `PriceInCents` | `interface{}` | Required | Required if using `custom_price` attribute. | +| `Interval` | `interface{}` | Required | Required if using `custom_price` attribute. | +| `IntervalUnit` | [`models.IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | +| `TrialPriceInCents` | `*interface{}` | Optional | (Optional) | +| `TrialInterval` | `*interface{}` | Optional | (Optional) | +| `TrialIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | +| `InitialChargeInCents` | `*interface{}` | Optional | (Optional) | +| `InitialChargeAfterTrial` | `*bool` | Optional | (Optional) | +| `ExpirationInterval` | `*interface{}` | Optional | (Optional) | +| `ExpirationIntervalUnit` | [`*models.IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | +| `TaxIncluded` | `*bool` | Optional | (Optional) | + +## Example (as JSON) + +```json +{ + "name": "name4", + "handle": "handle0", + "price_in_cents": { + "key1": "val1", + "key2": "val2" + }, + "interval": { + "key1": "val1", + "key2": "val2" + }, + "interval_unit": "day", + "trial_price_in_cents": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval": { + "key1": "val1", + "key2": "val2" + }, + "trial_interval_unit": "day" +} +``` + diff --git a/doc/models/subscription-date-field.md b/doc/models/subscription-date-field.md index 2f371768..b8ef069c 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -1,21 +1,21 @@ - -# Subscription Date Field - -## Enumeration - -`SubscriptionDateField` - -## Fields - -| Name | -| --- | -| `CURRENTPERIODENDSAT` | -| `CURRENTPERIODSTARTSAT` | -| `CREATEDAT` | -| `ACTIVATEDAT` | -| `CANCELEDAT` | -| `EXPIRESAT` | -| `TRIALSTARTEDAT` | -| `TRIALENDEDAT` | -| `UPDATEDAT` | - + +# Subscription Date Field + +## Enumeration + +`SubscriptionDateField` + +## Fields + +| Name | +| --- | +| `CURRENTPERIODENDSAT` | +| `CURRENTPERIODSTARTSAT` | +| `CREATEDAT` | +| `ACTIVATEDAT` | +| `CANCELEDAT` | +| `EXPIRESAT` | +| `TRIALSTARTEDAT` | +| `TRIALENDEDAT` | +| `UPDATEDAT` | + diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index 7e29962c..daad559b 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -1,35 +1,35 @@ - -# Subscription Group Balances - -## Structure - -`SubscriptionGroupBalances` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayments` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | -| `ServiceCredits` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | -| `OpenInvoices` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | -| `PendingDiscounts` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "prepayments": { - "balance_in_cents": 192 - }, - "service_credits": { - "balance_in_cents": 84 - }, - "open_invoices": { - "balance_in_cents": 40 - }, - "pending_discounts": { - "balance_in_cents": 88 - } -} -``` - + +# Subscription Group Balances + +## Structure + +`SubscriptionGroupBalances` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayments` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | +| `ServiceCredits` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | +| `OpenInvoices` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | +| `PendingDiscounts` | [`*models.AccountBalance`](../../doc/models/account-balance.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "prepayments": { + "balance_in_cents": 192 + }, + "service_credits": { + "balance_in_cents": 84 + }, + "open_invoices": { + "balance_in_cents": 40 + }, + "pending_discounts": { + "balance_in_cents": 88 + } +} +``` + diff --git a/doc/models/subscription-group-bank-account.md b/doc/models/subscription-group-bank-account.md index e9e32c67..cd103852 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -1,42 +1,40 @@ - -# Subscription Group Bank Account - -## Structure - -`SubscriptionGroupBankAccount` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `BankName` | `*string` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `BankAccountNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | -| `BankRoutingNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `BankIban` | `*string` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `BankBranchCode` | `*string` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking
**Default**: `"checking"` | -| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | -| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | **Default**: `"credit_card"` | -| `BillingAddress` | `*string` | Optional | - | -| `BillingCity` | `*string` | Optional | - | -| `BillingState` | `*string` | Optional | - | -| `BillingZip` | `*string` | Optional | - | -| `BillingCountry` | `*string` | Optional | - | -| `ChargifyToken` | `*string` | Optional | - | -| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | -| `GatewayHandle` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "bank_account_type": "checking", - "payment_type": "credit_card", - "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" -} -``` - + +# Subscription Group Bank Account + +## Structure + +`SubscriptionGroupBankAccount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `BankName` | `*string` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | +| `BankAccountNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | +| `BankRoutingNumber` | `*string` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `BankIban` | `*string` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `BankBranchCode` | `*string` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `BankAccountType` | [`*models.BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | +| `BankAccountHolderType` | [`*models.BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | +| `PaymentType` | [`*models.PaymentType`](../../doc/models/payment-type.md) | Optional | - | +| `BillingAddress` | `*string` | Optional | - | +| `BillingCity` | `*string` | Optional | - | +| `BillingState` | `*string` | Optional | - | +| `BillingZip` | `*string` | Optional | - | +| `BillingCountry` | `*string` | Optional | - | +| `ChargifyToken` | `*string` | Optional | - | +| `CurrentVault` | [`*models.BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | +| `GatewayHandle` | `*string` | Optional | - | + +## Example (as JSON) + +```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" +} +``` + diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index 57f4de9f..e58ca5d6 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -1,64 +1,64 @@ - -# Subscription Group Component Custom Price - -Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. - -## Structure - -`SubscriptionGroupComponentCustomPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricingScheme` | [`*models.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. | -| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | -| `OveragePricing` | [`[]models.ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "overage_pricing": [ - { - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } - ] -} -``` - + +# Subscription Group Component Custom Price + +Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. + +## Structure + +`SubscriptionGroupComponentCustomPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricingScheme` | [`*models.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. | +| `Prices` | [`[]models.Price`](../../doc/models/price.md) | Optional | - | +| `OveragePricing` | [`[]models.ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "overage_pricing": [ + { + "pricing_scheme": "stairstep", + "interval": 230, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } + ] +} +``` + diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 860e87d2..f3c4b4eb 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -1,53 +1,53 @@ - -# Subscription Group Credit Card - -## Structure - -`SubscriptionGroupCreditCard` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FullNumber` | `*interface{}` | Optional | - | -| `ExpirationMonth` | `*interface{}` | Optional | - | -| `ExpirationYear` | `*interface{}` | Optional | - | -| `ChargifyToken` | `*string` | Optional | - | -| `VaultToken` | `*string` | Optional | - | -| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `GatewayHandle` | `*string` | Optional | - | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `BillingAddress` | `*string` | Optional | - | -| `BillingAddress2` | `*string` | Optional | - | -| `BillingCity` | `*string` | Optional | - | -| `BillingState` | `*string` | Optional | - | -| `BillingZip` | `*string` | Optional | - | -| `BillingCountry` | `*string` | Optional | - | -| `LastFour` | `*string` | Optional | - | -| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `CustomerVaultToken` | `*string` | Optional | - | -| `Cvv` | `*string` | Optional | - | -| `PaymentType` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "full_number": { - "key1": "val1", - "key2": "val2" - }, - "chargify_token": "tok_592nf92ng0sjd4300p", - "expiration_month": { - "key1": "val1", - "key2": "val2" - }, - "expiration_year": { - "key1": "val1", - "key2": "val2" - }, - "vault_token": "vault_token6" -} -``` - + +# Subscription Group Credit Card + +## Structure + +`SubscriptionGroupCreditCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FullNumber` | `*interface{}` | Optional | - | +| `ExpirationMonth` | `*interface{}` | Optional | - | +| `ExpirationYear` | `*interface{}` | Optional | - | +| `ChargifyToken` | `*string` | Optional | - | +| `VaultToken` | `*string` | Optional | - | +| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | +| `GatewayHandle` | `*string` | Optional | - | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `BillingAddress` | `*string` | Optional | - | +| `BillingAddress2` | `*string` | Optional | - | +| `BillingCity` | `*string` | Optional | - | +| `BillingState` | `*string` | Optional | - | +| `BillingZip` | `*string` | Optional | - | +| `BillingCountry` | `*string` | Optional | - | +| `LastFour` | `*string` | Optional | - | +| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | +| `CustomerVaultToken` | `*string` | Optional | - | +| `Cvv` | `*string` | Optional | - | +| `PaymentType` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "full_number": { + "key1": "val1", + "key2": "val2" + }, + "chargify_token": "tok_592nf92ng0sjd4300p", + "expiration_month": { + "key1": "val1", + "key2": "val2" + }, + "expiration_year": { + "key1": "val1", + "key2": "val2" + }, + "vault_token": "vault_token6" +} +``` + diff --git a/doc/models/subscription-group-customer.md b/doc/models/subscription-group-customer.md index dd6d5ded..74cf7b40 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -1,29 +1,29 @@ - -# Subscription Group Customer - -## Structure - -`SubscriptionGroupCustomer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Organization` | `*string` | Optional | - | -| `Email` | `*string` | Optional | - | -| `Reference` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} -``` - + +# Subscription Group Customer + +## Structure + +`SubscriptionGroupCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Organization` | `*string` | Optional | - | +| `Email` | `*string` | Optional | - | +| `Reference` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name4", + "last_name": "last_name2", + "organization": "organization2", + "email": "email2", + "reference": "reference0" +} +``` + diff --git a/doc/models/subscription-group-item.md b/doc/models/subscription-group-item.md index 06ab6a37..fbc6fc4f 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -1,34 +1,34 @@ - -# Subscription Group Item - -## Structure - -`SubscriptionGroupItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Reference` | `Optional[string]` | Optional | - | -| `ProductId` | `*int` | Optional | - | -| `ProductHandle` | `Optional[string]` | Optional | - | -| `ProductPricePointId` | `*int` | Optional | - | -| `ProductPricePointHandle` | `*string` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `CouponCode` | `Optional[string]` | Optional | - | -| `TotalRevenueInCents` | `*int64` | Optional | - | -| `BalanceInCents` | `*int64` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} -``` - + +# Subscription Group Item + +## Structure + +`SubscriptionGroupItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Reference` | `Optional[string]` | Optional | - | +| `ProductId` | `*int` | Optional | - | +| `ProductHandle` | `Optional[string]` | Optional | - | +| `ProductPricePointId` | `*int` | Optional | - | +| `ProductPricePointHandle` | `*string` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `CouponCode` | `Optional[string]` | Optional | - | +| `TotalRevenueInCents` | `*int64` | Optional | - | +| `BalanceInCents` | `*int64` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 16, + "reference": "reference8", + "product_id": 214, + "product_handle": "product_handle4", + "product_price_point_id": 138 +} +``` + diff --git a/doc/models/subscription-group-member-error.md b/doc/models/subscription-group-member-error.md index 0d141b30..95772b82 100644 --- a/doc/models/subscription-group-member-error.md +++ b/doc/models/subscription-group-member-error.md @@ -1,25 +1,25 @@ - -# Subscription Group Member Error - -## Structure - -`SubscriptionGroupMemberError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Type` | `*string` | Optional | - | -| `Message` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 56, - "type": "type8", - "message": "message2" -} -``` - + +# Subscription Group Member Error + +## Structure + +`SubscriptionGroupMemberError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Type` | `*string` | Optional | - | +| `Message` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 56, + "type": "type8", + "message": "message2" +} +``` + diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 6319f92c..ff4472c1 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -1,27 +1,27 @@ - -# Subscription Group Payment Profile - -## Structure - -`SubscriptionGroupPaymentProfile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `MaskedCardNumber` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} -``` - + +# Subscription Group Payment Profile + +## Structure + +`SubscriptionGroupPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `MaskedCardNumber` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 22, + "first_name": "first_name4", + "last_name": "last_name2", + "masked_card_number": "masked_card_number2" +} +``` + diff --git a/doc/models/subscription-group-prepayment-method.md b/doc/models/subscription-group-prepayment-method.md index f73ef8ad..1b69b44d 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -1,18 +1,18 @@ - -# Subscription Group Prepayment Method - -## Enumeration - -`SubscriptionGroupPrepaymentMethod` - -## Fields - -| Name | -| --- | -| `CHECK` | -| `CASH` | -| `MONEYORDER` | -| `ACH` | -| `PAYPALACCOUNT` | -| `OTHER` | - + +# Subscription Group Prepayment Method + +## Enumeration + +`SubscriptionGroupPrepaymentMethod` + +## Fields + +| Name | +| --- | +| `CHECK` | +| `CASH` | +| `MONEYORDER` | +| `ACH` | +| `PAYPALACCOUNT` | +| `OTHER` | + diff --git a/doc/models/subscription-group-prepayment-request.md b/doc/models/subscription-group-prepayment-request.md index fdafe4ad..0ef8e4b9 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -1,26 +1,26 @@ - -# Subscription Group Prepayment Request - -## Structure - -`SubscriptionGroupPrepaymentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Prepayment` | [`models.SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} -``` - + +# Subscription Group Prepayment Request + +## Structure + +`SubscriptionGroupPrepaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Prepayment` | [`models.SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "prepayment": { + "amount": 136, + "details": "details8", + "memo": "memo2", + "method": "paypal_account" + } +} +``` + diff --git a/doc/models/subscription-group-prepayment-response.md b/doc/models/subscription-group-prepayment-response.md index 53c5aa4b..817df979 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -1,29 +1,29 @@ - -# Subscription Group Prepayment Response - -## Structure - -`SubscriptionGroupPrepaymentResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `AmountInCents` | `*int64` | Optional | The amount in cents of the entry. | -| `EndingBalanceInCents` | `*int64` | Optional | The ending balance in cents of the account. | -| `EntryType` | [`*models.ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | -| `Memo` | `*string` | Optional | A memo attached to the entry. | - -## Example (as JSON) - -```json -{ - "id": 110, - "amount_in_cents": 196, - "ending_balance_in_cents": 236, - "entry_type": "Credit", - "memo": "memo2" -} -``` - + +# Subscription Group Prepayment Response + +## Structure + +`SubscriptionGroupPrepaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `AmountInCents` | `*int64` | Optional | The amount in cents of the entry. | +| `EndingBalanceInCents` | `*int64` | Optional | The ending balance in cents of the account. | +| `EntryType` | [`*models.ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | +| `Memo` | `*string` | Optional | A memo attached to the entry. | + +## Example (as JSON) + +```json +{ + "id": 110, + "amount_in_cents": 196, + "ending_balance_in_cents": 236, + "entry_type": "Credit", + "memo": "memo2" +} +``` + diff --git a/doc/models/subscription-group-prepayment.md b/doc/models/subscription-group-prepayment.md index 5b7e3563..3db444e2 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -1,27 +1,27 @@ - -# Subscription Group Prepayment - -## Structure - -`SubscriptionGroupPrepayment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Amount` | `int` | Required | - | -| `Details` | `string` | Required | - | -| `Memo` | `string` | Required | - | -| `Method` | [`models.SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | - -## Example (as JSON) - -```json -{ - "amount": 96, - "details": "details2", - "memo": "memo6", - "method": "money_order" -} -``` - + +# Subscription Group Prepayment + +## Structure + +`SubscriptionGroupPrepayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Amount` | `int` | Required | - | +| `Details` | `string` | Required | - | +| `Memo` | `string` | Required | - | +| `Method` | [`models.SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | + +## Example (as JSON) + +```json +{ + "amount": 96, + "details": "details2", + "memo": "memo6", + "method": "money_order" +} +``` + diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index b3a8f4d4..d7c9146c 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -1,35 +1,35 @@ - -# Subscription Group Response - -## Structure - -`SubscriptionGroupResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionGroup` | [`models.SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "customer_id": 220, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "payment_collection_method8", - "subscription_ids": [ - 74, - 75 - ], - "created_at": "created_at4" - } -} -``` - + +# Subscription Group Response + +## Structure + +`SubscriptionGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionGroup` | [`models.SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription_group": { + "customer_id": 220, + "payment_profile": { + "id": 44, + "first_name": "first_name4", + "last_name": "last_name2", + "masked_card_number": "masked_card_number2" + }, + "payment_collection_method": "payment_collection_method8", + "subscription_ids": [ + 74, + 75 + ], + "created_at": "created_at4" + } +} +``` + diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index bc952d4e..f513fa14 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -1,138 +1,138 @@ - -# Subscription Group Signup Component - -## Structure - -`SubscriptionGroupSignupComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*interface{}` | Optional | Required if passing any component to `components` attribute. | -| `AllocatedQuantity` | `*interface{}` | Optional | - | -| `UnitBalance` | `*interface{}` | Optional | - | -| `PricePointId` | `*interface{}` | Optional | - | -| `CustomPrice` | [`*models.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) - -```json -{ - "component_id": { - "key1": "val1", - "key2": "val2" - }, - "allocated_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_balance": { - "key1": "val1", - "key2": "val2" - }, - "price_point_id": { - "key1": "val1", - "key2": "val2" - }, - "custom_price": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ], - "overage_pricing": [ - { - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - }, - { - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - }, - { - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } - ] - } -} -``` - + +# Subscription Group Signup Component + +## Structure + +`SubscriptionGroupSignupComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*interface{}` | Optional | Required if passing any component to `components` attribute. | +| `AllocatedQuantity` | `*interface{}` | Optional | - | +| `UnitBalance` | `*interface{}` | Optional | - | +| `PricePointId` | `*interface{}` | Optional | - | +| `CustomPrice` | [`*models.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) + +```json +{ + "component_id": { + "key1": "val1", + "key2": "val2" + }, + "allocated_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_balance": { + "key1": "val1", + "key2": "val2" + }, + "price_point_id": { + "key1": "val1", + "key2": "val2" + }, + "custom_price": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ], + "overage_pricing": [ + { + "pricing_scheme": "stairstep", + "interval": 230, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + }, + { + "pricing_scheme": "stairstep", + "interval": 230, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + }, + { + "pricing_scheme": "stairstep", + "interval": 230, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } + ] + } +} +``` + diff --git a/doc/models/subscription-group-signup-error-response-exception.md b/doc/models/subscription-group-signup-error-response-exception.md index 747a30cf..8b539db2 100644 --- a/doc/models/subscription-group-signup-error-response-exception.md +++ b/doc/models/subscription-group-signup-error-response-exception.md @@ -1,58 +1,58 @@ - -# Subscription Group Signup Error Response Exception - -## Structure - -`SubscriptionGroupSignupErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`models.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": [ - "must be among the Products for this Site" - ], - "product_price_point_id": [ - "Product price point must belong to product." - ], - "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" - } -} -``` - + +# Subscription Group Signup Error Response Exception + +## Structure + +`SubscriptionGroupSignupErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`models.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": [ + "must be among the Products for this Site" + ], + "product_price_point_id": [ + "Product price point must belong to product." + ], + "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" + } +} +``` + diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index a6524086..bcde02ac 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -1,74 +1,74 @@ - -# Subscription Group Signup Error - -## Structure - -`SubscriptionGroupSignupError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscriptions` | [`map[string]models.SubscriptionGroupSubscriptionError`](../../doc/models/subscription-group-subscription-error.md) | Optional | Object that as key have subscription position in request subscriptions array and as value subscription errors object. | -| `PayerReference` | `*string` | Optional | - | -| `Payer` | [`*models.PayerError`](../../doc/models/payer-error.md) | Optional | - | -| `SubscriptionGroup` | `[]string` | Optional | - | -| `PaymentProfileId` | `*string` | Optional | - | -| `PayerId` | `*string` | Optional | - | - -## Example (as JSON) - -```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" - ] - }, - "key1": { - "product": [ - "product9" - ], - "product_price_point_id": [ - "product_price_point_id7" - ], - "payment_profile": [ - "payment_profile2" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" - ] - } - }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" - ], - "payment_profile_id": "payment_profile_id2" -} -``` - + +# Subscription Group Signup Error + +## Structure + +`SubscriptionGroupSignupError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscriptions` | [`map[string]models.SubscriptionGroupSubscriptionError`](../../doc/models/subscription-group-subscription-error.md) | Optional | Object that as key have subscription position in request subscriptions array and as value subscription errors object. | +| `PayerReference` | `*string` | Optional | - | +| `Payer` | [`*models.PayerError`](../../doc/models/payer-error.md) | Optional | - | +| `SubscriptionGroup` | `[]string` | Optional | - | +| `PaymentProfileId` | `*string` | Optional | - | +| `PayerId` | `*string` | Optional | - | + +## Example (as JSON) + +```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" + ] + }, + "key1": { + "product": [ + "product9" + ], + "product_price_point_id": [ + "product_price_point_id7" + ], + "payment_profile": [ + "payment_profile2" + ], + "payment_profile.chargify_token": [ + "payment_profile.chargify_token6" + ] + } + }, + "payer_reference": "payer_reference0", + "payer": { + "last_name": [ + "last_name5", + "last_name6" + ], + "first_name": [ + "first_name8" + ], + "email": [ + "email0", + "email9" + ] + }, + "subscription_group": [ + "subscription_group1", + "subscription_group2" + ], + "payment_profile_id": "payment_profile_id2" +} +``` + diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 8c2b71a0..13f32d0d 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -1,41 +1,41 @@ - -# Subscription Group Signup Item - -## Structure - -`SubscriptionGroupSignupItem` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductHandle` | `*string` | Optional | The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. | -| `ProductId` | `*int` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | -| `ProductPricePointId` | `*int` | Optional | The ID of the particular price point on the product. | -| `ProductPricePointHandle` | `*string` | Optional | The user-friendly API handle of a product's particular price point. | -| `OfferId` | `*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` | `*string` | Optional | The reference value (provided by your app) for the subscription itelf. | -| `Primary` | `*bool` | Optional | One of the subscriptions must be marked as primary in the group. | -| `Currency` | `*string` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | -| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | -| `Components` | [`[]models.SubscriptionGroupSignupComponent`](../../doc/models/subscription-group-signup-component.md) | Optional | - | -| `CustomPrice` | [`*models.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 | -| `CalendarBilling` | [`*models.CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | -| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | - -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle2", - "product_id": 34, - "product_price_point_id": 214, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 150 -} -``` - + +# Subscription Group Signup Item + +## Structure + +`SubscriptionGroupSignupItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductHandle` | `*string` | Optional | The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. | +| `ProductId` | `*int` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | +| `ProductPricePointId` | `*int` | Optional | The ID of the particular price point on the product. | +| `ProductPricePointHandle` | `*string` | Optional | The user-friendly API handle of a product's particular price point. | +| `OfferId` | `*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` | `*string` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `Primary` | `*bool` | Optional | One of the subscriptions must be marked as primary in the group. | +| `Currency` | `*string` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | +| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | +| `Components` | [`[]models.SubscriptionGroupSignupComponent`](../../doc/models/subscription-group-signup-component.md) | Optional | - | +| `CustomPrice` | [`*models.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 | +| `CalendarBilling` | [`*models.CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `Metafields` | `map[string]string` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | + +## Example (as JSON) + +```json +{ + "metafields": { + "custom_field_name_1": "custom_field_value_1", + "custom_field_name_2": "custom_field_value_2" + }, + "product_handle": "product_handle2", + "product_id": 34, + "product_price_point_id": 214, + "product_price_point_handle": "product_price_point_handle4", + "offer_id": 150 +} +``` + diff --git a/doc/models/subscription-group-signup-request.md b/doc/models/subscription-group-signup-request.md index c0001241..4ae33be5 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -1,46 +1,46 @@ - -# Subscription Group Signup Request - -## Structure - -`SubscriptionGroupSignupRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionGroup` | [`models.SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "payment_collection_method": "automatic", - "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", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - } -} -``` - + +# Subscription Group Signup Request + +## Structure + +`SubscriptionGroupSignupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionGroup` | [`models.SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription_group": { + "payment_collection_method": "automatic", + "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", + "payer_attributes": { + "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 750a0730..9aac7b40 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -1,40 +1,40 @@ - -# Subscription Group Signup Response - -## Structure - -`SubscriptionGroupSignupResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Uid` | `*string` | Optional | - | -| `Scheme` | `*int` | Optional | - | -| `CustomerId` | `*int` | Optional | - | -| `PaymentProfileId` | `*int` | Optional | - | -| `SubscriptionIds` | `[]int` | Optional | - | -| `PrimarySubscriptionId` | `*int` | Optional | - | -| `NextAssessmentAt` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `CancelAtEndOfPeriod` | `*bool` | Optional | - | -| `Subscriptions` | [`[]models.SubscriptionGroupItem`](../../doc/models/subscription-group-item.md) | Optional | - | -| `PaymentCollectionMethod` | [`*models.PaymentCollectionMethod`](../../doc/models/payment-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`.
**Default**: `"automatic"` | - -## Example (as JSON) - -```json -{ - "payment_collection_method": "automatic", - "uid": "uid8", - "scheme": 28, - "customer_id": 48, - "payment_profile_id": 44, - "subscription_ids": [ - 158, - 159, - 160 - ] -} -``` - + +# Subscription Group Signup Response + +## Structure + +`SubscriptionGroupSignupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Uid` | `*string` | Optional | - | +| `Scheme` | `*int` | Optional | - | +| `CustomerId` | `*int` | Optional | - | +| `PaymentProfileId` | `*int` | Optional | - | +| `SubscriptionIds` | `[]int` | Optional | - | +| `PrimarySubscriptionId` | `*int` | Optional | - | +| `NextAssessmentAt` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `CancelAtEndOfPeriod` | `*bool` | Optional | - | +| `Subscriptions` | [`[]models.SubscriptionGroupItem`](../../doc/models/subscription-group-item.md) | Optional | - | +| `PaymentCollectionMethod` | [`*models.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`.
**Default**: `"automatic"` | + +## Example (as JSON) + +```json +{ + "payment_collection_method": "automatic", + "uid": "uid8", + "scheme": 28, + "customer_id": 48, + "payment_profile_id": 44, + "subscription_ids": [ + 158, + 159, + 160 + ] +} +``` + diff --git a/doc/models/subscription-group-signup.md b/doc/models/subscription-group-signup.md index b7fe94a1..ff4ddee1 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -1,51 +1,51 @@ - -# Subscription Group Signup - -## Structure - -`SubscriptionGroupSignup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfileId` | `*int` | Optional | - | -| `PayerId` | `*int` | Optional | - | -| `PayerReference` | `*string` | Optional | - | -| `PaymentCollectionMethod` | [`*models.PaymentCollectionMethod`](../../doc/models/payment-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`.
**Default**: `"automatic"` | -| `PayerAttributes` | [`*models.PayerAttributes`](../../doc/models/payer-attributes.md) | Optional | - | -| `CreditCardAttributes` | [`*models.SubscriptionGroupCreditCard`](../../doc/models/subscription-group-credit-card.md) | Optional | - | -| `BankAccountAttributes` | [`*models.SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | -| `Subscriptions` | [`[]models.SubscriptionGroupSignupItem`](../../doc/models/subscription-group-signup-item.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_collection_method": "automatic", - "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", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} -``` - + +# Subscription Group Signup + +## Structure + +`SubscriptionGroupSignup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfileId` | `*int` | Optional | - | +| `PayerId` | `*int` | Optional | - | +| `PayerReference` | `*string` | Optional | - | +| `PaymentCollectionMethod` | [`*models.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`.
**Default**: `"automatic"` | +| `PayerAttributes` | [`*models.PayerAttributes`](../../doc/models/payer-attributes.md) | Optional | - | +| `CreditCardAttributes` | [`*models.SubscriptionGroupCreditCard`](../../doc/models/subscription-group-credit-card.md) | Optional | - | +| `BankAccountAttributes` | [`*models.SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | +| `Subscriptions` | [`[]models.SubscriptionGroupSignupItem`](../../doc/models/subscription-group-signup-item.md) | Required | - | + +## Example (as JSON) + +```json +{ + "payment_collection_method": "automatic", + "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", + "payer_attributes": { + "first_name": "first_name2", + "last_name": "last_name0", + "email": "email4", + "cc_emails": "cc_emails2", + "organization": "organization6" + } +} +``` + diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index 793f43af..90c4acec 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -1,41 +1,41 @@ - -# Subscription Group Subscription Error - -Object which contains subscription errors. - -## Structure - -`SubscriptionGroupSubscriptionError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Product` | `[]string` | Optional | - | -| `ProductPricePointId` | `[]string` | Optional | - | -| `PaymentProfile` | `[]string` | Optional | - | -| `PaymentProfileChargifyToken` | `[]string` | 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" - ] -} -``` - + +# Subscription Group Subscription Error + +Object which contains subscription errors. + +## Structure + +`SubscriptionGroupSubscriptionError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Product` | `[]string` | Optional | - | +| `ProductPricePointId` | `[]string` | Optional | - | +| `PaymentProfile` | `[]string` | Optional | - | +| `PaymentProfileChargifyToken` | `[]string` | 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" + ] +} +``` + diff --git a/doc/models/subscription-group-update-error-response-exception.md b/doc/models/subscription-group-update-error-response-exception.md index 9b363907..e444f337 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -1,34 +1,34 @@ - -# Subscription Group Update Error Response Exception - -## Structure - -`SubscriptionGroupUpdateErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`*models.SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } - ] - } -} -``` - + +# Subscription Group Update Error Response Exception + +## Structure + +`SubscriptionGroupUpdateErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`*models.SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": { + "members": [ + { + "id": 204, + "type": "type2", + "message": "message8" + }, + { + "id": 204, + "type": "type2", + "message": "message8" + } + ] + } +} +``` + diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 9948c0b8..6eee1c11 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -1,37 +1,37 @@ - -# Subscription Group Update Error - -## Structure - -`SubscriptionGroupUpdateError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Members` | [`[]models.SubscriptionGroupMemberError`](../../doc/models/subscription-group-member-error.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } - ] -} -``` - + +# Subscription Group Update Error + +## Structure + +`SubscriptionGroupUpdateError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Members` | [`[]models.SubscriptionGroupMemberError`](../../doc/models/subscription-group-member-error.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "members": [ + { + "id": 204, + "type": "type2", + "message": "message8" + }, + { + "id": 204, + "type": "type2", + "message": "message8" + }, + { + "id": 204, + "type": "type2", + "message": "message8" + } + ] +} +``` + diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index bcdb665d..ae9afe17 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -1,38 +1,38 @@ - -# Subscription Group - -## Structure - -`SubscriptionGroup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CustomerId` | `*int` | Optional | - | -| `PaymentProfile` | [`*models.SubscriptionGroupPaymentProfile`](../../doc/models/subscription-group-payment-profile.md) | Optional | - | -| `PaymentCollectionMethod` | `*string` | Optional | - | -| `SubscriptionIds` | `[]int` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "customer_id": 36, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "payment_collection_method8", - "subscription_ids": [ - 146, - 147, - 148 - ], - "created_at": "created_at2" -} -``` - + +# Subscription Group + +## Structure + +`SubscriptionGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CustomerId` | `*int` | Optional | - | +| `PaymentProfile` | [`*models.SubscriptionGroupPaymentProfile`](../../doc/models/subscription-group-payment-profile.md) | Optional | - | +| `PaymentCollectionMethod` | `*string` | Optional | - | +| `SubscriptionIds` | `[]int` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "customer_id": 36, + "payment_profile": { + "id": 44, + "first_name": "first_name4", + "last_name": "last_name2", + "masked_card_number": "masked_card_number2" + }, + "payment_collection_method": "payment_collection_method8", + "subscription_ids": [ + 146, + 147, + 148 + ], + "created_at": "created_at2" +} +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index 315773bc..a7e279e6 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -1,14 +1,14 @@ - -# Subscription Include - -## Enumeration - -`SubscriptionInclude` - -## Fields - -| Name | -| --- | -| `COUPONS` | -| `SELFSERVICEPAGETOKEN` | - + +# Subscription Include + +## Enumeration + +`SubscriptionInclude` + +## Fields + +| Name | +| --- | +| `COUPONS` | +| `SELFSERVICEPAGETOKEN` | + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index bdffa0a4..f9f707c0 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -1,33 +1,33 @@ - -# Subscription Included Coupon - -## Structure - -`SubscriptionIncludedCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Code` | `*string` | Optional | - | -| `UseCount` | `*int` | Optional | - | -| `UsesAllowed` | `*int` | Optional | - | -| `ExpiresAt` | `Optional[string]` | Optional | - | -| `Recurring` | `*bool` | Optional | - | -| `AmountInCents` | `Optional[int64]` | Optional | **Constraints**: `>= 0` | -| `Percentage` | `Optional[string]` | Optional | - | - -## Example (as JSON) - -```json -{ - "code": "\"ABCD_10\"", - "use_count": 2, - "uses_allowed": 10, - "expires_at": "\"2023-07-13T05:18:58-04:00\"", - "amount_in_cents": 1000, - "percentage": "\"15.0\"", - "recurring": false -} -``` - + +# Subscription Included Coupon + +## Structure + +`SubscriptionIncludedCoupon` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Code` | `*string` | Optional | - | +| `UseCount` | `*int` | Optional | - | +| `UsesAllowed` | `*int` | Optional | - | +| `ExpiresAt` | `Optional[string]` | Optional | - | +| `Recurring` | `*bool` | Optional | - | +| `AmountInCents` | `Optional[int64]` | Optional | **Constraints**: `>= 0` | +| `Percentage` | `Optional[string]` | Optional | - | + +## Example (as JSON) + +```json +{ + "code": "\"ABCD_10\"", + "use_count": 2, + "uses_allowed": 10, + "expires_at": "\"2023-07-13T05:18:58-04:00\"", + "amount_in_cents": 1000, + "percentage": "\"15.0\"", + "recurring": false +} +``` + diff --git a/doc/models/subscription-list-date-field.md b/doc/models/subscription-list-date-field.md index f0fd1fd4..55871a56 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -1,19 +1,19 @@ - -# Subscription List Date Field - -## Enumeration - -`SubscriptionListDateField` - -## Fields - -| Name | -| --- | -| `UPDATEDAT` | - -## Example - -``` -updated_at -``` - + +# Subscription List Date Field + +## Enumeration + +`SubscriptionListDateField` + +## Fields + +| Name | +| --- | +| `UPDATEDAT` | + +## Example + +``` +updated_at +``` + diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index daf30abf..25757cdf 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -1,13 +1,13 @@ - -# Subscription List Include - -## Enumeration - -`SubscriptionListInclude` - -## Fields - -| Name | -| --- | -| `SELFSERVICEPAGETOKEN` | - + +# Subscription List Include + +## Enumeration + +`SubscriptionListInclude` + +## Fields + +| Name | +| --- | +| `SELFSERVICEPAGETOKEN` | + diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 0bc7fdff..79785cd7 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -1,35 +1,35 @@ - -# Subscription Migration Preview Options - -## Structure - -`SubscriptionMigrationPreviewOptions` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductId` | `*int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | -| `ProductPricePointId` | `*int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `IncludeTrial` | `*bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | -| `IncludeInitialCharge` | `*bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | -| `IncludeCoupons` | `*bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | -| `PreservePeriod` | `*bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | -| `ProductHandle` | `*string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | -| `ProductPricePointHandle` | `*string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `Proration` | [`*models.Proration`](../../doc/models/proration.md) | Optional | - | -| `ProrationDate` | `*string` | 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 -} -``` - + +# Subscription Migration Preview Options + +## Structure + +`SubscriptionMigrationPreviewOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductId` | `*int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | +| `ProductPricePointId` | `*int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | +| `IncludeTrial` | `*bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | +| `IncludeInitialCharge` | `*bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | +| `IncludeCoupons` | `*bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | +| `PreservePeriod` | `*bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | +| `ProductHandle` | `*string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | +| `ProductPricePointHandle` | `*string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | +| `Proration` | [`*models.Proration`](../../doc/models/proration.md) | Optional | - | +| `ProrationDate` | `*string` | 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 +} +``` + diff --git a/doc/models/subscription-migration-preview-request.md b/doc/models/subscription-migration-preview-request.md index d0cec4ed..f69be8ac 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -1,28 +1,28 @@ - -# Subscription Migration Preview Request - -## Structure - -`SubscriptionMigrationPreviewRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Migration` | [`models.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 - } -} -``` - + +# Subscription Migration Preview Request + +## Structure + +`SubscriptionMigrationPreviewRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Migration` | [`models.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 + } +} +``` + diff --git a/doc/models/subscription-migration-preview-response.md b/doc/models/subscription-migration-preview-response.md index ea626204..520b5b34 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -1,26 +1,26 @@ - -# Subscription Migration Preview Response - -## Structure - -`SubscriptionMigrationPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Migration` | [`models.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 - } -} -``` - + +# Subscription Migration Preview Response + +## Structure + +`SubscriptionMigrationPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Migration` | [`models.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 + } +} +``` + diff --git a/doc/models/subscription-migration-preview.md b/doc/models/subscription-migration-preview.md index 291ff191..1569bd3e 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -1,27 +1,27 @@ - -# Subscription Migration Preview - -## Structure - -`SubscriptionMigrationPreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProratedAdjustmentInCents` | `*int64` | Optional | The amount of the prorated adjustment that would be issued for the current subscription. | -| `ChargeInCents` | `*int64` | Optional | The amount of the charge that would be created for the new product. | -| `PaymentDueInCents` | `*int64` | Optional | The amount of the payment due in the case of an upgrade. | -| `CreditAppliedInCents` | `*int64` | 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 -} -``` - + +# Subscription Migration Preview + +## Structure + +`SubscriptionMigrationPreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProratedAdjustmentInCents` | `*int64` | Optional | The amount of the prorated adjustment that would be issued for the current subscription. | +| `ChargeInCents` | `*int64` | Optional | The amount of the charge that would be created for the new product. | +| `PaymentDueInCents` | `*int64` | Optional | The amount of the payment due in the case of an upgrade. | +| `CreditAppliedInCents` | `*int64` | 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 +} +``` + diff --git a/doc/models/subscription-mrr-breakout.md b/doc/models/subscription-mrr-breakout.md index 5203d68a..7f827df7 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -1,23 +1,23 @@ - -# Subscription MRR Breakout - -## Structure - -`SubscriptionMRRBreakout` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PlanAmountInCents` | `int64` | Required | - | -| `UsageAmountInCents` | `int64` | Required | - | - -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} -``` - + +# Subscription MRR Breakout + +## Structure + +`SubscriptionMRRBreakout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PlanAmountInCents` | `int64` | Required | - | +| `UsageAmountInCents` | `int64` | Required | - | + +## Example (as JSON) + +```json +{ + "plan_amount_in_cents": 208, + "usage_amount_in_cents": 60 +} +``` + diff --git a/doc/models/subscription-mrr-response.md b/doc/models/subscription-mrr-response.md index 73d76352..679bfca7 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -1,30 +1,30 @@ - -# Subscription MRR Response - -## Structure - -`SubscriptionMRRResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionsMrr` | [`[]models.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 - } - } - ] -} -``` - + +# Subscription MRR Response + +## Structure + +`SubscriptionMRRResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionsMrr` | [`[]models.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 + } + } + ] +} +``` + diff --git a/doc/models/subscription-mrr.md b/doc/models/subscription-mrr.md index 4ae4f9cd..34659211 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -1,28 +1,28 @@ - -# Subscription MRR - -## Structure - -`SubscriptionMRR` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionId` | `int` | Required | - | -| `MrrAmountInCents` | `int64` | Required | - | -| `Breakouts` | [`*models.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 - } -} -``` - + +# Subscription MRR + +## Structure + +`SubscriptionMRR` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionId` | `int` | Required | - | +| `MrrAmountInCents` | `int64` | Required | - | +| `Breakouts` | [`*models.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 + } +} +``` + diff --git a/doc/models/subscription-note-response.md b/doc/models/subscription-note-response.md index 176b7305..6537f2b3 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -1,27 +1,27 @@ - -# Subscription Note Response - -## Structure - -`SubscriptionNoteResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Note` | [`models.SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | - -## Example (as JSON) - -```json -{ - "note": { - "id": 28, - "body": "body0", - "subscription_id": 138, - "created_at": "created_at2", - "updated_at": "updated_at0" - } -} -``` - + +# Subscription Note Response + +## Structure + +`SubscriptionNoteResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Note` | [`models.SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | + +## Example (as JSON) + +```json +{ + "note": { + "id": 28, + "body": "body0", + "subscription_id": 138, + "created_at": "created_at2", + "updated_at": "updated_at0" + } +} +``` + diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index b320aefb..a8afba7a 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -1,30 +1,30 @@ - -# Subscription Note - -## Structure - -`SubscriptionNote` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `Body` | `*string` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | -| `CreatedAt` | `*string` | Optional | - | -| `UpdatedAt` | `*string` | Optional | - | -| `Sticky` | `*bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 36, - "body": "body4", - "subscription_id": 146, - "created_at": "created_at6", - "updated_at": "updated_at4" -} -``` - + +# Subscription Note + +## Structure + +`SubscriptionNote` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `Body` | `*string` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | +| `CreatedAt` | `*string` | Optional | - | +| `UpdatedAt` | `*string` | Optional | - | +| `Sticky` | `*bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 36, + "body": "body4", + "subscription_id": 146, + "created_at": "created_at6", + "updated_at": "updated_at4" +} +``` + diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index 3006e36f..95ba9e22 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -1,66 +1,66 @@ - -# Subscription Preview Response - -## Structure - -`SubscriptionPreviewResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionPreview` | [`models.SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | - -## Example (as JSON) - -```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 - } - } -} -``` - + +# Subscription Preview Response + +## Structure + +`SubscriptionPreviewResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionPreview` | [`models.SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | + +## Example (as JSON) + +```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 + } + } +} +``` + diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index b3db99be..c3853731 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -1,65 +1,65 @@ - -# Subscription Preview - -## Structure - -`SubscriptionPreview` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrentBillingManifest` | [`*models.BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | -| `NextBillingManifest` | [`*models.BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | - -## Example (as JSON) - -```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 - } -} -``` - + +# Subscription Preview + +## Structure + +`SubscriptionPreview` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrentBillingManifest` | [`*models.BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | +| `NextBillingManifest` | [`*models.BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | + +## Example (as JSON) + +```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 + } +} +``` + diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 3faa943d..2c28b9e5 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -1,28 +1,28 @@ - -# Subscription Product Migration Request - -## Structure - -`SubscriptionProductMigrationRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Migration` | [`models.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 - } -} -``` - + +# Subscription Product Migration Request + +## Structure + +`SubscriptionProductMigrationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Migration` | [`models.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 + } +} +``` + diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index d10e6e89..589583cc 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -1,34 +1,34 @@ - -# Subscription Product Migration - -## Structure - -`SubscriptionProductMigration` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ProductId` | `*int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | -| `ProductPricePointId` | `*int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `IncludeTrial` | `*bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | -| `IncludeInitialCharge` | `*bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | -| `IncludeCoupons` | `*bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | -| `PreservePeriod` | `*bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | -| `ProductHandle` | `*string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | -| `ProductPricePointHandle` | `*string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `Proration` | [`*models.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 -} -``` - + +# Subscription Product Migration + +## Structure + +`SubscriptionProductMigration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ProductId` | `*int` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | +| `ProductPricePointId` | `*int` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | +| `IncludeTrial` | `*bool` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | +| `IncludeInitialCharge` | `*bool` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | +| `IncludeCoupons` | `*bool` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | +| `PreservePeriod` | `*bool` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | +| `ProductHandle` | `*string` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | +| `ProductPricePointHandle` | `*string` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | +| `Proration` | [`*models.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 +} +``` + diff --git a/doc/models/subscription-purge-type.md b/doc/models/subscription-purge-type.md index 4a13c0d2..306b9be3 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -1,14 +1,14 @@ - -# Subscription Purge Type - -## Enumeration - -`SubscriptionPurgeType` - -## Fields - -| Name | -| --- | -| `CUSTOMER` | -| `PAYMENTPROFILE` | - + +# Subscription Purge Type + +## Enumeration + +`SubscriptionPurgeType` + +## Fields + +| Name | +| --- | +| `CUSTOMER` | +| `PAYMENTPROFILE` | + diff --git a/doc/models/subscription-remove-coupon-errors-exception.md b/doc/models/subscription-remove-coupon-errors-exception.md index 797e1246..86d5906c 100644 --- a/doc/models/subscription-remove-coupon-errors-exception.md +++ b/doc/models/subscription-remove-coupon-errors-exception.md @@ -1,23 +1,23 @@ - -# Subscription Remove Coupon Errors Exception - -## Structure - -`SubscriptionRemoveCouponErrorsException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | `[]string` | Required | - | - -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] -} -``` - + +# Subscription Remove Coupon Errors Exception + +## Structure + +`SubscriptionRemoveCouponErrorsException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | `[]string` | Required | - | + +## Example (as JSON) + +```json +{ + "subscription": [ + "subscription0" + ] +} +``` + diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index 17cb2159..44ec696b 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -1,27 +1,27 @@ - -# Subscription Response - -## Structure - -`SubscriptionResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`*models.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 - } -} -``` - + +# Subscription Response + +## Structure + +`SubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`*models.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 + } +} +``` + diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index 140193b7..bcfb745d 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -1,18 +1,18 @@ - -# Subscription Sort - -## Enumeration - -`SubscriptionSort` - -## Fields - -| Name | -| --- | -| `SIGNUPDATE` | -| `PERIODSTART` | -| `PERIODEND` | -| `NEXTASSESSMENT` | -| `UPDATEDAT` | -| `CREATEDAT` | - + +# Subscription Sort + +## Enumeration + +`SubscriptionSort` + +## Fields + +| Name | +| --- | +| `SIGNUPDATE` | +| `PERIODSTART` | +| `PERIODEND` | +| `NEXTASSESSMENT` | +| `UPDATEDAT` | +| `CREATEDAT` | + diff --git a/doc/models/subscription-state-filter.md b/doc/models/subscription-state-filter.md index 37f4263f..fd5f2a90 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -1,26 +1,26 @@ - -# Subscription State Filter - -Allowed values for filtering by the current state of the subscription. - -## Enumeration - -`SubscriptionStateFilter` - -## Fields - -| Name | -| --- | -| `ACTIVE` | -| `CANCELED` | -| `EXPIRED` | -| `EXPIREDCARDS` | -| `ONHOLD` | -| `PASTDUE` | -| `PENDINGCANCELLATION` | -| `PENDINGRENEWAL` | -| `SUSPENDED` | -| `TRIALENDED` | -| `TRIALING` | -| `UNPAID` | - + +# Subscription State Filter + +Allowed values for filtering by the current state of the subscription. + +## Enumeration + +`SubscriptionStateFilter` + +## Fields + +| Name | +| --- | +| `ACTIVE` | +| `CANCELED` | +| `EXPIRED` | +| `EXPIREDCARDS` | +| `ONHOLD` | +| `PASTDUE` | +| `PENDINGCANCELLATION` | +| `PENDINGRENEWAL` | +| `SUSPENDED` | +| `TRIALENDED` | +| `TRIALING` | +| `UNPAID` | + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 2f26f5d9..f88c7694 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -1,6 +1,6 @@ - -# Subscription State - + +# Subscription State + The state of a subscription. * **Live States** @@ -22,29 +22,29 @@ The state of a subscription. * `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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. -See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. - -## Enumeration - -`SubscriptionState` - -## Fields - -| Name | -| --- | -| `PENDING` | -| `FAILEDTOCREATE` | -| `TRIALING` | -| `ASSESSING` | -| `ACTIVE` | -| `SOFTFAILURE` | -| `PASTDUE` | -| `SUSPENDED` | -| `CANCELED` | -| `EXPIRED` | -| `PAUSED` | -| `UNPAID` | -| `TRIALENDED` | -| `ONHOLD` | -| `AWAITINGSIGNUP` | - +See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. + +## Enumeration + +`SubscriptionState` + +## Fields + +| Name | +| --- | +| `PENDING` | +| `FAILEDTOCREATE` | +| `TRIALING` | +| `ASSESSING` | +| `ACTIVE` | +| `SOFTFAILURE` | +| `PASTDUE` | +| `SUSPENDED` | +| `CANCELED` | +| `EXPIRED` | +| `PAUSED` | +| `UNPAID` | +| `TRIALENDED` | +| `ONHOLD` | +| `AWAITINGSIGNUP` | + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index dbebf258..a89480a2 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -1,111 +1,110 @@ - -# Subscription - -## Structure - -`Subscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | The subscription unique id within Chargify. | -| `State` | [`*models.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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.

See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. | -| `BalanceInCents` | `*int64` | Optional | Gives the current outstanding subscription balance in the number of cents. | -| `TotalRevenueInCents` | `*int64` | Optional | Gives the total revenue from the subscription in the number of cents. | -| `ProductPriceInCents` | `*int64` | 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. | -| `ProductVersionNumber` | `*int` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | -| `CurrentPeriodEndsAt` | `*time.Time` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | -| `NextAssessmentAt` | `*time.Time` | 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) | -| `TrialStartedAt` | `Optional[time.Time]` | Optional | Timestamp for when the trial period (if any) began | -| `TrialEndedAt` | `Optional[time.Time]` | Optional | Timestamp for when the trial period (if any) ended | -| `ActivatedAt` | `*time.Time` | 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) | -| `ExpiresAt` | `Optional[time.Time]` | Optional | Timestamp giving the expiration date of this subscription (if any) | -| `CreatedAt` | `*time.Time` | Optional | The creation date for this subscription | -| `UpdatedAt` | `*time.Time` | Optional | The date of last update for this subscription | -| `CancellationMessage` | `Optional[string]` | Optional | Seller-provided reason for, or note about, the cancellation. | -| `CancellationMethod` | [`Optional[models.CancellationMethod]`](../../doc/models/cancellation-method.md) | Optional | The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. | -| `CancelAtEndOfPeriod` | `Optional[bool]` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | -| `CanceledAt` | `Optional[time.Time]` | Optional | The timestamp of the most recent cancellation | -| `CurrentPeriodStartedAt` | `*time.Time` | Optional | Timestamp relating to the start of the current (recurring) period | -| `PreviousState` | [`*models.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) | -| `SignupPaymentId` | `*int` | Optional | The ID of the transaction that generated the revenue | -| `SignupRevenue` | `*string` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | -| `DelayedCancelAt` | `Optional[time.Time]` | Optional | Timestamp for when the subscription is currently set to cancel. | -| `CouponCode` | `Optional[string]` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | -| `SnapDay` | `Optional[string]` | Optional | The day of the month that the subscription will charge according to calendar billing rules, if used. | -| `PaymentCollectionMethod` | [`*models.PaymentCollectionMethod`](../../doc/models/payment-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`.
**Default**: `"automatic"` | -| `Customer` | [`*models.Customer`](../../doc/models/customer.md) | Optional | - | -| `Product` | [`*models.Product`](../../doc/models/product.md) | Optional | - | -| `CreditCard` | [`*models.CreditCardPaymentProfile`](../../doc/models/credit-card-payment-profile.md) | Optional | - | -| `Group` | [`Optional[models.NestedSubscriptionGroup]`](../../doc/models/nested-subscription-group.md) | Optional | - | -| `BankAccount` | [`*models.BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Optional | - | -| `PaymentType` | `Optional[string]` | Optional | The payment profile type for the active profile on file. | -| `ReferralCode` | `Optional[string]` | Optional | The subscription's unique code that can be given to referrals. | -| `NextProductId` | `Optional[int]` | Optional | If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal. | -| `NextProductHandle` | `Optional[string]` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | -| `CouponUseCount` | `Optional[int]` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | -| `CouponUsesAllowed` | `Optional[int]` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `ReasonCode` | `Optional[string]` | Optional | If the subscription is canceled, this is their churn code. | -| `AutomaticallyResumeAt` | `Optional[time.Time]` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | -| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | -| `OfferId` | `Optional[int]` | Optional | The ID of the offer associated with the subscription. | -| `PayerId` | `Optional[int]` | Optional | On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled. | -| `CurrentBillingAmountInCents` | `*int64` | Optional | The balance in cents plus the estimated renewal amount in cents. | -| `ProductPricePointId` | `*int` | Optional | The product price point currently subscribed to. | -| `ProductPricePointType` | [`*models.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. | -| `NextProductPricePointId` | `Optional[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. | -| `NetTerms` | `Optional[int]` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | -| `StoredCredentialTransactionId` | `Optional[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` | `Optional[string]` | Optional | The reference value (provided by your app) for the subscription itelf. | -| `OnHoldAt` | `Optional[time.Time]` | Optional | The timestamp of the most recent on hold action. | -| `PrepaidDunning` | `*bool` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | -| `Coupons` | [`[]models.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. | -| `DunningCommunicationDelayEnabled` | `*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.
**Default**: `false` | -| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | -| `ReceivesInvoiceEmails` | `Optional[bool]` | Optional | - | -| `Locale` | `Optional[string]` | Optional | - | -| `Currency` | `*string` | Optional | - | -| `ScheduledCancellationAt` | `Optional[time.Time]` | Optional | - | -| `CreditBalanceInCents` | `*int64` | Optional | - | -| `PrepaymentBalanceInCents` | `*int64` | Optional | - | -| `PrepaidConfiguration` | [`*models.PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | -| `SelfServicePageToken` | `*string` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | - -## Example (as JSON) - -```json -{ - "payment_collection_method": "automatic", - "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_enabled": false, - "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 -} -``` - + +# Subscription + +## Structure + +`Subscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | The subscription unique id within Chargify. | +| `State` | [`*models.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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.

See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. | +| `BalanceInCents` | `*int64` | Optional | Gives the current outstanding subscription balance in the number of cents. | +| `TotalRevenueInCents` | `*int64` | Optional | Gives the total revenue from the subscription in the number of cents. | +| `ProductPriceInCents` | `*int64` | 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. | +| `ProductVersionNumber` | `*int` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | +| `CurrentPeriodEndsAt` | `*time.Time` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | +| `NextAssessmentAt` | `*time.Time` | 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) | +| `TrialStartedAt` | `Optional[time.Time]` | Optional | Timestamp for when the trial period (if any) began | +| `TrialEndedAt` | `Optional[time.Time]` | Optional | Timestamp for when the trial period (if any) ended | +| `ActivatedAt` | `*time.Time` | 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) | +| `ExpiresAt` | `Optional[time.Time]` | Optional | Timestamp giving the expiration date of this subscription (if any) | +| `CreatedAt` | `*time.Time` | Optional | The creation date for this subscription | +| `UpdatedAt` | `*time.Time` | Optional | The date of last update for this subscription | +| `CancellationMessage` | `Optional[string]` | Optional | Seller-provided reason for, or note about, the cancellation. | +| `CancellationMethod` | [`Optional[models.CancellationMethod]`](../../doc/models/cancellation-method.md) | Optional | The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. | +| `CancelAtEndOfPeriod` | `Optional[bool]` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | +| `CanceledAt` | `Optional[time.Time]` | Optional | The timestamp of the most recent cancellation | +| `CurrentPeriodStartedAt` | `*time.Time` | Optional | Timestamp relating to the start of the current (recurring) period | +| `PreviousState` | [`*models.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) | +| `SignupPaymentId` | `*int` | Optional | The ID of the transaction that generated the revenue | +| `SignupRevenue` | `*string` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | +| `DelayedCancelAt` | `Optional[time.Time]` | Optional | Timestamp for when the subscription is currently set to cancel. | +| `CouponCode` | `Optional[string]` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | +| `SnapDay` | `Optional[string]` | Optional | The day of the month that the subscription will charge according to calendar billing rules, if used. | +| `PaymentCollectionMethod` | [`*models.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`.
**Default**: `"automatic"` | +| `Customer` | [`*models.Customer`](../../doc/models/customer.md) | Optional | - | +| `Product` | [`*models.Product`](../../doc/models/product.md) | Optional | - | +| `CreditCard` | [`*models.CreditCardPaymentProfile`](../../doc/models/credit-card-payment-profile.md) | Optional | - | +| `Group` | [`Optional[models.NestedSubscriptionGroup]`](../../doc/models/nested-subscription-group.md) | Optional | - | +| `BankAccount` | [`*models.BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Optional | - | +| `PaymentType` | `Optional[string]` | Optional | The payment profile type for the active profile on file. | +| `ReferralCode` | `Optional[string]` | Optional | The subscription's unique code that can be given to referrals. | +| `NextProductId` | `Optional[int]` | Optional | If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal. | +| `NextProductHandle` | `Optional[string]` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | +| `CouponUseCount` | `Optional[int]` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | +| `CouponUsesAllowed` | `Optional[int]` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | +| `ReasonCode` | `Optional[string]` | Optional | If the subscription is canceled, this is their churn code. | +| `AutomaticallyResumeAt` | `Optional[time.Time]` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | +| `CouponCodes` | `[]string` | Optional | An array for all the coupons attached to the subscription. | +| `OfferId` | `Optional[int]` | Optional | The ID of the offer associated with the subscription. | +| `PayerId` | `Optional[int]` | Optional | On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled. | +| `CurrentBillingAmountInCents` | `*int64` | Optional | The balance in cents plus the estimated renewal amount in cents. | +| `ProductPricePointId` | `*int` | Optional | The product price point currently subscribed to. | +| `ProductPricePointType` | [`*models.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. | +| `NextProductPricePointId` | `Optional[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. | +| `NetTerms` | `Optional[int]` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | +| `StoredCredentialTransactionId` | `Optional[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` | `Optional[string]` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `OnHoldAt` | `Optional[time.Time]` | Optional | The timestamp of the most recent on hold action. | +| `PrepaidDunning` | `*bool` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | +| `Coupons` | [`[]models.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. | +| `DunningCommunicationDelayEnabled` | `*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. | +| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | +| `ReceivesInvoiceEmails` | `Optional[bool]` | Optional | - | +| `Locale` | `Optional[string]` | Optional | - | +| `Currency` | `*string` | Optional | - | +| `ScheduledCancellationAt` | `Optional[time.Time]` | Optional | - | +| `CreditBalanceInCents` | `*int64` | Optional | - | +| `PrepaymentBalanceInCents` | `*int64` | Optional | - | +| `PrepaidConfiguration` | [`*models.PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | +| `SelfServicePageToken` | `*string` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | + +## Example (as JSON) + +```json +{ + "payment_collection_method": "automatic", + "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 +} +``` + diff --git a/doc/models/subscriptions-mrr-error-response-exception.md b/doc/models/subscriptions-mrr-error-response-exception.md index c02ecdb9..51f4d1a4 100644 --- a/doc/models/subscriptions-mrr-error-response-exception.md +++ b/doc/models/subscriptions-mrr-error-response-exception.md @@ -1,25 +1,25 @@ - -# Subscriptions Mrr Error Response Exception - -## Structure - -`SubscriptionsMrrErrorResponseException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`models.AttributeError`](../../doc/models/attribute-error.md) | Required | - | - -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] - } -} -``` - + +# Subscriptions Mrr Error Response Exception + +## Structure + +`SubscriptionsMrrErrorResponseException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`models.AttributeError`](../../doc/models/attribute-error.md) | Required | - | + +## Example (as JSON) + +```json +{ + "errors": { + "attribute": [ + "supplied value is invalid, expected ISO 8601 format" + ] + } +} +``` + diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index 3876d0cb..b53ff33e 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -1,16 +1,16 @@ - -# Tax Configuration Kind - -## Enumeration - -`TaxConfigurationKind` - -## Fields - -| Name | -| --- | -| `CUSTOM` | -| `ENUMMANAGEDAVALARA` | -| `ENUMLINKEDAVALARA` | -| `ENUMDIGITALRIVER` | - + +# Tax Configuration Kind + +## Enumeration + +`TaxConfigurationKind` + +## Fields + +| Name | +| --- | +| `CUSTOM` | +| `ENUMMANAGEDAVALARA` | +| `ENUMLINKEDAVALARA` | +| `ENUMDIGITALRIVER` | + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index 364cdfd8..8498cf5e 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -1,25 +1,25 @@ - -# Tax Configuration - -## Structure - -`TaxConfiguration` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Kind` | [`*models.TaxConfigurationKind`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `"custom"` | -| `DestinationAddress` | [`*models.TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | -| `FullyConfigured` | `*bool` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-Introduction
**Default**: `false` | - -## Example (as JSON) - -```json -{ - "kind": "custom", - "fully_configured": false, - "destination_address": "shipping_only" -} -``` - + +# Tax Configuration + +## Structure + +`TaxConfiguration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Kind` | [`*models.TaxConfigurationKind`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `"custom"` | +| `DestinationAddress` | [`*models.TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | +| `FullyConfigured` | `*bool` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-Introduction
**Default**: `false` | + +## Example (as JSON) + +```json +{ + "kind": "custom", + "fully_configured": false, + "destination_address": "shipping_only" +} +``` + diff --git a/doc/models/tax-destination-address.md b/doc/models/tax-destination-address.md index 15eb501a..81a9db3c 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -1,16 +1,16 @@ - -# Tax Destination Address - -## Enumeration - -`TaxDestinationAddress` - -## Fields - -| Name | -| --- | -| `SHIPPINGTHENBILLING` | -| `BILLINGTHENSHIPPING` | -| `SHIPPINGONLY` | -| `BILLINGONLY` | - + +# Tax Destination Address + +## Enumeration + +`TaxDestinationAddress` + +## Fields + +| Name | +| --- | +| `SHIPPINGTHENBILLING` | +| `BILLINGTHENSHIPPING` | +| `SHIPPINGONLY` | +| `BILLINGONLY` | + 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 4f781ca3..61bb0183 100644 --- a/doc/models/too-many-management-link-requests-error-exception.md +++ b/doc/models/too-many-management-link-requests-error-exception.md @@ -1,24 +1,24 @@ - -# Too Many Management Link Requests Error Exception - -## Structure - -`TooManyManagementLinkRequestsErrorException` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Errors` | [`models.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" - } -} -``` - + +# Too Many Management Link Requests Error Exception + +## Structure + +`TooManyManagementLinkRequestsErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Errors` | [`models.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" + } +} +``` + diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index d45e2c2e..92d57495 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -1,23 +1,23 @@ - -# Too Many Management Link Requests - -## Structure - -`TooManyManagementLinkRequests` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Error` | `string` | Required | - | -| `NewLinkAvailableAt` | `time.Time` | Required | - | - -## Example (as JSON) - -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} -``` - + +# Too Many Management Link Requests + +## Structure + +`TooManyManagementLinkRequests` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Error` | `string` | Required | - | +| `NewLinkAvailableAt` | `time.Time` | Required | - | + +## Example (as JSON) + +```json +{ + "error": "error2", + "new_link_available_at": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/update-allocation-expiration-date.md b/doc/models/update-allocation-expiration-date.md index 82198fc5..01c4fa45 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -1,23 +1,23 @@ - -# Update Allocation Expiration Date - -## Structure - -`UpdateAllocationExpirationDate` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Allocation` | [`*models.AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "expires_at8" - } -} -``` - + +# Update Allocation Expiration Date + +## Structure + +`UpdateAllocationExpirationDate` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Allocation` | [`*models.AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "allocation": { + "expires_at": "expires_at8" + } +} +``` + diff --git a/doc/models/update-component-price-point-request.md b/doc/models/update-component-price-point-request.md index 02e2c433..2be8bc1e 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -1,27 +1,27 @@ - -# Update Component Price Point Request - -## Structure - -`UpdateComponentPricePointRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`*models.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 - } -} -``` - + +# Update Component Price Point Request + +## Structure + +`UpdateComponentPricePointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`*models.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 + } +} +``` + diff --git a/doc/models/update-component-price-point.md b/doc/models/update-component-price-point.md index 8436143d..a5bfdc11 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -1,32 +1,32 @@ - -# Update Component Price Point - -## Structure - -`UpdateComponentPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Name` | `*string` | Optional | - | -| `Handle` | `*string` | Optional | - | -| `PricingScheme` | [`*models.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. | -| `UseSiteExchangeRate` | `*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. | -| `TaxIncluded` | `*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. | -| `IntervalUnit` | [`*models.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` | [`[]models.UpdatePrice`](../../doc/models/update-price.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false -} -``` - + +# Update Component Price Point + +## Structure + +`UpdateComponentPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Name` | `*string` | Optional | - | +| `Handle` | `*string` | Optional | - | +| `PricingScheme` | [`*models.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. | +| `UseSiteExchangeRate` | `*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. | +| `TaxIncluded` | `*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. | +| `IntervalUnit` | [`*models.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` | [`[]models.UpdatePrice`](../../doc/models/update-price.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name2", + "handle": "handle8", + "pricing_scheme": "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 85ca8d17..35bdbea1 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -1,28 +1,28 @@ - -# Update Component Request - -## Structure - -`UpdateComponentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Component` | [`models.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 - } -} -``` - + +# Update Component Request + +## Structure + +`UpdateComponentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Component` | [`models.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 + } +} +``` + diff --git a/doc/models/update-component.md b/doc/models/update-component.md index 588fdf12..e9ef488b 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -1,34 +1,34 @@ - -# Update Component - -## Structure - -`UpdateComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Handle` | `*string` | Optional | - | -| `Name` | `*string` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | -| `Description` | `Optional[string]` | Optional | The description of the component. | -| `AccountingCode` | `Optional[string]` | Optional | - | -| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | -| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | -| `ItemCategory` | [`Optional[models.ItemCategory]`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | -| `DisplayOnHostedPage` | `*bool` | Optional | - | -| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "handle": "handle6", - "name": "name0", - "description": "description0", - "accounting_code": "accounting_code6", - "taxable": false -} -``` - + +# Update Component + +## Structure + +`UpdateComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Handle` | `*string` | Optional | - | +| `Name` | `*string` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `Description` | `Optional[string]` | Optional | The description of the component. | +| `AccountingCode` | `Optional[string]` | Optional | - | +| `Taxable` | `*bool` | Optional | Boolean flag describing whether a component is taxable or not. | +| `TaxCode` | `Optional[string]` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | +| `ItemCategory` | [`Optional[models.ItemCategory]`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | +| `DisplayOnHostedPage` | `*bool` | Optional | - | +| `UpgradeCharge` | [`Optional[models.CreditType]`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | + +## Example (as JSON) + +```json +{ + "item_category": "Business Software", + "handle": "handle6", + "name": "name0", + "description": "description0", + "accounting_code": "accounting_code6", + "taxable": false +} +``` + diff --git a/doc/models/update-coupon-currency.md b/doc/models/update-coupon-currency.md index 80894edc..0180b461 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -1,23 +1,23 @@ - -# Update Coupon Currency - -## Structure - -`UpdateCouponCurrency` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Currency` | `string` | Required | ISO code for the site defined currency. | -| `Price` | `int` | Required | Price for the given currency. | - -## Example (as JSON) - -```json -{ - "currency": "currency4", - "price": 146 -} -``` - + +# Update Coupon Currency + +## Structure + +`UpdateCouponCurrency` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Currency` | `string` | Required | ISO code for the site defined currency. | +| `Price` | `int` | Required | Price for the given currency. | + +## Example (as JSON) + +```json +{ + "currency": "currency4", + "price": 146 +} +``` + diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 4c2d3cd7..26c9b602 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -1,23 +1,23 @@ - -# Update Currency Price - -## Structure - -`UpdateCurrencyPrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `int` | Required | ID of the currency price record being updated | -| `Price` | `int` | Required | New price for the given currency | - -## Example (as JSON) - -```json -{ - "id": 146, - "price": 18 -} -``` - + +# Update Currency Price + +## Structure + +`UpdateCurrencyPrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `int` | Required | ID of the currency price record being updated | +| `Price` | `int` | Required | New price for the given currency | + +## Example (as JSON) + +```json +{ + "id": 146, + "price": 18 +} +``` + diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index 818744d5..ced2a386 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -1,26 +1,26 @@ - -# Update Currency Prices Request - -## Structure - -`UpdateCurrencyPricesRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrencyPrices` | [`[]models.UpdateCurrencyPrice`](../../doc/models/update-currency-price.md) | Required | - | - -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "price": 78 - } - ] -} -``` - + +# Update Currency Prices Request + +## Structure + +`UpdateCurrencyPricesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrencyPrices` | [`[]models.UpdateCurrencyPrice`](../../doc/models/update-currency-price.md) | Required | - | + +## Example (as JSON) + +```json +{ + "currency_prices": [ + { + "id": 50, + "price": 78 + } + ] +} +``` + diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 54a1bd07..b1dffa87 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -1,27 +1,27 @@ - -# Update Customer Request - -## Structure - -`UpdateCustomerRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Customer` | [`models.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" - } -} -``` - + +# Update Customer Request + +## Structure + +`UpdateCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Customer` | [`models.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" + } +} +``` + diff --git a/doc/models/update-customer.md b/doc/models/update-customer.md index a4439711..9bee0211 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -1,42 +1,42 @@ - -# Update Customer - -## Structure - -`UpdateCustomer` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | - | -| `LastName` | `*string` | Optional | - | -| `Email` | `*string` | Optional | - | -| `CcEmails` | `*string` | Optional | - | -| `Organization` | `*string` | Optional | - | -| `Reference` | `*string` | Optional | - | -| `Address` | `*string` | Optional | - | -| `Address2` | `*string` | Optional | - | -| `City` | `*string` | Optional | - | -| `State` | `*string` | Optional | - | -| `Zip` | `*string` | Optional | - | -| `Country` | `*string` | Optional | - | -| `Phone` | `*string` | Optional | - | -| `Locale` | `*string` | Optional | Set a specific language on a customer record. | -| `VatNumber` | `*string` | Optional | - | -| `TaxExempt` | `*bool` | Optional | - | -| `TaxExemptReason` | `*string` | Optional | - | -| `ParentId` | `Optional[int]` | Optional | - | - -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} -``` - + +# Update Customer + +## Structure + +`UpdateCustomer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | - | +| `LastName` | `*string` | Optional | - | +| `Email` | `*string` | Optional | - | +| `CcEmails` | `*string` | Optional | - | +| `Organization` | `*string` | Optional | - | +| `Reference` | `*string` | Optional | - | +| `Address` | `*string` | Optional | - | +| `Address2` | `*string` | Optional | - | +| `City` | `*string` | Optional | - | +| `State` | `*string` | Optional | - | +| `Zip` | `*string` | Optional | - | +| `Country` | `*string` | Optional | - | +| `Phone` | `*string` | Optional | - | +| `Locale` | `*string` | Optional | Set a specific language on a customer record. | +| `VatNumber` | `*string` | Optional | - | +| `TaxExempt` | `*bool` | Optional | - | +| `TaxExemptReason` | `*string` | Optional | - | +| `ParentId` | `Optional[int]` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name2", + "last_name": "last_name0", + "email": "email4", + "cc_emails": "cc_emails8", + "organization": "organization6" +} +``` + diff --git a/doc/models/update-endpoint-request.md b/doc/models/update-endpoint-request.md index 4a25bf86..11be8eb5 100644 --- a/doc/models/update-endpoint-request.md +++ b/doc/models/update-endpoint-request.md @@ -1,28 +1,28 @@ - -# Update Endpoint Request - -Used to Create or Update Endpoint - -## Structure - -`UpdateEndpointRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Endpoint` | [`models.UpdateEndpoint`](../../doc/models/update-endpoint.md) | Required | Used to Create or Update Endpoint | - -## Example (as JSON) - -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "dunning_step_reached" - ] - } -} -``` - + +# Update Endpoint Request + +Used to Create or Update Endpoint + +## Structure + +`UpdateEndpointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Endpoint` | [`models.UpdateEndpoint`](../../doc/models/update-endpoint.md) | Required | Used to Create or Update Endpoint | + +## Example (as JSON) + +```json +{ + "endpoint": { + "url": "url2", + "webhook_subscriptions": [ + "dunning_step_reached" + ] + } +} +``` + diff --git a/doc/models/update-endpoint.md b/doc/models/update-endpoint.md index bed3887a..6b381ba3 100644 --- a/doc/models/update-endpoint.md +++ b/doc/models/update-endpoint.md @@ -1,27 +1,27 @@ - -# Update Endpoint - -Used to Create or Update Endpoint - -## Structure - -`UpdateEndpoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Url` | `string` | Required | - | -| `WebhookSubscriptions` | [`[]models.WebhookSubscription`](../../doc/models/webhook-subscription.md) | Required | - | - -## Example (as JSON) - -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "payment_success" - ] -} -``` - + +# Update Endpoint + +Used to Create or Update Endpoint + +## Structure + +`UpdateEndpoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Url` | `string` | Required | - | +| `WebhookSubscriptions` | [`[]models.WebhookSubscription`](../../doc/models/webhook-subscription.md) | Required | - | + +## Example (as JSON) + +```json +{ + "url": "url8", + "webhook_subscriptions": [ + "payment_success" + ] +} +``` + diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index de8cf310..5b83d480 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -1,25 +1,25 @@ - -# Update Metadata Request - -## Structure - -`UpdateMetadataRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Metadata` | [`*models.UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} -``` - + +# Update Metadata Request + +## Structure + +`UpdateMetadataRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Metadata` | [`*models.UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "metadata": { + "current_name": "current_name0", + "name": "name6", + "value": "value8" + } +} +``` + diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index e558f442..8f11d512 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -1,25 +1,25 @@ - -# Update Metadata - -## Structure - -`UpdateMetadata` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CurrentName` | `*string` | Optional | - | -| `Name` | `*string` | Optional | - | -| `Value` | `*string` | Optional | - | - -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} -``` - + +# Update Metadata + +## Structure + +`UpdateMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CurrentName` | `*string` | Optional | - | +| `Name` | `*string` | Optional | - | +| `Value` | `*string` | Optional | - | + +## Example (as JSON) + +```json +{ + "current_name": "current_name4", + "name": "name0", + "value": "value2" +} +``` + diff --git a/doc/models/update-metafields-request.md b/doc/models/update-metafields-request.md index edec00ef..d7c9cc84 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -1,24 +1,24 @@ - -# Update Metafields Request - -## Structure - -`UpdateMetafieldsRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Metafields` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "metafields": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Update Metafields Request + +## Structure + +`UpdateMetafieldsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Metafields` | `*interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "metafields": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/update-payment-profile-request.md b/doc/models/update-payment-profile-request.md index d21a593a..615013e4 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -1,27 +1,27 @@ - -# Update Payment Profile Request - -## Structure - -`UpdatePaymentProfileRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PaymentProfile` | [`models.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" - } -} -``` - + +# Update Payment Profile Request + +## Structure + +`UpdatePaymentProfileRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PaymentProfile` | [`models.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" + } +} +``` + diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index c5ff9fea..9be5bc01 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -1,37 +1,37 @@ - -# Update Payment Profile - -## Structure - -`UpdatePaymentProfile` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `FirstName` | `*string` | Optional | The first name of the card holder. | -| `LastName` | `*string` | Optional | The last name of the card holder. | -| `FullNumber` | `*string` | Optional | The full credit card number | -| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `ExpirationMonth` | `*string` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | -| `ExpirationYear` | `*string` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | -| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `BillingAddress` | `*string` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `BillingCity` | `*string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `BillingState` | `*string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `BillingZip` | `*string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `BillingCountry` | `*string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `BillingAddress2` | `Optional[string]` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | - -## Example (as JSON) - -```json -{ - "full_number": "5424000000000015", - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "carnet", - "expiration_month": "expiration_month2" -} -``` - + +# Update Payment Profile + +## Structure + +`UpdatePaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `FirstName` | `*string` | Optional | The first name of the card holder. | +| `LastName` | `*string` | Optional | The last name of the card holder. | +| `FullNumber` | `*string` | Optional | The full credit card number | +| `CardType` | [`*models.CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | +| `ExpirationMonth` | `*string` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | +| `ExpirationYear` | `*string` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | +| `CurrentVault` | [`*models.CurrentVault`](../../doc/models/current-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | +| `BillingAddress` | `*string` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | +| `BillingCity` | `*string` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | +| `BillingState` | `*string` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `BillingZip` | `*string` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `BillingCountry` | `*string` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `BillingAddress2` | `Optional[string]` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | + +## Example (as JSON) + +```json +{ + "full_number": "5424000000000015", + "first_name": "first_name2", + "last_name": "last_name0", + "card_type": "carnet", + "expiration_month": "expiration_month2" +} +``` + diff --git a/doc/models/update-price.md b/doc/models/update-price.md index 7a1c308c..acceeb39 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -1,38 +1,38 @@ - -# Update Price - -## Structure - -`UpdatePrice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int` | Optional | - | -| `EndingQuantity` | `*interface{}` | Optional | - | -| `UnitPrice` | `*interface{}` | Optional | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | -| `Destroy` | `*bool` | Optional | - | -| `StartingQuantity` | `*interface{}` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 18, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - }, - "_destroy": false, - "starting_quantity": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Update Price + +## Structure + +`UpdatePrice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int` | Optional | - | +| `EndingQuantity` | `*interface{}` | Optional | - | +| `UnitPrice` | `*interface{}` | Optional | The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 | +| `Destroy` | `*bool` | Optional | - | +| `StartingQuantity` | `*interface{}` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 18, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + }, + "_destroy": false, + "starting_quantity": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/update-product-price-point-request.md b/doc/models/update-product-price-point-request.md index ea20d387..3e027b8c 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -1,24 +1,24 @@ - -# Update Product Price Point Request - -## Structure - -`UpdateProductPricePointRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricePoint` | [`models.UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | - -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} -``` - + +# Update Product Price Point Request + +## Structure + +`UpdateProductPricePointRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricePoint` | [`models.UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | + +## Example (as JSON) + +```json +{ + "price_point": { + "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 f1619124..c9f38e79 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -1,23 +1,23 @@ - -# Update Product Price Point - -## Structure - -`UpdateProductPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Handle` | `*string` | Optional | - | -| `PriceInCents` | `*int64` | Optional | - | - -## Example (as JSON) - -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} -``` - + +# Update Product Price Point + +## Structure + +`UpdateProductPricePoint` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Handle` | `*string` | Optional | - | +| `PriceInCents` | `*int64` | Optional | - | + +## Example (as JSON) + +```json +{ + "handle": "handle6", + "price_in_cents": 220 +} +``` + diff --git a/doc/models/update-reason-code-request.md b/doc/models/update-reason-code-request.md index 753955d5..a40cd489 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -1,25 +1,25 @@ - -# Update Reason Code Request - -## Structure - -`UpdateReasonCodeRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ReasonCode` | [`models.UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | - -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} -``` - + +# Update Reason Code Request + +## Structure + +`UpdateReasonCodeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ReasonCode` | [`models.UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | + +## Example (as JSON) + +```json +{ + "reason_code": { + "code": "code4", + "description": "description6", + "position": 14 + } +} +``` + diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index 3b55f604..71db9120 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -1,25 +1,25 @@ - -# Update Reason Code - -## Structure - -`UpdateReasonCode` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Code` | `*string` | Optional | The unique identifier for the ReasonCode | -| `Description` | `*string` | 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 -} -``` - + +# Update Reason Code + +## Structure + +`UpdateReasonCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Code` | `*string` | Optional | The unique identifier for the ReasonCode | +| `Description` | `*string` | 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 +} +``` + diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index 3d092110..31d9b785 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -1,49 +1,49 @@ - -# Update Segment Request - -## Structure - -`UpdateSegmentRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Segment` | [`models.UpdateSegment`](../../doc/models/update-segment.md) | Required | - | - -## Example (as JSON) - -```json -{ - "segment": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } -} -``` - + +# Update Segment Request + +## Structure + +`UpdateSegmentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Segment` | [`models.UpdateSegment`](../../doc/models/update-segment.md) | Required | - | + +## Example (as JSON) + +```json +{ + "segment": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": 64, + "ending_quantity": 38, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } +} +``` + diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index de0ac309..e753926b 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -1,32 +1,32 @@ - -# Update Segment - -## Structure - -`UpdateSegment` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PricingScheme` | [`models.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` | [`[]models.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": { - "key1": "val1", - "key2": "val2" - } - } - ] -} -``` - + +# Update Segment + +## Structure + +`UpdateSegment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PricingScheme` | [`models.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` | [`[]models.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": { + "key1": "val1", + "key2": "val2" + } + } + ] +} +``` + diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index 7c5c455c..282ca029 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -1,57 +1,57 @@ - -# Update Subscription Component - -## Structure - -`UpdateSubscriptionComponent` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `ComponentId` | `*int` | Optional | - | -| `CustomPrice` | [`*models.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": { - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "prices": [ - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - }, - { - "starting_quantity": { - "key1": "val1", - "key2": "val2" - }, - "ending_quantity": { - "key1": "val1", - "key2": "val2" - }, - "unit_price": { - "key1": "val1", - "key2": "val2" - } - } - ] - } -} -``` - + +# Update Subscription Component + +## Structure + +`UpdateSubscriptionComponent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ComponentId` | `*int` | Optional | - | +| `CustomPrice` | [`*models.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": { + "pricing_scheme": "stairstep", + "interval": 66, + "interval_unit": "day", + "prices": [ + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + }, + { + "starting_quantity": { + "key1": "val1", + "key2": "val2" + }, + "ending_quantity": { + "key1": "val1", + "key2": "val2" + }, + "unit_price": { + "key1": "val1", + "key2": "val2" + } + } + ] + } +} +``` + diff --git a/doc/models/update-subscription-group-request.md b/doc/models/update-subscription-group-request.md index 972efb80..b9ee7541 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -1,26 +1,26 @@ - -# Update Subscription Group Request - -## Structure - -`UpdateSubscriptionGroupRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `SubscriptionGroup` | [`models.UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "member_ids": [ - 164, - 165 - ] - } -} -``` - + +# Update Subscription Group Request + +## Structure + +`UpdateSubscriptionGroupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `SubscriptionGroup` | [`models.UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription_group": { + "member_ids": [ + 164, + 165 + ] + } +} +``` + diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index 21b9e040..84c1fadd 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -1,25 +1,25 @@ - -# Update Subscription Group - -## Structure - -`UpdateSubscriptionGroup` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `MemberIds` | `[]int` | Optional | - | - -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 - ] -} -``` - + +# Update Subscription Group + +## Structure + +`UpdateSubscriptionGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `MemberIds` | `[]int` | Optional | - | + +## Example (as JSON) + +```json +{ + "member_ids": [ + 52, + 53, + 54 + ] +} +``` + diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 0772d887..0d12434b 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -1,26 +1,26 @@ - -# Update Subscription Note Request - -Updatable fields for Subscription Note - -## Structure - -`UpdateSubscriptionNoteRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Note` | [`models.UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | - -## Example (as JSON) - -```json -{ - "note": { - "body": "body0", - "sticky": false - } -} -``` - + +# Update Subscription Note Request + +Updatable fields for Subscription Note + +## Structure + +`UpdateSubscriptionNoteRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Note` | [`models.UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | + +## Example (as JSON) + +```json +{ + "note": { + "body": "body0", + "sticky": false + } +} +``` + diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index 212af79b..000da34b 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -1,25 +1,25 @@ - -# Update Subscription Note - -Updatable fields for Subscription Note - -## Structure - -`UpdateSubscriptionNote` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Body` | `string` | Required | - | -| `Sticky` | `bool` | Required | - | - -## Example (as JSON) - -```json -{ - "body": "body8", - "sticky": false -} -``` - + +# Update Subscription Note + +Updatable fields for Subscription Note + +## Structure + +`UpdateSubscriptionNote` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Body` | `string` | Required | - | +| `Sticky` | `bool` | Required | - | + +## Example (as JSON) + +```json +{ + "body": "body8", + "sticky": false +} +``` + diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index 41a84630..d3b355b9 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -1,33 +1,32 @@ - -# Update Subscription Request - -## Structure - -`UpdateSubscriptionRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Subscription` | [`models.UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription": { - "product_change_delayed": false, - "dunning_communication_delay_enabled": 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, - "next_product_id": "next_product_id6" - } -} -``` - + +# Update Subscription Request + +## Structure + +`UpdateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Subscription` | [`models.UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | + +## Example (as JSON) + +```json +{ + "subscription": { + "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" + } +} +``` + diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 1339089c..7aa3e310 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -1,47 +1,46 @@ - -# Update Subscription - -## Structure - -`UpdateSubscription` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `CreditCardAttributes` | [`*models.CreditCardAttributes`](../../doc/models/credit-card-attributes.md) | Optional | - | -| `ProductHandle` | `*string` | Optional | Set to the handle of a different product to change the subscription's product | -| `ProductId` | `*int` | Optional | Set to the id of a different product to change the subscription's product | -| `ProductChangeDelayed` | `*bool` | Optional | **Default**: `false` | -| `NextProductId` | `*string` | Optional | Set to an empty string to cancel a delayed product change. | -| `NextProductPricePointId` | `*string` | Optional | - | -| `SnapDay` | `*interface{}` | Optional | Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. | -| `NextBillingAt` | `*string` | Optional | - | -| `PaymentCollectionMethod` | `*string` | Optional | - | -| `ReceivesInvoiceEmails` | `*bool` | Optional | - | -| `NetTerms` | `*interface{}` | Optional | - | -| `StoredCredentialTransactionId` | `*int` | Optional | - | -| `Reference` | `*string` | Optional | - | -| `CustomPrice` | [`*models.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 | -| `Components` | [`[]models.UpdateSubscriptionComponent`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. | -| `DunningCommunicationDelayEnabled` | `Optional[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.
**Default**: `false` | -| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | - -## Example (as JSON) - -```json -{ - "product_change_delayed": false, - "dunning_communication_delay_enabled": 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, - "next_product_id": "next_product_id8" -} -``` - + +# Update Subscription + +## Structure + +`UpdateSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `CreditCardAttributes` | [`*models.CreditCardAttributes`](../../doc/models/credit-card-attributes.md) | Optional | - | +| `ProductHandle` | `*string` | Optional | Set to the handle of a different product to change the subscription's product | +| `ProductId` | `*int` | Optional | Set to the id of a different product to change the subscription's product | +| `ProductChangeDelayed` | `*bool` | Optional | - | +| `NextProductId` | `*string` | Optional | Set to an empty string to cancel a delayed product change. | +| `NextProductPricePointId` | `*string` | Optional | - | +| `SnapDay` | `*interface{}` | Optional | Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. | +| `NextBillingAt` | `*string` | Optional | - | +| `PaymentCollectionMethod` | `*string` | Optional | - | +| `ReceivesInvoiceEmails` | `*bool` | Optional | - | +| `NetTerms` | `*interface{}` | Optional | - | +| `StoredCredentialTransactionId` | `*int` | Optional | - | +| `Reference` | `*string` | Optional | - | +| `CustomPrice` | [`*models.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 | +| `Components` | [`[]models.UpdateSubscriptionComponent`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. | +| `DunningCommunicationDelayEnabled` | `Optional[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. | +| `DunningCommunicationDelayTimeZone` | `Optional[string]` | Optional | Time zone for the Dunning Communication Delay feature. | + +## Example (as JSON) + +```json +{ + "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" +} +``` + diff --git a/doc/models/upsert-prepaid-configuration-request.md b/doc/models/upsert-prepaid-configuration-request.md index 1d3750d7..79687d57 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -1,26 +1,26 @@ - -# Upsert Prepaid Configuration Request - -## Structure - -`UpsertPrepaidConfigurationRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `PrepaidConfiguration` | [`models.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 - } -} -``` - + +# Upsert Prepaid Configuration Request + +## Structure + +`UpsertPrepaidConfigurationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `PrepaidConfiguration` | [`models.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 + } +} +``` + diff --git a/doc/models/upsert-prepaid-configuration.md b/doc/models/upsert-prepaid-configuration.md index 393b3108..15f2341c 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -1,27 +1,27 @@ - -# Upsert Prepaid Configuration - -## Structure - -`UpsertPrepaidConfiguration` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `InitialFundingAmountInCents` | `*int64` | Optional | - | -| `ReplenishToAmountInCents` | `*int64` | Optional | - | -| `AutoReplenish` | `*bool` | Optional | - | -| `ReplenishThresholdAmountInCents` | `*int64` | 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 -} -``` - + +# Upsert Prepaid Configuration + +## Structure + +`UpsertPrepaidConfiguration` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `InitialFundingAmountInCents` | `*int64` | Optional | - | +| `ReplenishToAmountInCents` | `*int64` | Optional | - | +| `AutoReplenish` | `*bool` | Optional | - | +| `ReplenishThresholdAmountInCents` | `*int64` | 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 +} +``` + diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index e030c9c5..a40a4920 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -1,30 +1,30 @@ - -# Usage Response - -## Structure - -`UsageResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Usage` | [`models.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": { - "key1": "val1", - "key2": "val2" - } - } -} -``` - + +# Usage Response + +## Structure + +`UsageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Usage` | [`models.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": { + "key1": "val1", + "key2": "val2" + } + } +} +``` + diff --git a/doc/models/usage.md b/doc/models/usage.md index 7c1ff6a4..169bfdfa 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -1,36 +1,36 @@ - -# Usage - -## Structure - -`Usage` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Id` | `*int64` | Optional | **Constraints**: `>= 0` | -| `Memo` | `*string` | Optional | - | -| `CreatedAt` | `*time.Time` | Optional | - | -| `PricePointId` | `*int` | Optional | - | -| `Quantity` | `*interface{}` | Optional | - | -| `OverageQuantity` | `*int` | Optional | - | -| `ComponentId` | `*int` | Optional | - | -| `ComponentHandle` | `*string` | Optional | - | -| `SubscriptionId` | `*int` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": { - "key1": "val1", - "key2": "val2" - } -} -``` - + +# Usage + +## Structure + +`Usage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Id` | `*int64` | Optional | **Constraints**: `>= 0` | +| `Memo` | `*string` | Optional | - | +| `CreatedAt` | `*time.Time` | Optional | - | +| `PricePointId` | `*int` | Optional | - | +| `Quantity` | `*interface{}` | Optional | - | +| `OverageQuantity` | `*int` | Optional | - | +| `ComponentId` | `*int` | Optional | - | +| `ComponentHandle` | `*string` | Optional | - | +| `SubscriptionId` | `*int` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 252, + "memo": "memo8", + "created_at": "2016-03-13T12:52:32.123Z", + "price_point_id": 126, + "quantity": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/doc/models/void-invoice-request.md b/doc/models/void-invoice-request.md index e6422381..2b5bf910 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -1,23 +1,23 @@ - -# Void Invoice Request - -## Structure - -`VoidInvoiceRequest` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Void` | [`models.VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | - -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} -``` - + +# Void Invoice Request + +## Structure + +`VoidInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Void` | [`models.VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | + +## Example (as JSON) + +```json +{ + "void": { + "reason": "reason6" + } +} +``` + diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index 6b37f008..d35cfc30 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -1,21 +1,21 @@ - -# Void Invoice - -## Structure - -`VoidInvoice` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Reason` | `string` | Required | **Constraints**: *Minimum Length*: `1` | - -## Example (as JSON) - -```json -{ - "reason": "reason2" -} -``` - + +# Void Invoice + +## Structure + +`VoidInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Reason` | `string` | Required | **Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "reason": "reason2" +} +``` + diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 09ab749e..a2b94bd0 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -1,14 +1,14 @@ - -# Webhook Order - -## Enumeration - -`WebhookOrder` - -## Fields - -| Name | -| --- | -| `NEWESTFIRST` | -| `OLDESTFIRST` | - + +# Webhook Order + +## Enumeration + +`WebhookOrder` + +## Fields + +| Name | +| --- | +| `NEWESTFIRST` | +| `OLDESTFIRST` | + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index e60b4ffa..2b91aa78 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -1,27 +1,27 @@ - -# Webhook Response - -## Structure - -`WebhookResponse` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Webhook` | [`*models.Webhook`](../../doc/models/webhook.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "webhook": { - "event": "event2", - "id": 18, - "created_at": "created_at0", - "last_error": "last_error4", - "last_error_at": "last_error_at2" - } -} -``` - + +# Webhook Response + +## Structure + +`WebhookResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Webhook` | [`*models.Webhook`](../../doc/models/webhook.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "webhook": { + "event": "event2", + "id": 18, + "created_at": "created_at0", + "last_error": "last_error4", + "last_error_at": "last_error_at2" + } +} +``` + diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 9202a9bf..53b2214d 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -1,16 +1,16 @@ - -# Webhook Status - -## Enumeration - -`WebhookStatus` - -## Fields - -| Name | -| --- | -| `SUCCESSFUL` | -| `FAILED` | -| `PENDING` | -| `PAUSED` | - + +# Webhook Status + +## Enumeration + +`WebhookStatus` + +## Fields + +| Name | +| --- | +| `SUCCESSFUL` | +| `FAILED` | +| `PENDING` | +| `PAUSED` | + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 19a54313..00bf3825 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -1,47 +1,47 @@ - -# Webhook Subscription - -## Enumeration - -`WebhookSubscription` - -## Fields - -| Name | -| --- | -| `BILLINGDATECHANGE` | -| `COMPONENTALLOCATIONCHANGE` | -| `CUSTOMERCREATE` | -| `CUSTOMERUPDATE` | -| `DUNNINGSTEPREACHED` | -| `EXPIRINGCARD` | -| `EXPIRATIONDATECHANGE` | -| `INVOICEISSUED` | -| `METEREDUSAGE` | -| `PAYMENTFAILURE` | -| `PAYMENTSUCCESS` | -| `DIRECTDEBITPAYMENTPENDING` | -| `DIRECTDEBITPAYMENTPAIDOUT` | -| `DIRECTDEBITPAYMENTREJECTED` | -| `PREPAIDSUBSCRIPTIONBALANCECHANGED` | -| `PREPAIDUSAGE` | -| `REFUNDFAILURE` | -| `REFUNDSUCCESS` | -| `RENEWALFAILURE` | -| `RENEWALSUCCESS` | -| `SIGNUPFAILURE` | -| `SIGNUPSUCCESS` | -| `STATEMENTCLOSED` | -| `STATEMENTSETTLED` | -| `SUBSCRIPTIONCARDUPDATE` | -| `SUBSCRIPTIONGROUPCARDUPDATE` | -| `SUBSCRIPTIONPRODUCTCHANGE` | -| `SUBSCRIPTIONSTATECHANGE` | -| `TRIALENDNOTICE` | -| `UPCOMINGRENEWALNOTICE` | -| `UPGRADEDOWNGRADEFAILURE` | -| `UPGRADEDOWNGRADESUCCESS` | -| `PENDINGCANCELLATIONCHANGE` | -| `SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED` | -| `SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED` | - + +# Webhook Subscription + +## Enumeration + +`WebhookSubscription` + +## Fields + +| Name | +| --- | +| `BILLINGDATECHANGE` | +| `COMPONENTALLOCATIONCHANGE` | +| `CUSTOMERCREATE` | +| `CUSTOMERUPDATE` | +| `DUNNINGSTEPREACHED` | +| `EXPIRINGCARD` | +| `EXPIRATIONDATECHANGE` | +| `INVOICEISSUED` | +| `METEREDUSAGE` | +| `PAYMENTFAILURE` | +| `PAYMENTSUCCESS` | +| `DIRECTDEBITPAYMENTPENDING` | +| `DIRECTDEBITPAYMENTPAIDOUT` | +| `DIRECTDEBITPAYMENTREJECTED` | +| `PREPAIDSUBSCRIPTIONBALANCECHANGED` | +| `PREPAIDUSAGE` | +| `REFUNDFAILURE` | +| `REFUNDSUCCESS` | +| `RENEWALFAILURE` | +| `RENEWALSUCCESS` | +| `SIGNUPFAILURE` | +| `SIGNUPSUCCESS` | +| `STATEMENTCLOSED` | +| `STATEMENTSETTLED` | +| `SUBSCRIPTIONCARDUPDATE` | +| `SUBSCRIPTIONGROUPCARDUPDATE` | +| `SUBSCRIPTIONPRODUCTCHANGE` | +| `SUBSCRIPTIONSTATECHANGE` | +| `TRIALENDNOTICE` | +| `UPCOMINGRENEWALNOTICE` | +| `UPGRADEDOWNGRADEFAILURE` | +| `UPGRADEDOWNGRADESUCCESS` | +| `PENDINGCANCELLATIONCHANGE` | +| `SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED` | +| `SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED` | + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index 822002c6..0f63818d 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -1,36 +1,36 @@ - -# Webhook - -## Structure - -`Webhook` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `Event` | `*string` | 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. | -| `CreatedAt` | `*string` | Optional | Timestamp indicating when the webhook was created | -| `LastError` | `*string` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | -| `LastErrorAt` | `*string` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | -| `AcceptedAt` | `Optional[string]` | 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. | -| `LastSentAt` | `*string` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | -| `LastSentUrl` | `*string` | 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) | -| `Body` | `*string` | Optional | The data sent within the webhook post | -| `Signature` | `*string` | Optional | The calculated webhook signature | -| `SignatureHmacSha256` | `*string` | Optional | The calculated HMAC-SHA-256 webhook signature | - -## Example (as JSON) - -```json -{ - "event": "event6", - "id": 154, - "created_at": "created_at6", - "last_error": "last_error8", - "last_error_at": "last_error_at6" -} -``` - + +# Webhook + +## Structure + +`Webhook` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `Event` | `*string` | 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. | +| `CreatedAt` | `*string` | Optional | Timestamp indicating when the webhook was created | +| `LastError` | `*string` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | +| `LastErrorAt` | `*string` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | +| `AcceptedAt` | `Optional[string]` | 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. | +| `LastSentAt` | `*string` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | +| `LastSentUrl` | `*string` | 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) | +| `Body` | `*string` | Optional | The data sent within the webhook post | +| `Signature` | `*string` | Optional | The calculated webhook signature | +| `SignatureHmacSha256` | `*string` | Optional | The calculated HMAC-SHA-256 webhook signature | + +## Example (as JSON) + +```json +{ + "event": "event6", + "id": 154, + "created_at": "created_at6", + "last_error": "last_error8", + "last_error_at": "last_error_at6" +} +``` + diff --git a/doc/retry-configuration.md b/doc/retry-configuration.md index 607fc171..ea77b12d 100644 --- a/doc/retry-configuration.md +++ b/doc/retry-configuration.md @@ -1,22 +1,22 @@ - -# RetryConfiguration - -The following parameters are configurable for the RetryConfiguration: - -## Properties - -| Name | Type | Description | -| --- | --- | --- | -| `maxRetryAttempts` | `int64` | Maximum number of retries.
*Default*: `0` | -| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` | -| `retryInterval` | `time.Duration` | Interval before next retry. Used in calculation of wait time for next request in case of failure.
*Default*: `1` | -| `maximumRetryWaitTime` | `time.Duration` | Overall wait time for the requests getting retried.
*Default*: `0` | -| `backoffFactor` | `int64` | Used in calculation of wait time for next request in case of failure.
*Default*: `2` | -| `httpStatusCodesToRetry` | `[]int64` | Http status codes to retry against.
*Default*: `[]int64{408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524}` | -| `httpMethodsToRetry` | `[]string` | Http methods to retry against.
*Default*: `[]string{"GET", "PUT", "GET", "PUT"}` | - -The retryConfiguration can be initialized as follows: - + +# RetryConfiguration + +The following parameters are configurable for the RetryConfiguration: + +## Properties + +| Name | Type | Description | +| --- | --- | --- | +| `maxRetryAttempts` | `int64` | Maximum number of retries.
*Default*: `0` | +| `retryOnTimeout` | `bool` | Whether to retry on request timeout.
*Default*: `true` | +| `retryInterval` | `time.Duration` | Interval before next retry. Used in calculation of wait time for next request in case of failure.
*Default*: `1` | +| `maximumRetryWaitTime` | `time.Duration` | Overall wait time for the requests getting retried.
*Default*: `0` | +| `backoffFactor` | `int64` | Used in calculation of wait time for next request in case of failure.
*Default*: `2` | +| `httpStatusCodesToRetry` | `[]int64` | Http status codes to retry against.
*Default*: `[]int64{408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524}` | +| `httpMethodsToRetry` | `[]string` | Http methods to retry against.
*Default*: `[]string{"GET", "PUT", "GET", "PUT"}` | + +The retryConfiguration can be initialized as follows: + ```go retryConfiguration := CreateRetryConfiguration( advancedbilling.WithMaxRetryAttempts(0), @@ -27,5 +27,5 @@ retryConfiguration := CreateRetryConfiguration( advancedbilling.WithHttpStatusCodesToRetry([]int64{408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524}), advancedbilling.WithHttpMethodsToRetry([]string{"GET", "PUT", "GET", "PUT"}), ) -``` - +``` + diff --git a/errors/errors.go b/errors/errors.go index b684db43..03308172 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -1,570 +1,570 @@ -/* -Package advancedbilling - -This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). +/* +Package advancedbilling + +This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ package errors import ( - "fmt" - "github.com/apimatic/go-core-runtime/apiError" - "github.com/maxio-com/ab-golang-sdk/models" + "fmt" + "github.com/apimatic/go-core-runtime/apiError" + "github.com/maxio-com/ab-golang-sdk/models" ) -var NewApiError = apiError.NewApiError +var NewApiError = apiError.NewApiError -// ErrorListResponse is a custom error. -// Error which contains list of messages. -type ErrorListResponse struct { - apiError.ApiError - Errors []string `json:"errors"` +// ComponentAllocationError is a custom error. +type ComponentAllocationError struct { + apiError.ApiError + Errors []models.ComponentAllocationErrorItem `json:"errors,omitempty"` } -// NewErrorListResponse is a constructor for ErrorListResponse. -// It creates and returns a pointer to a new ErrorListResponse instance with the given statusCode and body. -func NewErrorListResponse( - statusCode int, - body string) *ErrorListResponse { - return &ErrorListResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewComponentAllocationError is a constructor for ComponentAllocationError. +// It creates and returns a pointer to a new ComponentAllocationError instance with the given statusCode and body. +func NewComponentAllocationError( + statusCode int, + body string) *ComponentAllocationError { + return &ComponentAllocationError{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ErrorListResponse. -func (e *ErrorListResponse) Error() string { - return fmt.Sprintf("ErrorListResponse occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ComponentAllocationError. +func (c *ComponentAllocationError) Error() string { + return fmt.Sprintf("ComponentAllocationError occured %v", c.Body) +} + +// ComponentPricePointError is a custom error. +type ComponentPricePointError struct { + apiError.ApiError + Errors []models.ComponentPricePointErrorItem `json:"errors,omitempty"` +} + +// NewComponentPricePointError is a constructor for ComponentPricePointError. +// It creates and returns a pointer to a new ComponentPricePointError instance with the given statusCode and body. +func NewComponentPricePointError( + statusCode int, + body string) *ComponentPricePointError { + return &ComponentPricePointError{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } +} + +// Error implements the Error method for the error interface. +// It returns a formatted error message for ComponentPricePointError. +func (c *ComponentPricePointError) Error() string { + return fmt.Sprintf("ComponentPricePointError occured %v", c.Body) } // CustomerErrorResponse is a custom error. type CustomerErrorResponse struct { - apiError.ApiError - Errors *interface{} `json:"errors,omitempty"` + apiError.ApiError + Errors *interface{} `json:"errors,omitempty"` } -// NewCustomerErrorResponse is a constructor for CustomerErrorResponse. +// NewCustomerErrorResponse is a constructor for CustomerErrorResponse. // It creates and returns a pointer to a new CustomerErrorResponse instance with the given statusCode and body. func NewCustomerErrorResponse( - statusCode int, - body string) *CustomerErrorResponse { - return &CustomerErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } + statusCode int, + body string) *CustomerErrorResponse { + return &CustomerErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. +// Error implements the Error method for the error interface. // It returns a formatted error message for CustomerErrorResponse. func (c *CustomerErrorResponse) Error() string { - return fmt.Sprintf("CustomerErrorResponse occured %v", c.Body) + return fmt.Sprintf("CustomerErrorResponse occured %v", c.Body) } -// TooManyManagementLinkRequestsError is a custom error. -type TooManyManagementLinkRequestsError struct { - apiError.ApiError - Errors models.TooManyManagementLinkRequests `json:"errors"` +// ErrorArrayMapResponse is a custom error. +type ErrorArrayMapResponse struct { + apiError.ApiError + Errors map[string]interface{} `json:"errors,omitempty"` } -// NewTooManyManagementLinkRequestsError is a constructor for TooManyManagementLinkRequestsError. -// It creates and returns a pointer to a new TooManyManagementLinkRequestsError instance with the given statusCode and body. -func NewTooManyManagementLinkRequestsError( - statusCode int, - body string) *TooManyManagementLinkRequestsError { - return &TooManyManagementLinkRequestsError{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewErrorArrayMapResponse is a constructor for ErrorArrayMapResponse. +// It creates and returns a pointer to a new ErrorArrayMapResponse instance with the given statusCode and body. +func NewErrorArrayMapResponse( + statusCode int, + body string) *ErrorArrayMapResponse { + return &ErrorArrayMapResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for TooManyManagementLinkRequestsError. -func (t *TooManyManagementLinkRequestsError) Error() string { - return fmt.Sprintf("TooManyManagementLinkRequestsError occured %v", t.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ErrorArrayMapResponse. +func (e *ErrorArrayMapResponse) Error() string { + return fmt.Sprintf("ErrorArrayMapResponse occured %v", e.Body) } -// SingleStringErrorResponse is a custom error. -type SingleStringErrorResponse struct { - apiError.ApiError - Errors *string `json:"errors,omitempty"` +// ErrorListResponse is a custom error. +// Error which contains list of messages. +type ErrorListResponse struct { + apiError.ApiError + Errors []string `json:"errors"` } -// NewSingleStringErrorResponse is a constructor for SingleStringErrorResponse. -// It creates and returns a pointer to a new SingleStringErrorResponse instance with the given statusCode and body. -func NewSingleStringErrorResponse( - statusCode int, - body string) *SingleStringErrorResponse { - return &SingleStringErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewErrorListResponse is a constructor for ErrorListResponse. +// It creates and returns a pointer to a new ErrorListResponse instance with the given statusCode and body. +func NewErrorListResponse( + statusCode int, + body string) *ErrorListResponse { + return &ErrorListResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SingleStringErrorResponse. -func (s *SingleStringErrorResponse) Error() string { - return fmt.Sprintf("SingleStringErrorResponse occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ErrorListResponse. +func (e *ErrorListResponse) Error() string { + return fmt.Sprintf("ErrorListResponse occured %v", e.Body) } -// SingleErrorResponse is a custom error. -type SingleErrorResponse struct { - apiError.ApiError - MError string `json:"error"` +// ErrorStringMapResponse is a custom error. +type ErrorStringMapResponse struct { + apiError.ApiError + Errors map[string]string `json:"errors,omitempty"` } -// NewSingleErrorResponse is a constructor for SingleErrorResponse. -// It creates and returns a pointer to a new SingleErrorResponse instance with the given statusCode and body. -func NewSingleErrorResponse( - statusCode int, - body string) *SingleErrorResponse { - return &SingleErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewErrorStringMapResponse is a constructor for ErrorStringMapResponse. +// It creates and returns a pointer to a new ErrorStringMapResponse instance with the given statusCode and body. +func NewErrorStringMapResponse( + statusCode int, + body string) *ErrorStringMapResponse { + return &ErrorStringMapResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SingleErrorResponse. -func (s *SingleErrorResponse) Error() string { - return fmt.Sprintf("SingleErrorResponse occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ErrorStringMapResponse. +func (e *ErrorStringMapResponse) Error() string { + return fmt.Sprintf("ErrorStringMapResponse occured %v", e.Body) } -// ErrorArrayMapResponse is a custom error. -type ErrorArrayMapResponse struct { - apiError.ApiError - Errors map[string]interface{} `json:"errors,omitempty"` +// EventBasedBillingListSegmentsErrors is a custom error. +type EventBasedBillingListSegmentsErrors struct { + apiError.ApiError + Errors *models.Errors `json:"errors,omitempty"` } -// NewErrorArrayMapResponse is a constructor for ErrorArrayMapResponse. -// It creates and returns a pointer to a new ErrorArrayMapResponse instance with the given statusCode and body. -func NewErrorArrayMapResponse( - statusCode int, - body string) *ErrorArrayMapResponse { - return &ErrorArrayMapResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewEventBasedBillingListSegmentsErrors is a constructor for EventBasedBillingListSegmentsErrors. +// It creates and returns a pointer to a new EventBasedBillingListSegmentsErrors instance with the given statusCode and body. +func NewEventBasedBillingListSegmentsErrors( + statusCode int, + body string) *EventBasedBillingListSegmentsErrors { + return &EventBasedBillingListSegmentsErrors{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ErrorArrayMapResponse. -func (e *ErrorArrayMapResponse) Error() string { - return fmt.Sprintf("ErrorArrayMapResponse occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for EventBasedBillingListSegmentsErrors. +func (e *EventBasedBillingListSegmentsErrors) Error() string { + return fmt.Sprintf("EventBasedBillingListSegmentsErrors occured %v", e.Body) } -// ProductPricePointErrorResponse is a custom error. -type ProductPricePointErrorResponse struct { - apiError.ApiError - Errors models.ProductPricePointErrors `json:"errors"` +// EventBasedBillingSegment is a custom error. +type EventBasedBillingSegment struct { + apiError.ApiError + Errors models.EventBasedBillingSegmentError `json:"errors"` } -// NewProductPricePointErrorResponse is a constructor for ProductPricePointErrorResponse. -// It creates and returns a pointer to a new ProductPricePointErrorResponse instance with the given statusCode and body. -func NewProductPricePointErrorResponse( - statusCode int, - body string) *ProductPricePointErrorResponse { - return &ProductPricePointErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewEventBasedBillingSegment is a constructor for EventBasedBillingSegment. +// It creates and returns a pointer to a new EventBasedBillingSegment instance with the given statusCode and body. +func NewEventBasedBillingSegment( + statusCode int, + body string) *EventBasedBillingSegment { + return &EventBasedBillingSegment{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ProductPricePointErrorResponse. -func (p *ProductPricePointErrorResponse) Error() string { - return fmt.Sprintf("ProductPricePointErrorResponse occured %v", p.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for EventBasedBillingSegment. +func (e *EventBasedBillingSegment) Error() string { + return fmt.Sprintf("EventBasedBillingSegment occured %v", e.Body) } -// ErrorStringMapResponse is a custom error. -type ErrorStringMapResponse struct { - apiError.ApiError - Errors map[string]string `json:"errors,omitempty"` +// EventBasedBillingSegmentErrors is a custom error. +type EventBasedBillingSegmentErrors struct { + apiError.ApiError + Errors map[string]interface{} `json:"errors,omitempty"` } -// NewErrorStringMapResponse is a constructor for ErrorStringMapResponse. -// It creates and returns a pointer to a new ErrorStringMapResponse instance with the given statusCode and body. -func NewErrorStringMapResponse( - statusCode int, - body string) *ErrorStringMapResponse { - return &ErrorStringMapResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewEventBasedBillingSegmentErrors is a constructor for EventBasedBillingSegmentErrors. +// It creates and returns a pointer to a new EventBasedBillingSegmentErrors instance with the given statusCode and body. +func NewEventBasedBillingSegmentErrors( + statusCode int, + body string) *EventBasedBillingSegmentErrors { + return &EventBasedBillingSegmentErrors{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ErrorStringMapResponse. -func (e *ErrorStringMapResponse) Error() string { - return fmt.Sprintf("ErrorStringMapResponse occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for EventBasedBillingSegmentErrors. +func (e *EventBasedBillingSegmentErrors) Error() string { + return fmt.Sprintf("EventBasedBillingSegmentErrors occured %v", e.Body) } -// ComponentPricePointError is a custom error. -type ComponentPricePointError struct { - apiError.ApiError - Errors []models.ComponentPricePointErrorItem `json:"errors,omitempty"` +// ProductPricePointErrorResponse is a custom error. +type ProductPricePointErrorResponse struct { + apiError.ApiError + Errors models.ProductPricePointErrors `json:"errors"` } -// NewComponentPricePointError is a constructor for ComponentPricePointError. -// It creates and returns a pointer to a new ComponentPricePointError instance with the given statusCode and body. -func NewComponentPricePointError( - statusCode int, - body string) *ComponentPricePointError { - return &ComponentPricePointError{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewProductPricePointErrorResponse is a constructor for ProductPricePointErrorResponse. +// It creates and returns a pointer to a new ProductPricePointErrorResponse instance with the given statusCode and body. +func NewProductPricePointErrorResponse( + statusCode int, + body string) *ProductPricePointErrorResponse { + return &ProductPricePointErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ComponentPricePointError. -func (c *ComponentPricePointError) Error() string { - return fmt.Sprintf("ComponentPricePointError occured %v", c.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ProductPricePointErrorResponse. +func (p *ProductPricePointErrorResponse) Error() string { + return fmt.Sprintf("ProductPricePointErrorResponse occured %v", p.Body) } -// ComponentAllocationError is a custom error. -type ComponentAllocationError struct { - apiError.ApiError - Errors []models.ComponentAllocationErrorItem `json:"errors,omitempty"` +// ProformaBadRequestErrorResponse is a custom error. +type ProformaBadRequestErrorResponse struct { + apiError.ApiError + Errors *models.ProformaError `json:"errors,omitempty"` } -// NewComponentAllocationError is a constructor for ComponentAllocationError. -// It creates and returns a pointer to a new ComponentAllocationError instance with the given statusCode and body. -func NewComponentAllocationError( - statusCode int, - body string) *ComponentAllocationError { - return &ComponentAllocationError{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewProformaBadRequestErrorResponse is a constructor for ProformaBadRequestErrorResponse. +// It creates and returns a pointer to a new ProformaBadRequestErrorResponse instance with the given statusCode and body. +func NewProformaBadRequestErrorResponse( + statusCode int, + body string) *ProformaBadRequestErrorResponse { + return &ProformaBadRequestErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ComponentAllocationError. -func (c *ComponentAllocationError) Error() string { - return fmt.Sprintf("ComponentAllocationError occured %v", c.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for ProformaBadRequestErrorResponse. +func (p *ProformaBadRequestErrorResponse) Error() string { + return fmt.Sprintf("ProformaBadRequestErrorResponse occured %v", p.Body) } -// SubscriptionComponentAllocationError is a custom error. -type SubscriptionComponentAllocationError struct { - apiError.ApiError - Errors []models.SubscriptionComponentAllocationErrorItem `json:"errors,omitempty"` +// RefundPrepaymentAggregatedErrorsResponse is a custom error. +// Errors returned on creating a refund prepayment, grouped by field, as arrays of strings. +type RefundPrepaymentAggregatedErrorsResponse struct { + apiError.ApiError + Errors *models.RefundPrepaymentAggregatedError `json:"errors,omitempty"` } -// NewSubscriptionComponentAllocationError is a constructor for SubscriptionComponentAllocationError. -// It creates and returns a pointer to a new SubscriptionComponentAllocationError instance with the given statusCode and body. -func NewSubscriptionComponentAllocationError( - statusCode int, - body string) *SubscriptionComponentAllocationError { - return &SubscriptionComponentAllocationError{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewRefundPrepaymentAggregatedErrorsResponse is a constructor for RefundPrepaymentAggregatedErrorsResponse. +// It creates and returns a pointer to a new RefundPrepaymentAggregatedErrorsResponse instance with the given statusCode and body. +func NewRefundPrepaymentAggregatedErrorsResponse( + statusCode int, + body string) *RefundPrepaymentAggregatedErrorsResponse { + return &RefundPrepaymentAggregatedErrorsResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SubscriptionComponentAllocationError. -func (s *SubscriptionComponentAllocationError) Error() string { - return fmt.Sprintf("SubscriptionComponentAllocationError occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for RefundPrepaymentAggregatedErrorsResponse. +func (r *RefundPrepaymentAggregatedErrorsResponse) Error() string { + return fmt.Sprintf("RefundPrepaymentAggregatedErrorsResponse occured %v", r.Body) } -// SubscriptionGroupSignupErrorResponse is a custom error. -type SubscriptionGroupSignupErrorResponse struct { - apiError.ApiError - Errors models.SubscriptionGroupSignupError `json:"errors"` +// RefundPrepaymentBaseErrorsResponse is a custom error. +// Errors returned on creating a refund prepayment when bad request +type RefundPrepaymentBaseErrorsResponse struct { + apiError.ApiError + Errors *models.RefundPrepaymentBaseRefundError `json:"errors,omitempty"` } -// NewSubscriptionGroupSignupErrorResponse is a constructor for SubscriptionGroupSignupErrorResponse. -// It creates and returns a pointer to a new SubscriptionGroupSignupErrorResponse instance with the given statusCode and body. -func NewSubscriptionGroupSignupErrorResponse( - statusCode int, - body string) *SubscriptionGroupSignupErrorResponse { - return &SubscriptionGroupSignupErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewRefundPrepaymentBaseErrorsResponse is a constructor for RefundPrepaymentBaseErrorsResponse. +// It creates and returns a pointer to a new RefundPrepaymentBaseErrorsResponse instance with the given statusCode and body. +func NewRefundPrepaymentBaseErrorsResponse( + statusCode int, + body string) *RefundPrepaymentBaseErrorsResponse { + return &RefundPrepaymentBaseErrorsResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SubscriptionGroupSignupErrorResponse. -func (s *SubscriptionGroupSignupErrorResponse) Error() string { - return fmt.Sprintf("SubscriptionGroupSignupErrorResponse occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for RefundPrepaymentBaseErrorsResponse. +func (r *RefundPrepaymentBaseErrorsResponse) Error() string { + return fmt.Sprintf("RefundPrepaymentBaseErrorsResponse occured %v", r.Body) } -// SubscriptionGroupUpdateErrorResponse is a custom error. -type SubscriptionGroupUpdateErrorResponse struct { - apiError.ApiError - Errors *models.SubscriptionGroupUpdateError `json:"errors,omitempty"` +// SingleErrorResponse is a custom error. +type SingleErrorResponse struct { + apiError.ApiError + MError string `json:"error"` } -// NewSubscriptionGroupUpdateErrorResponse is a constructor for SubscriptionGroupUpdateErrorResponse. -// It creates and returns a pointer to a new SubscriptionGroupUpdateErrorResponse instance with the given statusCode and body. -func NewSubscriptionGroupUpdateErrorResponse( - statusCode int, - body string) *SubscriptionGroupUpdateErrorResponse { - return &SubscriptionGroupUpdateErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewSingleErrorResponse is a constructor for SingleErrorResponse. +// It creates and returns a pointer to a new SingleErrorResponse instance with the given statusCode and body. +func NewSingleErrorResponse( + statusCode int, + body string) *SingleErrorResponse { + return &SingleErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SubscriptionGroupUpdateErrorResponse. -func (s *SubscriptionGroupUpdateErrorResponse) Error() string { - return fmt.Sprintf("SubscriptionGroupUpdateErrorResponse occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for SingleErrorResponse. +func (s *SingleErrorResponse) Error() string { + return fmt.Sprintf("SingleErrorResponse occured %v", s.Body) +} + +// SingleStringErrorResponse is a custom error. +type SingleStringErrorResponse struct { + apiError.ApiError + Errors *string `json:"errors,omitempty"` +} + +// NewSingleStringErrorResponse is a constructor for SingleStringErrorResponse. +// It creates and returns a pointer to a new SingleStringErrorResponse instance with the given statusCode and body. +func NewSingleStringErrorResponse( + statusCode int, + body string) *SingleStringErrorResponse { + return &SingleStringErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } +} + +// Error implements the Error method for the error interface. +// It returns a formatted error message for SingleStringErrorResponse. +func (s *SingleStringErrorResponse) Error() string { + return fmt.Sprintf("SingleStringErrorResponse occured %v", s.Body) } // SubscriptionAddCouponError is a custom error. type SubscriptionAddCouponError struct { - apiError.ApiError - Codes []string `json:"codes,omitempty"` - CouponCode []string `json:"coupon_code,omitempty"` - CouponCodes []string `json:"coupon_codes,omitempty"` - Subscription []string `json:"subscription,omitempty"` + apiError.ApiError + Codes []string `json:"codes,omitempty"` + CouponCode []string `json:"coupon_code,omitempty"` + CouponCodes []string `json:"coupon_codes,omitempty"` + Subscription []string `json:"subscription,omitempty"` } -// NewSubscriptionAddCouponError is a constructor for SubscriptionAddCouponError. +// NewSubscriptionAddCouponError is a constructor for SubscriptionAddCouponError. // It creates and returns a pointer to a new SubscriptionAddCouponError instance with the given statusCode and body. func NewSubscriptionAddCouponError( - statusCode int, - body string) *SubscriptionAddCouponError { - return &SubscriptionAddCouponError{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } + statusCode int, + body string) *SubscriptionAddCouponError { + return &SubscriptionAddCouponError{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. +// Error implements the Error method for the error interface. // It returns a formatted error message for SubscriptionAddCouponError. func (s *SubscriptionAddCouponError) Error() string { - return fmt.Sprintf("SubscriptionAddCouponError occured %v", s.Body) + return fmt.Sprintf("SubscriptionAddCouponError occured %v", s.Body) } -// SubscriptionRemoveCouponErrors is a custom error. -type SubscriptionRemoveCouponErrors struct { - apiError.ApiError - Subscription []string `json:"subscription"` +// SubscriptionComponentAllocationError is a custom error. +type SubscriptionComponentAllocationError struct { + apiError.ApiError + Errors []models.SubscriptionComponentAllocationErrorItem `json:"errors,omitempty"` } -// NewSubscriptionRemoveCouponErrors is a constructor for SubscriptionRemoveCouponErrors. -// It creates and returns a pointer to a new SubscriptionRemoveCouponErrors instance with the given statusCode and body. -func NewSubscriptionRemoveCouponErrors( - statusCode int, - body string) *SubscriptionRemoveCouponErrors { - return &SubscriptionRemoveCouponErrors{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewSubscriptionComponentAllocationError is a constructor for SubscriptionComponentAllocationError. +// It creates and returns a pointer to a new SubscriptionComponentAllocationError instance with the given statusCode and body. +func NewSubscriptionComponentAllocationError( + statusCode int, + body string) *SubscriptionComponentAllocationError { + return &SubscriptionComponentAllocationError{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for SubscriptionRemoveCouponErrors. -func (s *SubscriptionRemoveCouponErrors) Error() string { - return fmt.Sprintf("SubscriptionRemoveCouponErrors occured %v", s.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for SubscriptionComponentAllocationError. +func (s *SubscriptionComponentAllocationError) Error() string { + return fmt.Sprintf("SubscriptionComponentAllocationError occured %v", s.Body) } -// EventBasedBillingSegmentErrors is a custom error. -type EventBasedBillingSegmentErrors struct { - apiError.ApiError - Errors map[string]interface{} `json:"errors,omitempty"` +// SubscriptionGroupSignupErrorResponse is a custom error. +type SubscriptionGroupSignupErrorResponse struct { + apiError.ApiError + Errors models.SubscriptionGroupSignupError `json:"errors"` } -// NewEventBasedBillingSegmentErrors is a constructor for EventBasedBillingSegmentErrors. -// It creates and returns a pointer to a new EventBasedBillingSegmentErrors instance with the given statusCode and body. -func NewEventBasedBillingSegmentErrors( - statusCode int, - body string) *EventBasedBillingSegmentErrors { - return &EventBasedBillingSegmentErrors{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewSubscriptionGroupSignupErrorResponse is a constructor for SubscriptionGroupSignupErrorResponse. +// It creates and returns a pointer to a new SubscriptionGroupSignupErrorResponse instance with the given statusCode and body. +func NewSubscriptionGroupSignupErrorResponse( + statusCode int, + body string) *SubscriptionGroupSignupErrorResponse { + return &SubscriptionGroupSignupErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for EventBasedBillingSegmentErrors. -func (e *EventBasedBillingSegmentErrors) Error() string { - return fmt.Sprintf("EventBasedBillingSegmentErrors occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for SubscriptionGroupSignupErrorResponse. +func (s *SubscriptionGroupSignupErrorResponse) Error() string { + return fmt.Sprintf("SubscriptionGroupSignupErrorResponse occured %v", s.Body) } -// EventBasedBillingListSegmentsErrors is a custom error. -type EventBasedBillingListSegmentsErrors struct { - apiError.ApiError - Errors *models.Errors `json:"errors,omitempty"` +// SubscriptionGroupUpdateErrorResponse is a custom error. +type SubscriptionGroupUpdateErrorResponse struct { + apiError.ApiError + Errors *models.SubscriptionGroupUpdateError `json:"errors,omitempty"` } -// NewEventBasedBillingListSegmentsErrors is a constructor for EventBasedBillingListSegmentsErrors. -// It creates and returns a pointer to a new EventBasedBillingListSegmentsErrors instance with the given statusCode and body. -func NewEventBasedBillingListSegmentsErrors( - statusCode int, - body string) *EventBasedBillingListSegmentsErrors { - return &EventBasedBillingListSegmentsErrors{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewSubscriptionGroupUpdateErrorResponse is a constructor for SubscriptionGroupUpdateErrorResponse. +// It creates and returns a pointer to a new SubscriptionGroupUpdateErrorResponse instance with the given statusCode and body. +func NewSubscriptionGroupUpdateErrorResponse( + statusCode int, + body string) *SubscriptionGroupUpdateErrorResponse { + return &SubscriptionGroupUpdateErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for EventBasedBillingListSegmentsErrors. -func (e *EventBasedBillingListSegmentsErrors) Error() string { - return fmt.Sprintf("EventBasedBillingListSegmentsErrors occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for SubscriptionGroupUpdateErrorResponse. +func (s *SubscriptionGroupUpdateErrorResponse) Error() string { + return fmt.Sprintf("SubscriptionGroupUpdateErrorResponse occured %v", s.Body) } -// EventBasedBillingSegment is a custom error. -type EventBasedBillingSegment struct { - apiError.ApiError - Errors models.EventBasedBillingSegmentError `json:"errors"` +// SubscriptionRemoveCouponErrors is a custom error. +type SubscriptionRemoveCouponErrors struct { + apiError.ApiError + Subscription []string `json:"subscription"` } -// NewEventBasedBillingSegment is a constructor for EventBasedBillingSegment. -// It creates and returns a pointer to a new EventBasedBillingSegment instance with the given statusCode and body. -func NewEventBasedBillingSegment( - statusCode int, - body string) *EventBasedBillingSegment { - return &EventBasedBillingSegment{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewSubscriptionRemoveCouponErrors is a constructor for SubscriptionRemoveCouponErrors. +// It creates and returns a pointer to a new SubscriptionRemoveCouponErrors instance with the given statusCode and body. +func NewSubscriptionRemoveCouponErrors( + statusCode int, + body string) *SubscriptionRemoveCouponErrors { + return &SubscriptionRemoveCouponErrors{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for EventBasedBillingSegment. -func (e *EventBasedBillingSegment) Error() string { - return fmt.Sprintf("EventBasedBillingSegment occured %v", e.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for SubscriptionRemoveCouponErrors. +func (s *SubscriptionRemoveCouponErrors) Error() string { + return fmt.Sprintf("SubscriptionRemoveCouponErrors occured %v", s.Body) } // SubscriptionsMrrErrorResponse is a custom error. type SubscriptionsMrrErrorResponse struct { - apiError.ApiError - Errors models.AttributeError `json:"errors"` + apiError.ApiError + Errors models.AttributeError `json:"errors"` } -// NewSubscriptionsMrrErrorResponse is a constructor for SubscriptionsMrrErrorResponse. +// NewSubscriptionsMrrErrorResponse is a constructor for SubscriptionsMrrErrorResponse. // It creates and returns a pointer to a new SubscriptionsMrrErrorResponse instance with the given statusCode and body. func NewSubscriptionsMrrErrorResponse( - statusCode int, - body string) *SubscriptionsMrrErrorResponse { - return &SubscriptionsMrrErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } + statusCode int, + body string) *SubscriptionsMrrErrorResponse { + return &SubscriptionsMrrErrorResponse{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. +// Error implements the Error method for the error interface. // It returns a formatted error message for SubscriptionsMrrErrorResponse. func (s *SubscriptionsMrrErrorResponse) Error() string { - return fmt.Sprintf("SubscriptionsMrrErrorResponse occured %v", s.Body) -} - -// RefundPrepaymentBaseErrorsResponse is a custom error. -// Errors returned on creating a refund prepayment when bad request -type RefundPrepaymentBaseErrorsResponse struct { - apiError.ApiError - Errors *models.RefundPrepaymentBaseRefundError `json:"errors,omitempty"` + return fmt.Sprintf("SubscriptionsMrrErrorResponse occured %v", s.Body) } -// NewRefundPrepaymentBaseErrorsResponse is a constructor for RefundPrepaymentBaseErrorsResponse. -// It creates and returns a pointer to a new RefundPrepaymentBaseErrorsResponse instance with the given statusCode and body. -func NewRefundPrepaymentBaseErrorsResponse( - statusCode int, - body string) *RefundPrepaymentBaseErrorsResponse { - return &RefundPrepaymentBaseErrorsResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } -} - -// Error implements the Error method for the error interface. -// It returns a formatted error message for RefundPrepaymentBaseErrorsResponse. -func (r *RefundPrepaymentBaseErrorsResponse) Error() string { - return fmt.Sprintf("RefundPrepaymentBaseErrorsResponse occured %v", r.Body) -} - -// RefundPrepaymentAggregatedErrorsResponse is a custom error. -// Errors returned on creating a refund prepayment, grouped by field, as arrays of strings. -type RefundPrepaymentAggregatedErrorsResponse struct { - apiError.ApiError - Errors *models.RefundPrepaymentAggregatedError `json:"errors,omitempty"` -} - -// NewRefundPrepaymentAggregatedErrorsResponse is a constructor for RefundPrepaymentAggregatedErrorsResponse. -// It creates and returns a pointer to a new RefundPrepaymentAggregatedErrorsResponse instance with the given statusCode and body. -func NewRefundPrepaymentAggregatedErrorsResponse( - statusCode int, - body string) *RefundPrepaymentAggregatedErrorsResponse { - return &RefundPrepaymentAggregatedErrorsResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } -} - -// Error implements the Error method for the error interface. -// It returns a formatted error message for RefundPrepaymentAggregatedErrorsResponse. -func (r *RefundPrepaymentAggregatedErrorsResponse) Error() string { - return fmt.Sprintf("RefundPrepaymentAggregatedErrorsResponse occured %v", r.Body) -} - -// ProformaBadRequestErrorResponse is a custom error. -type ProformaBadRequestErrorResponse struct { - apiError.ApiError - Errors *models.ProformaError `json:"errors,omitempty"` +// TooManyManagementLinkRequestsError is a custom error. +type TooManyManagementLinkRequestsError struct { + apiError.ApiError + Errors models.TooManyManagementLinkRequests `json:"errors"` } -// NewProformaBadRequestErrorResponse is a constructor for ProformaBadRequestErrorResponse. -// It creates and returns a pointer to a new ProformaBadRequestErrorResponse instance with the given statusCode and body. -func NewProformaBadRequestErrorResponse( - statusCode int, - body string) *ProformaBadRequestErrorResponse { - return &ProformaBadRequestErrorResponse{ - ApiError: apiError.ApiError{ - StatusCode: statusCode, - Body: body, - }, - } +// NewTooManyManagementLinkRequestsError is a constructor for TooManyManagementLinkRequestsError. +// It creates and returns a pointer to a new TooManyManagementLinkRequestsError instance with the given statusCode and body. +func NewTooManyManagementLinkRequestsError( + statusCode int, + body string) *TooManyManagementLinkRequestsError { + return &TooManyManagementLinkRequestsError{ + ApiError: apiError.ApiError{ + StatusCode: statusCode, + Body: body, + }, + } } -// Error implements the Error method for the error interface. -// It returns a formatted error message for ProformaBadRequestErrorResponse. -func (p *ProformaBadRequestErrorResponse) Error() string { - return fmt.Sprintf("ProformaBadRequestErrorResponse occured %v", p.Body) +// Error implements the Error method for the error interface. +// It returns a formatted error message for TooManyManagementLinkRequestsError. +func (t *TooManyManagementLinkRequestsError) Error() string { + return fmt.Sprintf("TooManyManagementLinkRequestsError occured %v", t.Body) } diff --git a/events_based_billing_segments_controller.go b/events_based_billing_segments_controller.go index e95dd30b..c737a78e 100644 --- a/events_based_billing_segments_controller.go +++ b/events_based_billing_segments_controller.go @@ -1,316 +1,316 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // EventsBasedBillingSegmentsController represents a controller struct. type EventsBasedBillingSegmentsController struct { - baseController + baseController } -// NewEventsBasedBillingSegmentsController creates a new instance of EventsBasedBillingSegmentsController. +// NewEventsBasedBillingSegmentsController creates a new instance of EventsBasedBillingSegmentsController. // It takes a baseController as a parameter and returns a pointer to the EventsBasedBillingSegmentsController. func NewEventsBasedBillingSegmentsController(baseController baseController) *EventsBasedBillingSegmentsController { - eventsBasedBillingSegmentsController := EventsBasedBillingSegmentsController{baseController: baseController} - return &eventsBasedBillingSegmentsController + eventsBasedBillingSegmentsController := EventsBasedBillingSegmentsController{baseController: baseController} + return &eventsBasedBillingSegmentsController } -// CreateSegment takes context, componentId, pricePointId, body as parameters and -// returns an models.ApiResponse with models.SegmentResponse data and -// an error if there was an issue with the request or response. -// This endpoint creates a new Segment for a Component with segmented Metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined. +// CreateSegment takes context, componentId, pricePointId, body as parameters and +// returns an models.ApiResponse with models.SegmentResponse data and +// an error if there was an issue with the request or response. +// This endpoint creates a new Segment for a Component with segmented Metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined. // You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. func (e *EventsBasedBillingSegmentsController) CreateSegment( - ctx context.Context, - componentId string, - pricePointId string, - body *models.CreateSegmentRequest) ( - models.ApiResponse[models.SegmentResponse], - error) { - req := e.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/components/%v/price_points/%v/segments.json", componentId, pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SegmentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SegmentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewEventBasedBillingSegmentErrors(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId string, + pricePointId string, + body *models.CreateSegmentRequest) ( + models.ApiResponse[models.SegmentResponse], + error) { + req := e.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/components/%v/price_points/%v/segments.json", componentId, pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SegmentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SegmentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewEventBasedBillingSegmentErrors(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListSegmentsForPricePoint takes context, componentId, pricePointId, page, perPage, filterSegmentProperty1Value, filterSegmentProperty2Value, filterSegmentProperty3Value, filterSegmentProperty4Value as parameters and -// returns an models.ApiResponse with models.ListSegmentsResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to fetch Segments created for a given Price Point. They will be returned in the order of creation. -// You can pass `page` and `per_page` parameters in order to access all of the segments. By default it will return `30` records. You can set `per_page` to `200` at most. +// ListSegmentsForPricePoint takes context, componentId, pricePointId, page, perPage, filterSegmentProperty1Value, filterSegmentProperty2Value, filterSegmentProperty3Value, filterSegmentProperty4Value as parameters and +// returns an models.ApiResponse with models.ListSegmentsResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to fetch Segments created for a given Price Point. They will be returned in the order of creation. +// You can pass `page` and `per_page` parameters in order to access all of the segments. By default it will return `30` records. You can set `per_page` to `200` at most. // You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. func (e *EventsBasedBillingSegmentsController) ListSegmentsForPricePoint( - ctx context.Context, - componentId string, - pricePointId string, - page *int, - perPage *int, - filterSegmentProperty1Value *string, - filterSegmentProperty2Value *string, - filterSegmentProperty3Value *string, - filterSegmentProperty4Value *string) ( - models.ApiResponse[models.ListSegmentsResponse], - error) { - req := e.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/components/%v/price_points/%v/segments.json", componentId, pricePointId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterSegmentProperty1Value != nil { - req.QueryParam("filter[segment_property_1_value]", *filterSegmentProperty1Value) - } - if filterSegmentProperty2Value != nil { - req.QueryParam("filter[segment_property_2_value]", *filterSegmentProperty2Value) - } - if filterSegmentProperty3Value != nil { - req.QueryParam("filter[segment_property_3_value]", *filterSegmentProperty3Value) - } - if filterSegmentProperty4Value != nil { - req.QueryParam("filter[segment_property_4_value]", *filterSegmentProperty4Value) - } - - var result models.ListSegmentsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewEventBasedBillingListSegmentsErrors(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId string, + pricePointId string, + page *int, + perPage *int, + filterSegmentProperty1Value *string, + filterSegmentProperty2Value *string, + filterSegmentProperty3Value *string, + filterSegmentProperty4Value *string) ( + models.ApiResponse[models.ListSegmentsResponse], + error) { + req := e.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/components/%v/price_points/%v/segments.json", componentId, pricePointId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterSegmentProperty1Value != nil { + req.QueryParam("filter[segment_property_1_value]", *filterSegmentProperty1Value) + } + if filterSegmentProperty2Value != nil { + req.QueryParam("filter[segment_property_2_value]", *filterSegmentProperty2Value) + } + if filterSegmentProperty3Value != nil { + req.QueryParam("filter[segment_property_3_value]", *filterSegmentProperty3Value) + } + if filterSegmentProperty4Value != nil { + req.QueryParam("filter[segment_property_4_value]", *filterSegmentProperty4Value) + } + + var result models.ListSegmentsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewEventBasedBillingListSegmentsErrors(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateSegment takes context, componentId, pricePointId, id, body as parameters and -// returns an models.ApiResponse with models.SegmentResponse data and -// an error if there was an issue with the request or response. -// This endpoint updates a single Segment for a Component with a segmented Metric. It allows you to update the pricing for the segment. +// UpdateSegment takes context, componentId, pricePointId, id, body as parameters and +// returns an models.ApiResponse with models.SegmentResponse data and +// an error if there was an issue with the request or response. +// This endpoint 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 or the `handle:gold` syntax. func (e *EventsBasedBillingSegmentsController) UpdateSegment( - ctx context.Context, - componentId string, - pricePointId string, - id float64, - body *models.UpdateSegmentRequest) ( - models.ApiResponse[models.SegmentResponse], - error) { - req := e.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v/price_points/%v/segments/%v.json", componentId, pricePointId, id), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SegmentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SegmentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewEventBasedBillingSegmentErrors(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + componentId string, + pricePointId string, + id float64, + body *models.UpdateSegmentRequest) ( + models.ApiResponse[models.SegmentResponse], + error) { + req := e.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v/price_points/%v/segments/%v.json", componentId, pricePointId, id), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SegmentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SegmentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewEventBasedBillingSegmentErrors(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteSegment takes context, componentId, pricePointId, id as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This endpoint allows you to delete a Segment with specified ID. +// DeleteSegment takes context, componentId, pricePointId, id as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This endpoint allows you to delete a Segment with specified ID. // You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. func (e *EventsBasedBillingSegmentsController) DeleteSegment( - ctx context.Context, - componentId string, - pricePointId string, - id float64) ( - *http.Response, - error) { - req := e.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/components/%v/price_points/%v/segments/%v.json", componentId, pricePointId, id), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if context.Response.StatusCode == 422 { - err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + componentId string, + pricePointId string, + id float64) ( + *http.Response, + error) { + req := e.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/components/%v/price_points/%v/segments/%v.json", componentId, pricePointId, id), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if context.Response.StatusCode == 422 { + err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// CreateSegments takes context, componentId, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ListSegmentsResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to create multiple segments in one request. The array of segments can contain up to `2000` records. -// If any of the records contain an error the whole request would fail and none of the requested segments get created. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. +// BulkCreateSegments takes context, componentId, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ListSegmentsResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to create multiple segments in one request. The array of segments can contain up to `2000` records. +// If any of the records contain an error the whole request would fail and none of the requested segments get created. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. // You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. -func (e *EventsBasedBillingSegmentsController) CreateSegments( - ctx context.Context, - componentId string, - pricePointId string, - body *models.BulkCreateSegments) ( - models.ApiResponse[models.ListSegmentsResponse], - error) { - req := e.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/components/%v/price_points/%v/segments/bulk.json", componentId, pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ListSegmentsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewEventBasedBillingSegment(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (e *EventsBasedBillingSegmentsController) BulkCreateSegments( + ctx context.Context, + componentId string, + pricePointId string, + body *models.BulkCreateSegments) ( + models.ApiResponse[models.ListSegmentsResponse], + error) { + req := e.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/components/%v/price_points/%v/segments/bulk.json", componentId, pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ListSegmentsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewEventBasedBillingSegment(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateSegments takes context, componentId, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ListSegmentsResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to update multiple segments in one request. The array of segments can contain up to `1000` records. -// If any of the records contain an error the whole request would fail and none of the requested segments get updated. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. +// BulkUpdateSegments takes context, componentId, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ListSegmentsResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to update multiple segments in one request. The array of segments can contain up to `1000` records. +// If any of the records contain an error the whole request would fail and none of the requested segments get updated. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. // You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. -func (e *EventsBasedBillingSegmentsController) UpdateSegments( - ctx context.Context, - componentId string, - pricePointId string, - body *models.BulkUpdateSegments) ( - models.ApiResponse[models.ListSegmentsResponse], - error) { - req := e.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/components/%v/price_points/%v/segments/bulk.json", componentId, pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ListSegmentsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewEventBasedBillingSegment(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (e *EventsBasedBillingSegmentsController) BulkUpdateSegments( + ctx context.Context, + componentId string, + pricePointId string, + body *models.BulkUpdateSegments) ( + models.ApiResponse[models.ListSegmentsResponse], + error) { + req := e.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/components/%v/price_points/%v/segments/bulk.json", componentId, pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ListSegmentsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSegmentsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewEventBasedBillingSegment(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/events_controller.go b/events_controller.go index 074b3ed4..02efa343 100644 --- a/events_controller.go +++ b/events_controller.go @@ -1,250 +1,250 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/models" ) // EventsController represents a controller struct. type EventsController struct { - baseController + baseController } -// NewEventsController creates a new instance of EventsController. +// NewEventsController creates a new instance of EventsController. // It takes a baseController as a parameter and returns a pointer to the EventsController. func NewEventsController(baseController baseController) *EventsController { - eventsController := EventsController{baseController: baseController} - return &eventsController + eventsController := EventsController{baseController: baseController} + return &eventsController } -// ListEvents takes context, page, perPage, sinceId, maxId, direction, filter, dateField, startDate, endDate, startDatetime, endDatetime as parameters and -// returns an models.ApiResponse with []models.EventResponse data and -// an error if there was an issue with the request or response. -// ## Events Intro -// Chargify 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 Chargify UI, "Events" are referred to as "Site Activity". Full documentation on how to record view Events / Site Activty in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407864698139). -// ## 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. -// ### Legacy Filters -// The following keys are no longer supported. -// + `payment_failure_recreated` -// + `payment_success_recreated` -// + `renewal_failure_recreated` -// + `renewal_success_recreated` -// + `zferral_revenue_post_failure` - (Specific to the deprecated Zferral integration) -// + `zferral_revenue_post_success` - (Specific to the deprecated Zferral integration) -// ## Event Specific Data -// Event Specific Data -// Each event type has its own `event_specific_data` specified. -// 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'", -// "subscription_id": 205, -// "event_specific_data": { -// "new_product_id": 3, -// "previous_product_id": 2 -// }, -// "created_at": "2012-01-30T10:43:31-05:00" -// } -// } -// ``` -// 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", -// "subscription_id": 205, -// "event_specific_data": { -// "new_subscription_state": "active", -// "previous_subscription_state": "trialing" -// }, -// "created_at": "2012-01-30T10:43:33-05:00" -// } -// } +// ListEvents takes context, page, perPage, sinceId, maxId, direction, filter, dateField, startDate, endDate, startDatetime, endDatetime as parameters and +// returns an models.ApiResponse with []models.EventResponse data and +// an error if there was an issue with the request or response. +// ## Events Intro +// Chargify 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 Chargify UI, "Events" are referred to as "Site Activity". Full documentation on how to record view Events / Site Activty in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407864698139). +// ## 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. +// ### Legacy Filters +// The following keys are no longer supported. +// + `payment_failure_recreated` +// + `payment_success_recreated` +// + `renewal_failure_recreated` +// + `renewal_success_recreated` +// + `zferral_revenue_post_failure` - (Specific to the deprecated Zferral integration) +// + `zferral_revenue_post_success` - (Specific to the deprecated Zferral integration) +// ## Event Specific Data +// Event Specific Data +// Each event type has its own `event_specific_data` specified. +// 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'", +// "subscription_id": 205, +// "event_specific_data": { +// "new_product_id": 3, +// "previous_product_id": 2 +// }, +// "created_at": "2012-01-30T10:43:31-05:00" +// } +// } +// ``` +// 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", +// "subscription_id": 205, +// "event_specific_data": { +// "new_subscription_state": "active", +// "previous_subscription_state": "trialing" +// }, +// "created_at": "2012-01-30T10:43:33-05:00" +// } +// } // ``` func (e *EventsController) ListEvents( - ctx context.Context, - page *int, - perPage *int, - sinceId *int, - maxId *int, - direction *models.Direction, - filter []models.EventType, - dateField *models.ListEventsDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string) ( - models.ApiResponse[[]models.EventResponse], - error) { - req := e.prepareRequest(ctx, "GET", "/events.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if sinceId != nil { - req.QueryParam("since_id", *sinceId) - } - if maxId != nil { - req.QueryParam("max_id", *maxId) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if filter != nil { - req.QueryParam("filter", filter) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - var result []models.EventResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.EventResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + sinceId *int, + maxId *int, + direction *models.Direction, + filter []models.EventType, + dateField *models.ListEventsDateField, + startDate *string, + endDate *string, + startDatetime *string, + endDatetime *string) ( + models.ApiResponse[[]models.EventResponse], + error) { + req := e.prepareRequest(ctx, "GET", "/events.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if sinceId != nil { + req.QueryParam("since_id", *sinceId) + } + if maxId != nil { + req.QueryParam("max_id", *maxId) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if filter != nil { + req.QueryParam("filter", filter) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + var result []models.EventResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.EventResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListSubscriptionEvents takes context, subscriptionId, page, perPage, sinceId, maxId, direction, filter as parameters and -// returns an models.ApiResponse with []models.EventResponse data and -// an error if there was an issue with the request or response. -// The following request will return a list of events for a subscription. +// ListSubscriptionEvents takes context, subscriptionId, page, perPage, sinceId, maxId, direction, filter as parameters and +// returns an models.ApiResponse with []models.EventResponse data and +// an error if there was an issue with the request or response. +// The following request will return a list of events for a subscription. // Each event type has its own `event_specific_data` specified. func (e *EventsController) ListSubscriptionEvents( - ctx context.Context, - subscriptionId int, - page *int, - perPage *int, - sinceId *int, - maxId *int, - direction *models.Direction, - filter []models.EventType) ( - models.ApiResponse[[]models.EventResponse], - error) { - req := e.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/events.json", subscriptionId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if sinceId != nil { - req.QueryParam("since_id", *sinceId) - } - if maxId != nil { - req.QueryParam("max_id", *maxId) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if filter != nil { - req.QueryParam("filter", filter) - } - - var result []models.EventResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.EventResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + page *int, + perPage *int, + sinceId *int, + maxId *int, + direction *models.Direction, + filter []models.EventType) ( + models.ApiResponse[[]models.EventResponse], + error) { + req := e.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/events.json", subscriptionId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if sinceId != nil { + req.QueryParam("since_id", *sinceId) + } + if maxId != nil { + req.QueryParam("max_id", *maxId) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if filter != nil { + req.QueryParam("filter", filter) + } + + var result []models.EventResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.EventResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadEventsCount takes context, page, perPage, sinceId, maxId, direction, filter as parameters and -// returns an models.ApiResponse with models.CountResponse data and -// an error if there was an issue with the request or response. +// ReadEventsCount takes context, page, perPage, sinceId, maxId, direction, filter as parameters and +// returns an models.ApiResponse with models.CountResponse data and +// an error if there was an issue with the request or response. // Get a count of all the events for a given site by using this method. func (e *EventsController) ReadEventsCount( - ctx context.Context, - page *int, - perPage *int, - sinceId *int, - maxId *int, - direction *models.Direction, - filter []models.EventType) ( - models.ApiResponse[models.CountResponse], - error) { - req := e.prepareRequest(ctx, "GET", "/events/count.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if sinceId != nil { - req.QueryParam("since_id", *sinceId) - } - if maxId != nil { - req.QueryParam("max_id", *maxId) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if filter != nil { - req.QueryParam("filter", filter) - } - var result models.CountResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CountResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + sinceId *int, + maxId *int, + direction *models.Direction, + filter []models.EventType) ( + models.ApiResponse[models.CountResponse], + error) { + req := e.prepareRequest(ctx, "GET", "/events/count.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if sinceId != nil { + req.QueryParam("since_id", *sinceId) + } + if maxId != nil { + req.QueryParam("max_id", *maxId) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if filter != nil { + req.QueryParam("filter", filter) + } + var result models.CountResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CountResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/go.mod b/go.mod index 2f5d1c9b..68e94a2f 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/maxio-com/ab-golang-sdk go 1.18 -require github.com/apimatic/go-core-runtime v0.0.13 +require github.com/apimatic/go-core-runtime v0.0.14 diff --git a/go.sum b/go.sum index 7c6a0d4a..0ba7ecb8 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/apimatic/go-core-runtime v0.0.13 h1:KBrOoUbgdIYbjH+TrQNXkbK7QGBovdX43wr7q5Ta6yE= -github.com/apimatic/go-core-runtime v0.0.13/go.mod h1:kyqGg2v3OTV7o2fXHgbHLZPMinqZvIqw1JwdEd64OzM= +github.com/apimatic/go-core-runtime v0.0.14 h1:haZq9sk9Z7gWZjnMHnTBnKcasY53prmyiNHHqWbc3dM= +github.com/apimatic/go-core-runtime v0.0.14/go.mod h1:kyqGg2v3OTV7o2fXHgbHLZPMinqZvIqw1JwdEd64OzM= diff --git a/insights_controller.go b/insights_controller.go index 2b53950d..7e29aa44 100644 --- a/insights_controller.go +++ b/insights_controller.go @@ -1,200 +1,200 @@ package advancedbilling import ( - "context" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "time" + "context" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "time" ) // InsightsController represents a controller struct. type InsightsController struct { - baseController + baseController } -// NewInsightsController creates a new instance of InsightsController. +// NewInsightsController creates a new instance of InsightsController. // It takes a baseController as a parameter and returns a pointer to the InsightsController. func NewInsightsController(baseController baseController) *InsightsController { - insightsController := InsightsController{baseController: baseController} - return &insightsController + insightsController := InsightsController{baseController: baseController} + return &insightsController } -// ReadSiteStats takes context as parameters and -// returns an models.ApiResponse with models.SiteSummary data and -// an error if there was an issue with the request or response. -// The Stats API is a very basic view of some Site-level stats. This API call only answers with JSON responses. An XML version is not provided. -// ## Stats Documentation -// There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats reposnse. -// ``` -// https://subdomain.chargify.com/dashboard +// ReadSiteStats takes context as parameters and +// returns an models.ApiResponse with models.SiteSummary data and +// an error if there was an issue with the request or response. +// The Stats API is a very basic view of some Site-level stats. This API call only answers with JSON responses. An XML version is not provided. +// ## Stats Documentation +// There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats reposnse. +// ``` +// https://subdomain.chargify.com/dashboard // ``` func (i *InsightsController) ReadSiteStats(ctx context.Context) ( - models.ApiResponse[models.SiteSummary], - error) { - req := i.prepareRequest(ctx, "GET", "/stats.json") - req.Authenticate(true) - var result models.SiteSummary - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SiteSummary](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + models.ApiResponse[models.SiteSummary], + error) { + req := i.prepareRequest(ctx, "GET", "/stats.json") + req.Authenticate(true) + var result models.SiteSummary + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SiteSummary](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadMrr takes context, atTime, subscriptionId as parameters and -// returns an models.ApiResponse with models.MRRResponse data and -// an error if there was an issue with the request or response. -// Deprecated: readMrr is deprecated +// ReadMrr takes context, atTime, subscriptionId as parameters and +// returns an models.ApiResponse with models.MRRResponse data and +// an error if there was an issue with the request or response. +// Deprecated: readMrr is deprecated // This endpoint returns your site's current MRR, including plan and usage breakouts. func (i *InsightsController) ReadMrr( - ctx context.Context, - atTime *time.Time, - subscriptionId *int) ( - models.ApiResponse[models.MRRResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/mrr.json") - req.Authenticate(true) - if atTime != nil { - req.QueryParam("at_time", atTime.Format(time.RFC3339)) - } - if subscriptionId != nil { - req.QueryParam("subscription_id", *subscriptionId) - } - var result models.MRRResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.MRRResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + atTime *time.Time, + subscriptionId *int) ( + models.ApiResponse[models.MRRResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/mrr.json") + req.Authenticate(true) + if atTime != nil { + req.QueryParam("at_time", atTime.Format(time.RFC3339)) + } + if subscriptionId != nil { + req.QueryParam("subscription_id", *subscriptionId) + } + var result models.MRRResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.MRRResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadMrrMovements takes context, subscriptionId, page, perPage, direction as parameters and -// returns an models.ApiResponse with models.ListMRRResponse data and -// an error if there was an issue with the request or response. -// Deprecated: readMrrMovements is deprecated -// This endpoint returns your site's MRR movements. -// ## Understanding MRR movements -// This endpoint will aid in accessing your site's [MRR Report](https://chargify.zendesk.com/hc/en-us/articles/4407838249627) data. -// Whenever a subscription event occurs that causes your site's MRR to change (such as a signup or upgrade), we record an MRR movement. These records are accessible via the MRR Movements endpoint. -// Each MRR Movement belongs to a subscription and contains a timestamp, category, and an amount. `line_items` represent the subscription's product configuration at the time of the movement. -// ### Plan & Usage Breakouts -// In the MRR Report UI, we support a setting to [include or exclude](https://chargify.zendesk.com/hc/en-us/articles/4407838249627#displaying-component-based-metered-usage-in-mrr) usage revenue. In the MRR APIs, responses include `plan` and `usage` breakouts. -// Plan includes revenue from: -// * Products -// * Quantity-Based Components -// * On/Off Components -// Usage includes revenue from: -// * Metered Components +// ListMrrMovements takes context, subscriptionId, page, perPage, direction as parameters and +// returns an models.ApiResponse with models.ListMRRResponse data and +// an error if there was an issue with the request or response. +// Deprecated: listMrrMovements is deprecated +// This endpoint returns your site's MRR movements. +// ## Understanding MRR movements +// This endpoint will aid in accessing your site's [MRR Report](https://chargify.zendesk.com/hc/en-us/articles/4407838249627) data. +// Whenever a subscription event occurs that causes your site's MRR to change (such as a signup or upgrade), we record an MRR movement. These records are accessible via the MRR Movements endpoint. +// Each MRR Movement belongs to a subscription and contains a timestamp, category, and an amount. `line_items` represent the subscription's product configuration at the time of the movement. +// ### Plan & Usage Breakouts +// In the MRR Report UI, we support a setting to [include or exclude](https://chargify.zendesk.com/hc/en-us/articles/4407838249627#displaying-component-based-metered-usage-in-mrr) usage revenue. In the MRR APIs, responses include `plan` and `usage` breakouts. +// Plan includes revenue from: +// * Products +// * Quantity-Based Components +// * On/Off Components +// Usage includes revenue from: +// * Metered Components // * Prepaid Usage Components -func (i *InsightsController) ReadMrrMovements( - ctx context.Context, - subscriptionId *int, - page *int, - perPage *int, - direction *models.SortingDirection) ( - models.ApiResponse[models.ListMRRResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/mrr_movements.json") - req.Authenticate(true) - if subscriptionId != nil { - req.QueryParam("subscription_id", *subscriptionId) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - var result models.ListMRRResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListMRRResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (i *InsightsController) ListMrrMovements( + ctx context.Context, + subscriptionId *int, + page *int, + perPage *int, + direction *models.SortingDirection) ( + models.ApiResponse[models.ListMRRResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/mrr_movements.json") + req.Authenticate(true) + if subscriptionId != nil { + req.QueryParam("subscription_id", *subscriptionId) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + var result models.ListMRRResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListMRRResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListMrrPerSubscription takes context, filterSubscriptionIds, atTime, page, perPage, direction as parameters and -// returns an models.ApiResponse with models.SubscriptionMRRResponse data and -// an error if there was an issue with the request or response. -// Deprecated: listMrrPerSubscription is deprecated +// ListMrrPerSubscription takes context, filterSubscriptionIds, atTime, page, perPage, direction as parameters and +// returns an models.ApiResponse with models.SubscriptionMRRResponse data and +// an error if there was an issue with the request or response. +// Deprecated: listMrrPerSubscription is deprecated // This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. func (i *InsightsController) ListMrrPerSubscription( - ctx context.Context, - filterSubscriptionIds []int, - atTime *string, - page *int, - perPage *int, - direction *models.Direction) ( - models.ApiResponse[models.SubscriptionMRRResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/subscriptions_mrr.json") - req.Authenticate(true) - if filterSubscriptionIds != nil { - req.QueryParam("filter[subscription_ids]", filterSubscriptionIds) - } - if atTime != nil { - req.QueryParam("at_time", *atTime) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - var result models.SubscriptionMRRResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionMRRResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 400 { - err = errors.NewSubscriptionsMrrErrorResponse(400, "Bad Request") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + filterSubscriptionIds []int, + atTime *string, + page *int, + perPage *int, + direction *models.Direction) ( + models.ApiResponse[models.SubscriptionMRRResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/subscriptions_mrr.json") + req.Authenticate(true) + if filterSubscriptionIds != nil { + req.QueryParam("filter[subscription_ids]", filterSubscriptionIds) + } + if atTime != nil { + req.QueryParam("at_time", *atTime) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + var result models.SubscriptionMRRResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionMRRResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 400 { + err = errors.NewSubscriptionsMrrErrorResponse(400, "Bad Request") + } + return models.NewApiResponse(result, resp), err } diff --git a/invoices_controller.go b/invoices_controller.go index 43a6e0a1..6d9148c1 100644 --- a/invoices_controller.go +++ b/invoices_controller.go @@ -1,1004 +1,1004 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // InvoicesController represents a controller struct. type InvoicesController struct { - baseController + baseController } -// NewInvoicesController creates a new instance of InvoicesController. +// NewInvoicesController creates a new instance of InvoicesController. // It takes a baseController as a parameter and returns a pointer to the InvoicesController. func NewInvoicesController(baseController baseController) *InvoicesController { - invoicesController := InvoicesController{baseController: baseController} - return &invoicesController + invoicesController := InvoicesController{baseController: baseController} + return &invoicesController } -// RefundInvoice takes context, uid, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// Refund 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. +// RefundInvoice takes context, uid, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// Refund 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. // A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00 respectively). func (i *InvoicesController) RefundInvoice( - ctx context.Context, - uid string, - body *models.RefundInvoiceRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/invoices/%v/refunds.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.RefundInvoiceRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/invoices/%v/refunds.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListInvoices takes context, startDate, endDate, status, subscriptionId, subscriptionGroupUid, page, perPage, direction, lineItems, discounts, taxes, credits, payments, customFields, refunds, dateField, startDatetime, endDatetime, customerIds, number, productIds, sort as parameters and -// returns an models.ApiResponse with models.ListInvoicesResponse data and -// an error if there was an issue with the request or response. +// ListInvoices takes context, startDate, endDate, status, subscriptionId, subscriptionGroupUid, page, perPage, direction, lineItems, discounts, taxes, credits, payments, customFields, refunds, dateField, startDatetime, endDatetime, customerIds, number, productIds, sort as parameters and +// returns an models.ApiResponse with models.ListInvoicesResponse data and +// an error if there was an issue with the request or response. // 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`. func (i *InvoicesController) ListInvoices( - ctx context.Context, - startDate *string, - endDate *string, - status *models.InvoiceStatus, - subscriptionId *int, - subscriptionGroupUid *string, - page *int, - perPage *int, - direction *models.Direction, - lineItems *bool, - discounts *bool, - taxes *bool, - credits *bool, - payments *bool, - customFields *bool, - refunds *bool, - dateField *models.InvoiceDateField, - startDatetime *string, - endDatetime *string, - customerIds []int, - number []string, - productIds []int, - sort *models.InvoiceSortField) ( - models.ApiResponse[models.ListInvoicesResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/invoices.json") - req.Authenticate(true) - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if status != nil { - req.QueryParam("status", *status) - } - if subscriptionId != nil { - req.QueryParam("subscription_id", *subscriptionId) - } - if subscriptionGroupUid != nil { - req.QueryParam("subscription_group_uid", *subscriptionGroupUid) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if lineItems != nil { - req.QueryParam("line_items", *lineItems) - } - if discounts != nil { - req.QueryParam("discounts", *discounts) - } - if taxes != nil { - req.QueryParam("taxes", *taxes) - } - if credits != nil { - req.QueryParam("credits", *credits) - } - if payments != nil { - req.QueryParam("payments", *payments) - } - if customFields != nil { - req.QueryParam("custom_fields", *customFields) - } - if refunds != nil { - req.QueryParam("refunds", *refunds) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if customerIds != nil { - req.QueryParam("customer_ids", customerIds) - } - if number != nil { - req.QueryParam("number", number) - } - if productIds != nil { - req.QueryParam("product_ids", productIds) - } - if sort != nil { - req.QueryParam("sort", *sort) - } - var result models.ListInvoicesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListInvoicesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + startDate *string, + endDate *string, + status *models.InvoiceStatus, + subscriptionId *int, + subscriptionGroupUid *string, + page *int, + perPage *int, + direction *models.Direction, + lineItems *bool, + discounts *bool, + taxes *bool, + credits *bool, + payments *bool, + customFields *bool, + refunds *bool, + dateField *models.InvoiceDateField, + startDatetime *string, + endDatetime *string, + customerIds []int, + number []string, + productIds []int, + sort *models.InvoiceSortField) ( + models.ApiResponse[models.ListInvoicesResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/invoices.json") + req.Authenticate(true) + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if status != nil { + req.QueryParam("status", *status) + } + if subscriptionId != nil { + req.QueryParam("subscription_id", *subscriptionId) + } + if subscriptionGroupUid != nil { + req.QueryParam("subscription_group_uid", *subscriptionGroupUid) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if lineItems != nil { + req.QueryParam("line_items", *lineItems) + } + if discounts != nil { + req.QueryParam("discounts", *discounts) + } + if taxes != nil { + req.QueryParam("taxes", *taxes) + } + if credits != nil { + req.QueryParam("credits", *credits) + } + if payments != nil { + req.QueryParam("payments", *payments) + } + if customFields != nil { + req.QueryParam("custom_fields", *customFields) + } + if refunds != nil { + req.QueryParam("refunds", *refunds) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if customerIds != nil { + req.QueryParam("customer_ids", customerIds) + } + if number != nil { + req.QueryParam("number", number) + } + if productIds != nil { + req.QueryParam("product_ids", productIds) + } + if sort != nil { + req.QueryParam("sort", *sort) + } + var result models.ListInvoicesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListInvoicesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadInvoice takes context, uid as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. +// ReadInvoice takes context, uid as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. // Use this endpoint to retrieve the details for an invoice. func (i *InvoicesController) ReadInvoice( - ctx context.Context, - uid string) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest(ctx, "GET", fmt.Sprintf("/invoices/%v.json", uid)) - req.Authenticate(true) - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest(ctx, "GET", fmt.Sprintf("/invoices/%v.json", uid)) + req.Authenticate(true) + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListInvoiceEvents takes context, sinceDate, sinceId, page, perPage, invoiceUid, withChangeInvoiceStatus, eventTypes as parameters and -// returns an models.ApiResponse with models.ListInvoiceEventsResponse data and -// an error if there was an issue with the request or response. -// 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. -// Exposed event types are: -// + issue_invoice -// + apply_credit_note -// + apply_payment -// + refund_invoice -// + void_invoice -// + void_remainder -// + backport_invoice -// + change_invoice_status -// + change_invoice_collection_method -// + remove_payment -// + failed_payment -// + apply_debit_note -// + create_debit_note -// + change_chargeback_status -// Invoice events are returned in ascending order. -// If both a `since_date` and `since_id` are provided in request parameters, the `since_date` will be used. +// ListInvoiceEvents takes context, sinceDate, sinceId, page, perPage, invoiceUid, withChangeInvoiceStatus, eventTypes as parameters and +// returns an models.ApiResponse with models.ListInvoiceEventsResponse data and +// an error if there was an issue with the request or response. +// 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. +// Exposed event types are: +// + issue_invoice +// + apply_credit_note +// + apply_payment +// + refund_invoice +// + void_invoice +// + void_remainder +// + backport_invoice +// + change_invoice_status +// + change_invoice_collection_method +// + remove_payment +// + failed_payment +// + apply_debit_note +// + create_debit_note +// + change_chargeback_status +// Invoice events are returned in ascending order. +// If both a `since_date` and `since_id` are provided in request parameters, the `since_date` will be used. // Note - invoice events that occurred prior to 09/05/2018 __will not__ contain an `invoice` snapshot. func (i *InvoicesController) ListInvoiceEvents( - ctx context.Context, - sinceDate *string, - sinceId *int, - page *int, - perPage *int, - invoiceUid *string, - withChangeInvoiceStatus *string, - eventTypes []models.InvoiceEventType) ( - models.ApiResponse[models.ListInvoiceEventsResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/invoices/events.json") - req.Authenticate(true) - if sinceDate != nil { - req.QueryParam("since_date", *sinceDate) - } - if sinceId != nil { - req.QueryParam("since_id", *sinceId) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if invoiceUid != nil { - req.QueryParam("invoice_uid", *invoiceUid) - } - if withChangeInvoiceStatus != nil { - req.QueryParam("with_change_invoice_status", *withChangeInvoiceStatus) - } - if eventTypes != nil { - req.QueryParam("event_types", eventTypes) - } - var result models.ListInvoiceEventsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListInvoiceEventsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + sinceDate *string, + sinceId *int, + page *int, + perPage *int, + invoiceUid *string, + withChangeInvoiceStatus *string, + eventTypes []models.InvoiceEventType) ( + models.ApiResponse[models.ListInvoiceEventsResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/invoices/events.json") + req.Authenticate(true) + if sinceDate != nil { + req.QueryParam("since_date", *sinceDate) + } + if sinceId != nil { + req.QueryParam("since_id", *sinceId) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if invoiceUid != nil { + req.QueryParam("invoice_uid", *invoiceUid) + } + if withChangeInvoiceStatus != nil { + req.QueryParam("with_change_invoice_status", *withChangeInvoiceStatus) + } + if eventTypes != nil { + req.QueryParam("event_types", eventTypes) + } + var result models.ListInvoiceEventsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListInvoiceEventsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// RecordPaymentForInvoice takes context, uid, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// This API call should be used when you want to record a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. -// ## Create a Payment from the existing payment profile -// In order to apply a payment to an invoice using an existing payment profile, specify `type` as `payment`, the amount less than the invoice total, and the customer's `payment_profile_id`. The ID of a payment profile might be retrieved via the Payment Profiles API endpoint. -// ``` -// { -// "type": "payment", -// "payment": { -// "amount": 10.00, -// "payment_profile_id": 123 -// } -// } -// ``` -// ## Create a Payment from the Subscription's Prepayment Account -// In order apply a prepayment to an invoice, specify the `type` as `prepayment`, and also the `amount`. -// ``` -// { -// "type": "prepayment", -// "payment": { -// "amount": 10.00 -// } -// } -// ``` -// Note that the `amount` must be less than or equal to the Subscription's Prepayment account balance. -// ## Create a Payment from the Subscription's Service Credit Account -// In order to apply a service credit to an invoice, specify the `type` as `service_credit`, and also the `amount`: -// ``` -// { -// "type": "service_credit", -// "payment": { -// "amount": 10.00 -// } -// } -// ``` +// RecordPaymentForInvoice takes context, uid, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// This API call should be used when you want to record a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. +// ## Create a Payment from the existing payment profile +// In order to apply a payment to an invoice using an existing payment profile, specify `type` as `payment`, the amount less than the invoice total, and the customer's `payment_profile_id`. The ID of a payment profile might be retrieved via the Payment Profiles API endpoint. +// ``` +// { +// "type": "payment", +// "payment": { +// "amount": 10.00, +// "payment_profile_id": 123 +// } +// } +// ``` +// ## Create a Payment from the Subscription's Prepayment Account +// In order apply a prepayment to an invoice, specify the `type` as `prepayment`, and also the `amount`. +// ``` +// { +// "type": "prepayment", +// "payment": { +// "amount": 10.00 +// } +// } +// ``` +// Note that the `amount` must be less than or equal to the Subscription's Prepayment account balance. +// ## Create a Payment from the Subscription's Service Credit Account +// In order to apply a service credit to an invoice, specify the `type` as `service_credit`, and also the `amount`: +// ``` +// { +// "type": "service_credit", +// "payment": { +// "amount": 10.00 +// } +// } +// ``` // Note that Chargify will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. func (i *InvoicesController) RecordPaymentForInvoice( - ctx context.Context, - uid string, - body *models.CreateInvoicePaymentRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/invoices/%v/payments.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.CreateInvoicePaymentRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/invoices/%v/payments.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// RecordExternalPaymentForInvoices takes context, body as parameters and -// returns an models.ApiResponse with models.MultiInvoicePaymentResponse data and -// an error if there was an issue with the request or response. -// This API call should be used when you want to record an external payment against multiple invoices. -// In order 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" -// } -// ] -// } -// } -// ``` +// RecordPaymentForMultipleInvoices takes context, body as parameters and +// returns an models.ApiResponse with models.MultiInvoicePaymentResponse data and +// an error if there was an issue with the request or response. +// This API call should be used when you want to record an external payment against multiple invoices. +// In order 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. -func (i *InvoicesController) RecordExternalPaymentForInvoices( - ctx context.Context, - body *models.CreateMultiInvoicePaymentRequest) ( - models.ApiResponse[models.MultiInvoicePaymentResponse], - error) { - req := i.prepareRequest(ctx, "POST", "/invoices/payments.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.MultiInvoicePaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.MultiInvoicePaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity") - } - return models.NewApiResponse(result, resp), err +func (i *InvoicesController) RecordPaymentForMultipleInvoices( + ctx context.Context, + body *models.CreateMultiInvoicePaymentRequest) ( + models.ApiResponse[models.MultiInvoicePaymentResponse], + error) { + req := i.prepareRequest(ctx, "POST", "/invoices/payments.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.MultiInvoicePaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.MultiInvoicePaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity") + } + return models.NewApiResponse(result, resp), err } -// ListCreditNotes takes context, subscriptionId, page, perPage, lineItems, discounts, taxes, refunds, applications as parameters and -// returns an models.ApiResponse with models.ListCreditNotesResponse data and -// an error if there was an issue with the request or response. -// Credit Notes are like inverse invoices. They reduce the amount a customer owes. +// ListCreditNotes takes context, subscriptionId, page, perPage, lineItems, discounts, taxes, refunds, applications as parameters and +// returns an models.ApiResponse with models.ListCreditNotesResponse data and +// an error if there was an issue with the request or response. +// 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`. func (i *InvoicesController) ListCreditNotes( - ctx context.Context, - subscriptionId *int, - page *int, - perPage *int, - lineItems *bool, - discounts *bool, - taxes *bool, - refunds *bool, - applications *bool) ( - models.ApiResponse[models.ListCreditNotesResponse], - error) { - req := i.prepareRequest(ctx, "GET", "/credit_notes.json") - req.Authenticate(true) - if subscriptionId != nil { - req.QueryParam("subscription_id", *subscriptionId) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if lineItems != nil { - req.QueryParam("line_items", *lineItems) - } - if discounts != nil { - req.QueryParam("discounts", *discounts) - } - if taxes != nil { - req.QueryParam("taxes", *taxes) - } - if refunds != nil { - req.QueryParam("refunds", *refunds) - } - if applications != nil { - req.QueryParam("applications", *applications) - } - var result models.ListCreditNotesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListCreditNotesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId *int, + page *int, + perPage *int, + lineItems *bool, + discounts *bool, + taxes *bool, + refunds *bool, + applications *bool) ( + models.ApiResponse[models.ListCreditNotesResponse], + error) { + req := i.prepareRequest(ctx, "GET", "/credit_notes.json") + req.Authenticate(true) + if subscriptionId != nil { + req.QueryParam("subscription_id", *subscriptionId) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if lineItems != nil { + req.QueryParam("line_items", *lineItems) + } + if discounts != nil { + req.QueryParam("discounts", *discounts) + } + if taxes != nil { + req.QueryParam("taxes", *taxes) + } + if refunds != nil { + req.QueryParam("refunds", *refunds) + } + if applications != nil { + req.QueryParam("applications", *applications) + } + var result models.ListCreditNotesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListCreditNotesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadCreditNote takes context, uid as parameters and -// returns an models.ApiResponse with models.CreditNote data and -// an error if there was an issue with the request or response. +// ReadCreditNote takes context, uid as parameters and +// returns an models.ApiResponse with models.CreditNote data and +// an error if there was an issue with the request or response. // Use this endpoint to retrieve the details for a credit note. func (i *InvoicesController) ReadCreditNote( - ctx context.Context, - uid string) ( - models.ApiResponse[models.CreditNote], - error) { - req := i.prepareRequest(ctx, "GET", fmt.Sprintf("/credit_notes/%v.json", uid)) - req.Authenticate(true) - - var result models.CreditNote - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CreditNote](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.CreditNote], + error) { + req := i.prepareRequest(ctx, "GET", fmt.Sprintf("/credit_notes/%v.json", uid)) + req.Authenticate(true) + + var result models.CreditNote + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CreditNote](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// RecordPaymentForSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.PaymentResponse data and -// an error if there was an issue with the request or response. -// Record 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. -// Excess payment will result in the creation of a prepayment on the Invoice Account. +// RecordPaymentForSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.PaymentResponse data and +// an error if there was an issue with the request or response. +// Record 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. +// Excess payment will result in the creation of a prepayment on the Invoice Account. // Only ungrouped or primary subscriptions may be paid using the "bulk" payment request. func (i *InvoicesController) RecordPaymentForSubscription( - ctx context.Context, - subscriptionId int, - body *models.RecordPaymentRequest) ( - models.ApiResponse[models.PaymentResponse], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/payments.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.PaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.RecordPaymentRequest) ( + models.ApiResponse[models.PaymentResponse], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/payments.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.PaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReopenInvoice takes context, uid as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// 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). -// 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: -// - Reactivating the subscription, which will capture all open invoices (See note below about automatic reopening of invoices.) -// - Recording a payment directly against the invoice -// A note about reactivations: any canceled invoices from the most recent active period are automatically opened as a part of the reactivation process. Reactivating via this endpoint prior to reactivation is only necessary when you wish to capture older invoices from previous periods during the reactivation. -// ### Reopening Consolidated Invoices +// ReopenInvoice takes context, uid as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// 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). +// 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: +// - Reactivating the subscription, which will capture all open invoices (See note below about automatic reopening of invoices.) +// - Recording a payment directly against the invoice +// A note about reactivations: any canceled invoices from the most recent active period are automatically opened as a part of the reactivation process. Reactivating via this endpoint prior to reactivation is only necessary when you wish to capture older invoices from previous periods during the reactivation. +// ### Reopening Consolidated Invoices // When reopening a consolidated invoice, all of its canceled segments will also be reopened. func (i *InvoicesController) ReopenInvoice( - ctx context.Context, - uid string) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/invoices/%v/reopen.json", uid), - ) - req.Authenticate(true) - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/invoices/%v/reopen.json", uid), + ) + req.Authenticate(true) + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// VoidInvoice takes context, uid, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. +// VoidInvoice takes context, uid, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. // 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. func (i *InvoicesController) VoidInvoice( - ctx context.Context, - uid string, - body *models.VoidInvoiceRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest(ctx, "POST", fmt.Sprintf("/invoices/%v/void.json", uid)) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.VoidInvoiceRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest(ctx, "POST", fmt.Sprintf("/invoices/%v/void.json", uid)) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListInvoiceSegments takes context, invoiceUid, page, perPage, direction as parameters and -// returns an models.ApiResponse with models.ConsolidatedInvoice data and -// an error if there was an issue with the request or response. +// ListConsolidatedInvoiceSegments takes context, invoiceUid, page, perPage, direction as parameters and +// returns an models.ApiResponse with models.ConsolidatedInvoice data and +// an error if there was an issue with the request or response. // Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. -func (i *InvoicesController) ListInvoiceSegments( - ctx context.Context, - invoiceUid string, - page *int, - perPage *int, - direction *models.Direction) ( - models.ApiResponse[models.ConsolidatedInvoice], - error) { - req := i.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/invoices/%v/segments.json", invoiceUid), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - - var result models.ConsolidatedInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ConsolidatedInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (i *InvoicesController) ListConsolidatedInvoiceSegments( + ctx context.Context, + invoiceUid string, + page *int, + perPage *int, + direction *models.Direction) ( + models.ApiResponse[models.ConsolidatedInvoice], + error) { + req := i.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/invoices/%v/segments.json", invoiceUid), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + + var result models.ConsolidatedInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ConsolidatedInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateInvoice takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.InvoiceResponse data and -// an error if there was an issue with the request or response. -// This endpoint will allow you to create 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 a unit price. Example: -// ```json -// { -// "invoice": { -// "line_items": [ -// { -// "title": "A Product", -// "quantity": 12, -// "unit_price": "150.00" -// } -// ] -// } -// } -// ``` -// ### Catalog items -// Instead of creating custom products like in above example, You can pass existing items like products, components. -// ```json -// { -// "invoice": { -// "line_items": [ -// { -// "product_id": "handle:gold-product", -// "quantity": 2, -// } -// ] -// } -// } -// ``` -// The price for each line item will be calculated as well as a total due amount for the invoice. Multiple line items can be sent. -// ### Line items types -// When defining line item, You can choose one of 3 types for one line item: -// #### Custom item -// Like in basic behavior example above, You can pass `title` and `unit_price` for custom item. -// #### Product id -// Product handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `product_price_point_id`. If `product_id` is used, following fields cannot be used: `title`, `component_id`. -// #### Component id -// Component handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `component_id`. If `component_id` is used, following fields cannot be used: `title`, `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `price_point_id`. At this moment price points are supportted only for quantity based, on/off and metered components. For prepaid and event based billing components `unit_price` is required. -// ### Coupons -// When creating ad hoc invoice, new discounts can be applied in following way: -// ```json -// { -// "invoice": { -// "line_items": [ -// { -// "product_id": "handle:gold-product", -// "quantity": 1 -// } -// ], -// "coupons": [ -// { -// "code": "COUPONCODE", -// "percentage": 50.0 -// } -// ] -// } -// } -// ``` -// If You want to use existing coupon for discount creation, only `code` and optional `product_family_id` is needed -// ```json -// ... -// "coupons": [ -// { -// "code": "FREESETUP", -// "product_family_id": 1 -// } -// ] -// ... -// ``` -// ### Coupon options -// #### Code -// Coupon `code` will be displayed on invoice discount section. -// Coupon code can only contain uppercase letters, numbers, and allowed special characters. -// Lowercase letters will be converted to uppercase. It can be used to select an existing coupon from the catalog, or as an ad hoc coupon when passed with `percentage` or `amount`. -// #### Percentage -// Coupon `percentage` can take values from 0 to 100 and up to 4 decimal places. It cannot be used with `amount`. Only for ad hoc coupons, will be ignored if `code` is used to select an existing coupon from the catalog. -// #### Amount -// Coupon `amount` takes number value. It cannot be used with `percentage`. Used only when not matching existing coupon by `code`. -// #### Description -// Optional `description` will be displayed with coupon `code`. Used only when not matching existing coupon by `code`. -// #### Product Family id -// Optional `product_family_id` handle (with handle: prefix) or id is used to match existing coupon within site, when codes are not unique. -// #### Compounding Strategy -// Optional `compounding_strategy` for percentage coupons, can take values `compound` or `full-price`. -// For amount coupons, discounts will be always calculated against the original item price, before other discounts are applied. -// `compound` strategy: -// Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. It is set by default. -// `full-price` strategy: -// Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. -// ### Line Item Options -// #### Period Date Range -// A custom period date range can be defined for each line item with the `period_range_start` and `period_range_end` parameters. Dates must be sent in the `YYYY-MM-DD` format. -// `period_range_end` must be greater or equal `period_range_start`. -// #### Taxes -// The `taxable` parameter can be sent as `true` if taxes should be calculated for a specific line item. For this to work, the site should be configured to use and calculate taxes. Further, if the site uses Avalara for tax calculations, a `tax_code` parameter should also be sent. For existing catalog items: products/components taxes cannot be overwritten. -// #### Price Point -// Price point handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `price_point_id` for components with `component_id` or `product_price_point_id` for products with `product_id` parameter. If price point is passed `unit_price` cannot be used. It can be used only with catalog items products and components. -// #### Description -// Optional `description` parameter, it will overwrite default generated description for line item. -// ### Invoice Options -// #### Issue Date -// By default, invoices will be created with a issue date set to today. `issue_date` parameter can be send to alter that. Only dates in the past can be send. `issue_date` should be send in `YYYY-MM-DD` format. -// #### Net Terms -// 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. -// #### Addresses -// The seller, shipping and billing addresses can be sent to override the site's defaults. Each address requires to send a `first_name` at a minimum in order to work. Please see below for the details on which parameters can be sent for each address object. -// #### Memo and Payment Instructions -// A custom memo can be sent with the `memo` parameter to override the site's default. Likewise, custom payment instructions can be sent with the `payment_instrucions` parameter. -// #### Status +// CreateInvoice takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.InvoiceResponse data and +// an error if there was an issue with the request or response. +// This endpoint will allow you to create 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 a unit price. Example: +// ```json +// { +// "invoice": { +// "line_items": [ +// { +// "title": "A Product", +// "quantity": 12, +// "unit_price": "150.00" +// } +// ] +// } +// } +// ``` +// ### Catalog items +// Instead of creating custom products like in above example, You can pass existing items like products, components. +// ```json +// { +// "invoice": { +// "line_items": [ +// { +// "product_id": "handle:gold-product", +// "quantity": 2, +// } +// ] +// } +// } +// ``` +// The price for each line item will be calculated as well as a total due amount for the invoice. Multiple line items can be sent. +// ### Line items types +// When defining line item, You can choose one of 3 types for one line item: +// #### Custom item +// Like in basic behavior example above, You can pass `title` and `unit_price` for custom item. +// #### Product id +// Product handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `product_price_point_id`. If `product_id` is used, following fields cannot be used: `title`, `component_id`. +// #### Component id +// Component handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `component_id`. If `component_id` is used, following fields cannot be used: `title`, `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `price_point_id`. At this moment price points are supportted only for quantity based, on/off and metered components. For prepaid and event based billing components `unit_price` is required. +// ### Coupons +// When creating ad hoc invoice, new discounts can be applied in following way: +// ```json +// { +// "invoice": { +// "line_items": [ +// { +// "product_id": "handle:gold-product", +// "quantity": 1 +// } +// ], +// "coupons": [ +// { +// "code": "COUPONCODE", +// "percentage": 50.0 +// } +// ] +// } +// } +// ``` +// If You want to use existing coupon for discount creation, only `code` and optional `product_family_id` is needed +// ```json +// ... +// "coupons": [ +// { +// "code": "FREESETUP", +// "product_family_id": 1 +// } +// ] +// ... +// ``` +// ### Coupon options +// #### Code +// Coupon `code` will be displayed on invoice discount section. +// Coupon code can only contain uppercase letters, numbers, and allowed special characters. +// Lowercase letters will be converted to uppercase. It can be used to select an existing coupon from the catalog, or as an ad hoc coupon when passed with `percentage` or `amount`. +// #### Percentage +// Coupon `percentage` can take values from 0 to 100 and up to 4 decimal places. It cannot be used with `amount`. Only for ad hoc coupons, will be ignored if `code` is used to select an existing coupon from the catalog. +// #### Amount +// Coupon `amount` takes number value. It cannot be used with `percentage`. Used only when not matching existing coupon by `code`. +// #### Description +// Optional `description` will be displayed with coupon `code`. Used only when not matching existing coupon by `code`. +// #### Product Family id +// Optional `product_family_id` handle (with handle: prefix) or id is used to match existing coupon within site, when codes are not unique. +// #### Compounding Strategy +// Optional `compounding_strategy` for percentage coupons, can take values `compound` or `full-price`. +// For amount coupons, discounts will be always calculated against the original item price, before other discounts are applied. +// `compound` strategy: +// Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. It is set by default. +// `full-price` strategy: +// Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. +// ### Line Item Options +// #### Period Date Range +// A custom period date range can be defined for each line item with the `period_range_start` and `period_range_end` parameters. Dates must be sent in the `YYYY-MM-DD` format. +// `period_range_end` must be greater or equal `period_range_start`. +// #### Taxes +// The `taxable` parameter can be sent as `true` if taxes should be calculated for a specific line item. For this to work, the site should be configured to use and calculate taxes. Further, if the site uses Avalara for tax calculations, a `tax_code` parameter should also be sent. For existing catalog items: products/components taxes cannot be overwritten. +// #### Price Point +// Price point handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `price_point_id` for components with `component_id` or `product_price_point_id` for products with `product_id` parameter. If price point is passed `unit_price` cannot be used. It can be used only with catalog items products and components. +// #### Description +// Optional `description` parameter, it will overwrite default generated description for line item. +// ### Invoice Options +// #### Issue Date +// By default, invoices will be created with a issue date set to today. `issue_date` parameter can be send to alter that. Only dates in the past can be send. `issue_date` should be send in `YYYY-MM-DD` format. +// #### Net Terms +// 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. +// #### Addresses +// The seller, shipping and billing addresses can be sent to override the site's defaults. Each address requires to send a `first_name` at a minimum in order to work. Please see below for the details on which parameters can be sent for each address object. +// #### Memo and Payment Instructions +// A custom memo can be sent with the `memo` parameter to override the site's default. Likewise, custom payment instructions can be sent with the `payment_instrucions` parameter. +// #### Status // By default, invoices will be created with open status. Possible alternative is `draft`. func (i *InvoicesController) CreateInvoice( - ctx context.Context, - subscriptionId int, - body *models.CreateInvoiceRequest) ( - models.ApiResponse[models.InvoiceResponse], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/invoices.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.InvoiceResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.InvoiceResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.CreateInvoiceRequest) ( + models.ApiResponse[models.InvoiceResponse], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/invoices.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.InvoiceResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.InvoiceResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// SendInvoice takes context, uid, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// 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. -// Please note that if no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. +// SendInvoice takes context, uid, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// 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. +// Please note that if no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if `recipient_emails` is left blank, then the invoice will be delivered to the subscription's customer email address. // On success, a 204 no-content response will be returned. Please note that this does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. func (i *InvoicesController) SendInvoice( - ctx context.Context, - uid string, - body *models.SendInvoiceRequest) ( - *http.Response, - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/invoices/%v/deliveries.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + uid string, + body *models.SendInvoiceRequest) ( + *http.Response, + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/invoices/%v/deliveries.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// PreviewCustomerInformationChanges takes context, uid as parameters and -// returns an models.ApiResponse with models.CustomerChangesPreviewResponse data and -// an error if there was an issue with the request or response. -// Customer information may change after an invoice is issued which may lead to a mismatch between customer information that are present on an open invoice and actual customer information. This endpoint allows to preview these differences, if any. +// PreviewCustomerInformationChanges takes context, uid as parameters and +// returns an models.ApiResponse with models.CustomerChangesPreviewResponse data and +// an error if there was an issue with the request or response. +// Customer information may change after an invoice is issued which may lead to a mismatch between customer information that are present on an open invoice and actual customer information. This endpoint allows to preview these differences, if any. // The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. func (i *InvoicesController) PreviewCustomerInformationChanges( - ctx context.Context, - uid string) ( - models.ApiResponse[models.CustomerChangesPreviewResponse], - error) { - req := i.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/invoices/%v/customer_information/preview.json", uid), - ) - req.Authenticate(true) - - var result models.CustomerChangesPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CustomerChangesPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewErrorListResponse(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.CustomerChangesPreviewResponse], + error) { + req := i.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/invoices/%v/customer_information/preview.json", uid), + ) + req.Authenticate(true) + + var result models.CustomerChangesPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CustomerChangesPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewErrorListResponse(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateCustomerInformation takes context, uid as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// 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 before. +// UpdateCustomerInformation takes context, uid as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// 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 before. // The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. func (i *InvoicesController) UpdateCustomerInformation( - ctx context.Context, - uid string) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/invoices/%v/customer_information.json", uid), - ) - req.Authenticate(true) - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewErrorListResponse(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/invoices/%v/customer_information.json", uid), + ) + req.Authenticate(true) + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewErrorListResponse(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// IssueInvoice takes context, uid, body as parameters and -// returns an models.ApiResponse with models.Invoice data and -// an error if there was an issue with the request or response. -// This endpoint allows you to issue an invoice that is in "pending" 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 payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. Any prepayments or service credits that exist on subscription will be automatically applied. Additionally, if setting is on, an email will be sent for issued invoice. -// For Automatic subscriptions, prepayments and service credits will apply to the invoice and before payment is attempted. On successful payment, the invoice will go into "paid" status and email will be sent to the customer (if setting applies). When payment fails, the next event depends on the `on_failed_payment` value: -// - `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. +// IssueInvoice takes context, uid, body as parameters and +// returns an models.ApiResponse with models.Invoice data and +// an error if there was an issue with the request or response. +// This endpoint allows you to issue an invoice that is in "pending" 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 payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. Any prepayments or service credits that exist on subscription will be automatically applied. Additionally, if setting is on, an email will be sent for issued invoice. +// For Automatic subscriptions, prepayments and service credits will apply to the invoice and before payment is attempted. On successful payment, the invoice will go into "paid" status and email will be sent to the customer (if setting applies). When payment fails, the next event depends on the `on_failed_payment` value: +// - `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). func (i *InvoicesController) IssueInvoice( - ctx context.Context, - uid string, - body *models.IssueInvoiceRequest) ( - models.ApiResponse[models.Invoice], - error) { - req := i.prepareRequest(ctx, "POST", fmt.Sprintf("/invoices/%v/issue.json", uid)) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.Invoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.Invoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.IssueInvoiceRequest) ( + models.ApiResponse[models.Invoice], + error) { + req := i.prepareRequest(ctx, "POST", fmt.Sprintf("/invoices/%v/issue.json", uid)) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.Invoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.Invoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/maxio-advanced-billing-go_generic_lib.zip b/maxio-advanced-billing-go_generic_lib.zip new file mode 100644 index 0000000000000000000000000000000000000000..d8ac0d1d0d441c829d2fedfac3ba634be22421e2 GIT binary patch literal 922463 zcmZU4Q>cy5WKu*&^QgLP(A#$*HAHqCiYRCOZG?vzzc2 zchh0M>aq^*T*x5u_3-fiZCgh(U2lQ|QiIw!NhzVcLUG!gUf!iL2Dvbxuh*akTWr-9 zL$$Hvmqo4Ss)1zHg;GmJs`SCR2Hw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LwN8b)DYqjZo@-i@5L5`IiVoJK7*!=b9 z-KbOYMQhvY7Qf2H$dOUOv_+AHanz^jzSv+`^a;=-_)JOmnTD~d&qz(o(^d^*h68j8 zFIV27adMz!U-$W$9rj-YXac0;2B1NI1q=Z{I^ZxAyEz1nRi#c$`<+nQvw5_`dG`Sh zpaNQxjV0pz5b+B~Bk=&D-!D>{fKz_t#Fe!Ay#;SA)({VWm2z+j11#tlcu5Nvty(t> z^aFTHv9GkA%DzIWbU0+QmoX&PGDJ$wzKMI>H;fW!tD$!FEyCK#T&BTkLa-ghX~fj{taPc4*2o0A~QmhsFOEI|izDcBG7q z97l_sSMc)g?2{xWD=!nLVbR#C>{BZF5X|EF(og(S6;e>{Ayw*4q{Ixe3|u<6#ckAGmLRkwGXW-JstWY5Z((O9Zac(MFWvWiPbt^?E>){j%=~llV)blWq z2|DSnu2LZd(q%Y&>hpe}Xz7#>%r{rdP-#a|$u`3tv*jxgm<2?h zzffq0f+&#fc`o1fbgaOB*f2gNd%ROfvX8c<4ZH&I&-`e5F!KPgT+%@R9 z&ndP*-t09DTPVbF2i=~p4utG?$dv2W3a=kh#zU_rVP@(9k!??jgO0EQDP5P8TuV+- z1xU%Axd%ryI2_{{L(#8De*X ym}F-g1=Tg@RQ2R)=vZ!8#xDTrY|oi $10.50) - Amount *interface{} `json:"amount,omitempty"` - // A description to be attached to the payment. - Memo *string `json:"memo,omitempty"` - // The type of payment method used. - Method *InvoicePaymentMethodType `json:"method,omitempty"` - // Additional information related to the payment method (eg. Check #) - Details *string `json:"details,omitempty"` + // A string of the dollar amount to be refunded (eg. "10.50" => $10.50) + Amount *interface{} `json:"amount,omitempty"` + // A description to be attached to the payment. + Memo *string `json:"memo,omitempty"` + // The type of payment method used. Defaults to other. + Method *InvoicePaymentMethodType `json:"method,omitempty"` + // Additional information related to the payment method (eg. Check #) + Details *string `json:"details,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateInvoicePayment. +// MarshalJSON implements the json.Marshaler interface for CreateInvoicePayment. // It customizes the JSON marshaling process for CreateInvoicePayment objects. func (c *CreateInvoicePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateInvoicePayment object to a map representation for JSON marshaling. func (c *CreateInvoicePayment) toMap() map[string]any { - structMap := make(map[string]any) - if c.Amount != nil { - structMap["amount"] = c.Amount - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.Method != nil { - structMap["method"] = c.Method - } - if c.Details != nil { - structMap["details"] = c.Details - } - return structMap + structMap := make(map[string]any) + if c.Amount != nil { + structMap["amount"] = c.Amount + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.Method != nil { + structMap["method"] = c.Method + } + if c.Details != nil { + structMap["details"] = c.Details + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePayment. // It customizes the JSON unmarshaling process for CreateInvoicePayment objects. func (c *CreateInvoicePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount *interface{} `json:"amount,omitempty"` - Memo *string `json:"memo,omitempty"` - Method *InvoicePaymentMethodType `json:"method,omitempty"` - Details *string `json:"details,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Amount = temp.Amount - c.Memo = temp.Memo - c.Method = temp.Method - c.Details = temp.Details - return nil + temp := &struct { + Amount *interface{} `json:"amount,omitempty"` + Memo *string `json:"memo,omitempty"` + Method *InvoicePaymentMethodType `json:"method,omitempty"` + Details *string `json:"details,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Amount = temp.Amount + c.Memo = temp.Memo + c.Method = temp.Method + c.Details = temp.Details + return nil } diff --git a/models/create_invoice_payment_application.go b/models/create_invoice_payment_application.go index c4be74dd..d7b5c2d0 100644 --- a/models/create_invoice_payment_application.go +++ b/models/create_invoice_payment_application.go @@ -1,46 +1,46 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateInvoicePaymentApplication represents a CreateInvoicePaymentApplication struct. type CreateInvoicePaymentApplication struct { - // Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. - InvoiceUid string `json:"invoice_uid"` - // Dollar amount of the invoice payment (eg. "10.50" => $10.50). - Amount string `json:"amount"` + // Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. + InvoiceUid string `json:"invoice_uid"` + // Dollar amount of the invoice payment (eg. "10.50" => $10.50). + Amount string `json:"amount"` } -// MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentApplication. +// MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentApplication. // It customizes the JSON marshaling process for CreateInvoicePaymentApplication objects. func (c *CreateInvoicePaymentApplication) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateInvoicePaymentApplication object to a map representation for JSON marshaling. func (c *CreateInvoicePaymentApplication) toMap() map[string]any { - structMap := make(map[string]any) - structMap["invoice_uid"] = c.InvoiceUid - structMap["amount"] = c.Amount - return structMap + structMap := make(map[string]any) + structMap["invoice_uid"] = c.InvoiceUid + structMap["amount"] = c.Amount + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentApplication. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentApplication. // It customizes the JSON unmarshaling process for CreateInvoicePaymentApplication objects. func (c *CreateInvoicePaymentApplication) UnmarshalJSON(input []byte) error { - temp := &struct { - InvoiceUid string `json:"invoice_uid"` - Amount string `json:"amount"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.InvoiceUid = temp.InvoiceUid - c.Amount = temp.Amount - return nil + temp := &struct { + InvoiceUid string `json:"invoice_uid"` + Amount string `json:"amount"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.InvoiceUid = temp.InvoiceUid + c.Amount = temp.Amount + return nil } diff --git a/models/create_invoice_payment_request.go b/models/create_invoice_payment_request.go index 1ae3d880..f47802b6 100644 --- a/models/create_invoice_payment_request.go +++ b/models/create_invoice_payment_request.go @@ -1,47 +1,47 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateInvoicePaymentRequest represents a CreateInvoicePaymentRequest struct. type CreateInvoicePaymentRequest struct { - Payment CreateInvoicePayment `json:"payment"` - // The type of payment to be applied to an Invoice. - Type *InvoicePaymentType `json:"type,omitempty"` + Payment CreateInvoicePayment `json:"payment"` + // The type of payment to be applied to an Invoice. Defaults to external. + Type *InvoicePaymentType `json:"type,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentRequest. +// MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentRequest. // It customizes the JSON marshaling process for CreateInvoicePaymentRequest objects. func (c *CreateInvoicePaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateInvoicePaymentRequest object to a map representation for JSON marshaling. func (c *CreateInvoicePaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment"] = c.Payment - if c.Type != nil { - structMap["type"] = c.Type - } - return structMap + structMap := make(map[string]any) + structMap["payment"] = c.Payment.toMap() + if c.Type != nil { + structMap["type"] = c.Type + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentRequest. // It customizes the JSON unmarshaling process for CreateInvoicePaymentRequest objects. func (c *CreateInvoicePaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Payment CreateInvoicePayment `json:"payment"` - Type *InvoicePaymentType `json:"type,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Payment = temp.Payment - c.Type = temp.Type - return nil + temp := &struct { + Payment CreateInvoicePayment `json:"payment"` + Type *InvoicePaymentType `json:"type,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Payment = temp.Payment + c.Type = temp.Type + return nil } diff --git a/models/create_invoice_request.go b/models/create_invoice_request.go index 20b77b7d..6a43b87c 100644 --- a/models/create_invoice_request.go +++ b/models/create_invoice_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateInvoiceRequest represents a CreateInvoiceRequest struct. type CreateInvoiceRequest struct { - Invoice CreateInvoice `json:"invoice"` + Invoice CreateInvoice `json:"invoice"` } -// MarshalJSON implements the json.Marshaler interface for CreateInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for CreateInvoiceRequest. // It customizes the JSON marshaling process for CreateInvoiceRequest objects. func (c *CreateInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateInvoiceRequest object to a map representation for JSON marshaling. func (c *CreateInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["invoice"] = c.Invoice - return structMap + structMap := make(map[string]any) + structMap["invoice"] = c.Invoice.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceRequest. // It customizes the JSON unmarshaling process for CreateInvoiceRequest objects. func (c *CreateInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Invoice CreateInvoice `json:"invoice"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Invoice = temp.Invoice - return nil + temp := &struct { + Invoice CreateInvoice `json:"invoice"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Invoice = temp.Invoice + return nil } diff --git a/models/create_metadata.go b/models/create_metadata.go index 4f139730..699e5f1a 100644 --- a/models/create_metadata.go +++ b/models/create_metadata.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMetadata represents a CreateMetadata struct. type CreateMetadata struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateMetadata. +// MarshalJSON implements the json.Marshaler interface for CreateMetadata. // It customizes the JSON marshaling process for CreateMetadata objects. func (c *CreateMetadata) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMetadata object to a map representation for JSON marshaling. func (c *CreateMetadata) toMap() map[string]any { - structMap := make(map[string]any) - if c.Name != nil { - structMap["name"] = c.Name - } - if c.Value != nil { - structMap["value"] = c.Value - } - return structMap + structMap := make(map[string]any) + if c.Name != nil { + structMap["name"] = c.Name + } + if c.Value != nil { + structMap["value"] = c.Value + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadata. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadata. // It customizes the JSON unmarshaling process for CreateMetadata objects. func (c *CreateMetadata) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Name = temp.Name - c.Value = temp.Value - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Name = temp.Name + c.Value = temp.Value + return nil } diff --git a/models/create_metadata_request.go b/models/create_metadata_request.go index b3b4beb9..0680cf64 100644 --- a/models/create_metadata_request.go +++ b/models/create_metadata_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMetadataRequest represents a CreateMetadataRequest struct. type CreateMetadataRequest struct { - Metadata []CreateMetadata `json:"metadata"` + Metadata []CreateMetadata `json:"metadata"` } -// MarshalJSON implements the json.Marshaler interface for CreateMetadataRequest. +// MarshalJSON implements the json.Marshaler interface for CreateMetadataRequest. // It customizes the JSON marshaling process for CreateMetadataRequest objects. func (c *CreateMetadataRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMetadataRequest object to a map representation for JSON marshaling. func (c *CreateMetadataRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["metadata"] = c.Metadata - return structMap + structMap := make(map[string]any) + structMap["metadata"] = c.Metadata + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadataRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadataRequest. // It customizes the JSON unmarshaling process for CreateMetadataRequest objects. func (c *CreateMetadataRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Metadata []CreateMetadata `json:"metadata"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Metadata = temp.Metadata - return nil + temp := &struct { + Metadata []CreateMetadata `json:"metadata"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Metadata = temp.Metadata + return nil } diff --git a/models/create_metafields_request.go b/models/create_metafields_request.go index 7c32465e..12b49b07 100644 --- a/models/create_metafields_request.go +++ b/models/create_metafields_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMetafieldsRequest represents a CreateMetafieldsRequest struct. type CreateMetafieldsRequest struct { - Metafields interface{} `json:"metafields"` + Metafields interface{} `json:"metafields"` } -// MarshalJSON implements the json.Marshaler interface for CreateMetafieldsRequest. +// MarshalJSON implements the json.Marshaler interface for CreateMetafieldsRequest. // It customizes the JSON marshaling process for CreateMetafieldsRequest objects. func (c *CreateMetafieldsRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMetafieldsRequest object to a map representation for JSON marshaling. func (c *CreateMetafieldsRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["metafields"] = c.Metafields - return structMap + structMap := make(map[string]any) + structMap["metafields"] = c.Metafields + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetafieldsRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMetafieldsRequest. // It customizes the JSON unmarshaling process for CreateMetafieldsRequest objects. func (c *CreateMetafieldsRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Metafields interface{} `json:"metafields"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Metafields = temp.Metafields - return nil + temp := &struct { + Metafields interface{} `json:"metafields"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Metafields = temp.Metafields + return nil } diff --git a/models/create_metered_component.go b/models/create_metered_component.go index 7d312a10..24c5cfac 100644 --- a/models/create_metered_component.go +++ b/models/create_metered_component.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMeteredComponent represents a CreateMeteredComponent struct. type CreateMeteredComponent struct { - MeteredComponent MeteredComponent `json:"metered_component"` + MeteredComponent MeteredComponent `json:"metered_component"` } -// MarshalJSON implements the json.Marshaler interface for CreateMeteredComponent. +// MarshalJSON implements the json.Marshaler interface for CreateMeteredComponent. // It customizes the JSON marshaling process for CreateMeteredComponent objects. func (c *CreateMeteredComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMeteredComponent object to a map representation for JSON marshaling. func (c *CreateMeteredComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["metered_component"] = c.MeteredComponent - return structMap + structMap := make(map[string]any) + structMap["metered_component"] = c.MeteredComponent.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMeteredComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMeteredComponent. // It customizes the JSON unmarshaling process for CreateMeteredComponent objects. func (c *CreateMeteredComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - MeteredComponent MeteredComponent `json:"metered_component"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.MeteredComponent = temp.MeteredComponent - return nil + temp := &struct { + MeteredComponent MeteredComponent `json:"metered_component"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.MeteredComponent = temp.MeteredComponent + return nil } diff --git a/models/create_multi_invoice_payment.go b/models/create_multi_invoice_payment.go index d7b0706d..8a196b95 100644 --- a/models/create_multi_invoice_payment.go +++ b/models/create_multi_invoice_payment.go @@ -1,73 +1,73 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMultiInvoicePayment represents a CreateMultiInvoicePayment struct. type CreateMultiInvoicePayment struct { - // A description to be attached to the payment. - Memo *string `json:"memo,omitempty"` - // Additional information related to the payment method (eg. Check #). - Details *string `json:"details,omitempty"` - // The type of payment method used. - Method *InvoicePaymentMethodType `json:"method,omitempty"` - // Dollar amount of the sum of the invoices payment (eg. "10.50" => $10.50). - Amount interface{} `json:"amount"` - // Date reflecting when the payment was received from a customer. Must be in the past. - ReceivedOn *string `json:"received_on,omitempty"` - Applications []CreateInvoicePaymentApplication `json:"applications"` + // A description to be attached to the payment. + Memo *string `json:"memo,omitempty"` + // Additional information related to the payment method (eg. Check #). + Details *string `json:"details,omitempty"` + // The type of payment method used. Defaults to other. + Method *InvoicePaymentMethodType `json:"method,omitempty"` + // Dollar amount of the sum of the invoices payment (eg. "10.50" => $10.50). + Amount interface{} `json:"amount"` + // Date reflecting when the payment was received from a customer. Must be in the past. + ReceivedOn *string `json:"received_on,omitempty"` + Applications []CreateInvoicePaymentApplication `json:"applications"` } -// MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePayment. +// MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePayment. // It customizes the JSON marshaling process for CreateMultiInvoicePayment objects. func (c *CreateMultiInvoicePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMultiInvoicePayment object to a map representation for JSON marshaling. func (c *CreateMultiInvoicePayment) toMap() map[string]any { - structMap := make(map[string]any) - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.Details != nil { - structMap["details"] = c.Details - } - if c.Method != nil { - structMap["method"] = c.Method - } - structMap["amount"] = c.Amount - if c.ReceivedOn != nil { - structMap["received_on"] = c.ReceivedOn - } - structMap["applications"] = c.Applications - return structMap + structMap := make(map[string]any) + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.Details != nil { + structMap["details"] = c.Details + } + if c.Method != nil { + structMap["method"] = c.Method + } + structMap["amount"] = c.Amount + if c.ReceivedOn != nil { + structMap["received_on"] = c.ReceivedOn + } + structMap["applications"] = c.Applications + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePayment. // It customizes the JSON unmarshaling process for CreateMultiInvoicePayment objects. func (c *CreateMultiInvoicePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Memo *string `json:"memo,omitempty"` - Details *string `json:"details,omitempty"` - Method *InvoicePaymentMethodType `json:"method,omitempty"` - Amount interface{} `json:"amount"` - ReceivedOn *string `json:"received_on,omitempty"` - Applications []CreateInvoicePaymentApplication `json:"applications"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Memo = temp.Memo - c.Details = temp.Details - c.Method = temp.Method - c.Amount = temp.Amount - c.ReceivedOn = temp.ReceivedOn - c.Applications = temp.Applications - return nil + temp := &struct { + Memo *string `json:"memo,omitempty"` + Details *string `json:"details,omitempty"` + Method *InvoicePaymentMethodType `json:"method,omitempty"` + Amount interface{} `json:"amount"` + ReceivedOn *string `json:"received_on,omitempty"` + Applications []CreateInvoicePaymentApplication `json:"applications"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Memo = temp.Memo + c.Details = temp.Details + c.Method = temp.Method + c.Amount = temp.Amount + c.ReceivedOn = temp.ReceivedOn + c.Applications = temp.Applications + return nil } diff --git a/models/create_multi_invoice_payment_request.go b/models/create_multi_invoice_payment_request.go index 2a56f9cc..0afeb286 100644 --- a/models/create_multi_invoice_payment_request.go +++ b/models/create_multi_invoice_payment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateMultiInvoicePaymentRequest represents a CreateMultiInvoicePaymentRequest struct. type CreateMultiInvoicePaymentRequest struct { - Payment CreateMultiInvoicePayment `json:"payment"` + Payment CreateMultiInvoicePayment `json:"payment"` } -// MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePaymentRequest. +// MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePaymentRequest. // It customizes the JSON marshaling process for CreateMultiInvoicePaymentRequest objects. func (c *CreateMultiInvoicePaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateMultiInvoicePaymentRequest object to a map representation for JSON marshaling. func (c *CreateMultiInvoicePaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment"] = c.Payment - return structMap + structMap := make(map[string]any) + structMap["payment"] = c.Payment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePaymentRequest. // It customizes the JSON unmarshaling process for CreateMultiInvoicePaymentRequest objects. func (c *CreateMultiInvoicePaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Payment CreateMultiInvoicePayment `json:"payment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Payment = temp.Payment - return nil + temp := &struct { + Payment CreateMultiInvoicePayment `json:"payment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Payment = temp.Payment + return nil } diff --git a/models/create_offer.go b/models/create_offer.go index e9cedc88..b2ddb162 100644 --- a/models/create_offer.go +++ b/models/create_offer.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOffer represents a CreateOffer struct. type CreateOffer struct { - Name string `json:"name"` - Handle string `json:"handle"` - Description *string `json:"description,omitempty"` - ProductId int `json:"product_id"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - Components []CreateOfferComponent `json:"components,omitempty"` - Coupons []string `json:"coupons,omitempty"` + Name string `json:"name"` + Handle string `json:"handle"` + Description *string `json:"description,omitempty"` + ProductId int `json:"product_id"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + Components []CreateOfferComponent `json:"components,omitempty"` + Coupons []string `json:"coupons,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateOffer. +// MarshalJSON implements the json.Marshaler interface for CreateOffer. // It customizes the JSON marshaling process for CreateOffer objects. func (c *CreateOffer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOffer object to a map representation for JSON marshaling. func (c *CreateOffer) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = c.Name - structMap["handle"] = c.Handle - if c.Description != nil { - structMap["description"] = c.Description - } - structMap["product_id"] = c.ProductId - if c.ProductPricePointId != nil { - structMap["product_price_point_id"] = c.ProductPricePointId - } - if c.Components != nil { - structMap["components"] = c.Components - } - if c.Coupons != nil { - structMap["coupons"] = c.Coupons - } - return structMap + structMap := make(map[string]any) + structMap["name"] = c.Name + structMap["handle"] = c.Handle + if c.Description != nil { + structMap["description"] = c.Description + } + structMap["product_id"] = c.ProductId + if c.ProductPricePointId != nil { + structMap["product_price_point_id"] = c.ProductPricePointId + } + if c.Components != nil { + structMap["components"] = c.Components + } + if c.Coupons != nil { + structMap["coupons"] = c.Coupons + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOffer. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOffer. // It customizes the JSON unmarshaling process for CreateOffer objects. func (c *CreateOffer) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - Handle string `json:"handle"` - Description *string `json:"description,omitempty"` - ProductId int `json:"product_id"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - Components []CreateOfferComponent `json:"components,omitempty"` - Coupons []string `json:"coupons,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Name = temp.Name - c.Handle = temp.Handle - c.Description = temp.Description - c.ProductId = temp.ProductId - c.ProductPricePointId = temp.ProductPricePointId - c.Components = temp.Components - c.Coupons = temp.Coupons - return nil + temp := &struct { + Name string `json:"name"` + Handle string `json:"handle"` + Description *string `json:"description,omitempty"` + ProductId int `json:"product_id"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + Components []CreateOfferComponent `json:"components,omitempty"` + Coupons []string `json:"coupons,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Name = temp.Name + c.Handle = temp.Handle + c.Description = temp.Description + c.ProductId = temp.ProductId + c.ProductPricePointId = temp.ProductPricePointId + c.Components = temp.Components + c.Coupons = temp.Coupons + return nil } diff --git a/models/create_offer_component.go b/models/create_offer_component.go index 8d4c08e5..1e07dde8 100644 --- a/models/create_offer_component.go +++ b/models/create_offer_component.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOfferComponent represents a CreateOfferComponent struct. type CreateOfferComponent struct { - ComponentId *int `json:"component_id,omitempty"` - StartingQuantity *int `json:"starting_quantity,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + StartingQuantity *int `json:"starting_quantity,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateOfferComponent. +// MarshalJSON implements the json.Marshaler interface for CreateOfferComponent. // It customizes the JSON marshaling process for CreateOfferComponent objects. func (c *CreateOfferComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOfferComponent object to a map representation for JSON marshaling. func (c *CreateOfferComponent) toMap() map[string]any { - structMap := make(map[string]any) - if c.ComponentId != nil { - structMap["component_id"] = c.ComponentId - } - if c.StartingQuantity != nil { - structMap["starting_quantity"] = c.StartingQuantity - } - return structMap + structMap := make(map[string]any) + if c.ComponentId != nil { + structMap["component_id"] = c.ComponentId + } + if c.StartingQuantity != nil { + structMap["starting_quantity"] = c.StartingQuantity + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferComponent. // It customizes the JSON unmarshaling process for CreateOfferComponent objects. func (c *CreateOfferComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *int `json:"component_id,omitempty"` - StartingQuantity *int `json:"starting_quantity,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ComponentId = temp.ComponentId - c.StartingQuantity = temp.StartingQuantity - return nil + temp := &struct { + ComponentId *int `json:"component_id,omitempty"` + StartingQuantity *int `json:"starting_quantity,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ComponentId = temp.ComponentId + c.StartingQuantity = temp.StartingQuantity + return nil } diff --git a/models/create_offer_request.go b/models/create_offer_request.go index cb34b83a..acb04dd4 100644 --- a/models/create_offer_request.go +++ b/models/create_offer_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOfferRequest represents a CreateOfferRequest struct. type CreateOfferRequest struct { - Offer CreateOffer `json:"offer"` + Offer CreateOffer `json:"offer"` } -// MarshalJSON implements the json.Marshaler interface for CreateOfferRequest. +// MarshalJSON implements the json.Marshaler interface for CreateOfferRequest. // It customizes the JSON marshaling process for CreateOfferRequest objects. func (c *CreateOfferRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOfferRequest object to a map representation for JSON marshaling. func (c *CreateOfferRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["offer"] = c.Offer - return structMap + structMap := make(map[string]any) + structMap["offer"] = c.Offer.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferRequest. // It customizes the JSON unmarshaling process for CreateOfferRequest objects. func (c *CreateOfferRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Offer CreateOffer `json:"offer"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Offer = temp.Offer - return nil + temp := &struct { + Offer CreateOffer `json:"offer"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Offer = temp.Offer + return nil } diff --git a/models/create_on_off_component.go b/models/create_on_off_component.go index 69fd99f0..27273ca6 100644 --- a/models/create_on_off_component.go +++ b/models/create_on_off_component.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOnOffComponent represents a CreateOnOffComponent struct. type CreateOnOffComponent struct { - OnOffComponent OnOffComponent `json:"on_off_component"` + OnOffComponent OnOffComponent `json:"on_off_component"` } -// MarshalJSON implements the json.Marshaler interface for CreateOnOffComponent. +// MarshalJSON implements the json.Marshaler interface for CreateOnOffComponent. // It customizes the JSON marshaling process for CreateOnOffComponent objects. func (c *CreateOnOffComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOnOffComponent object to a map representation for JSON marshaling. func (c *CreateOnOffComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["on_off_component"] = c.OnOffComponent - return structMap + structMap := make(map[string]any) + structMap["on_off_component"] = c.OnOffComponent.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOnOffComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOnOffComponent. // It customizes the JSON unmarshaling process for CreateOnOffComponent objects. func (c *CreateOnOffComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - OnOffComponent OnOffComponent `json:"on_off_component"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.OnOffComponent = temp.OnOffComponent - return nil + temp := &struct { + OnOffComponent OnOffComponent `json:"on_off_component"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.OnOffComponent = temp.OnOffComponent + return nil } diff --git a/models/create_or_update_coupon.go b/models/create_or_update_coupon.go index d8c6c1a1..5b8b7c74 100644 --- a/models/create_or_update_coupon.go +++ b/models/create_or_update_coupon.go @@ -1,56 +1,56 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOrUpdateCoupon represents a CreateOrUpdateCoupon struct. type CreateOrUpdateCoupon struct { - Coupon *interface{} `json:"coupon,omitempty"` - // An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product - RestrictedProducts map[string]bool `json:"restricted_products,omitempty"` - // An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component - RestrictedComponents map[string]bool `json:"restricted_components,omitempty"` + Coupon *interface{} `json:"coupon,omitempty"` + // An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product + RestrictedProducts map[string]bool `json:"restricted_products,omitempty"` + // An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component + RestrictedComponents map[string]bool `json:"restricted_components,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateCoupon. +// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateCoupon. // It customizes the JSON marshaling process for CreateOrUpdateCoupon objects. func (c *CreateOrUpdateCoupon) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOrUpdateCoupon object to a map representation for JSON marshaling. func (c *CreateOrUpdateCoupon) toMap() map[string]any { - structMap := make(map[string]any) - if c.Coupon != nil { - structMap["coupon"] = c.Coupon - } - if c.RestrictedProducts != nil { - structMap["restricted_products"] = c.RestrictedProducts - } - if c.RestrictedComponents != nil { - structMap["restricted_components"] = c.RestrictedComponents - } - return structMap + structMap := make(map[string]any) + if c.Coupon != nil { + structMap["coupon"] = c.Coupon + } + if c.RestrictedProducts != nil { + structMap["restricted_products"] = c.RestrictedProducts + } + if c.RestrictedComponents != nil { + structMap["restricted_components"] = c.RestrictedComponents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateCoupon. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateCoupon. // It customizes the JSON unmarshaling process for CreateOrUpdateCoupon objects. func (c *CreateOrUpdateCoupon) UnmarshalJSON(input []byte) error { - temp := &struct { - Coupon *interface{} `json:"coupon,omitempty"` - RestrictedProducts map[string]bool `json:"restricted_products,omitempty"` - RestrictedComponents map[string]bool `json:"restricted_components,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Coupon = temp.Coupon - c.RestrictedProducts = temp.RestrictedProducts - c.RestrictedComponents = temp.RestrictedComponents - return nil + temp := &struct { + Coupon *interface{} `json:"coupon,omitempty"` + RestrictedProducts map[string]bool `json:"restricted_products,omitempty"` + RestrictedComponents map[string]bool `json:"restricted_components,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Coupon = temp.Coupon + c.RestrictedProducts = temp.RestrictedProducts + c.RestrictedComponents = temp.RestrictedComponents + return nil } diff --git a/models/create_or_update_product.go b/models/create_or_update_product.go index 75acf58f..cb54748a 100644 --- a/models/create_or_update_product.go +++ b/models/create_or_update_product.go @@ -1,95 +1,95 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOrUpdateProduct represents a CreateOrUpdateProduct struct. type CreateOrUpdateProduct struct { - // The product name - Name string `json:"name"` - // The product API handle - Handle *string `json:"handle,omitempty"` - // The product description - Description string `json:"description"` - // E.g. Internal ID or SKU Number - AccountingCode *string `json:"accounting_code,omitempty"` - // Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. - RequireCreditCard *bool `json:"require_credit_card,omitempty"` - // The product price, in integer cents - PriceInCents int64 `json:"price_in_cents"` - // The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days - Interval int `json:"interval"` - // A string representing the interval unit for this product, either month or day - IntervalUnit IntervalUnit `json:"interval_unit"` - AutoCreateSignupPage *bool `json:"auto_create_signup_page,omitempty"` - // A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` + // The product name + Name string `json:"name"` + // The product API handle + Handle *string `json:"handle,omitempty"` + // The product description + Description string `json:"description"` + // E.g. Internal ID or SKU Number + AccountingCode *string `json:"accounting_code,omitempty"` + // Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. + RequireCreditCard *bool `json:"require_credit_card,omitempty"` + // The product price, in integer cents + PriceInCents int64 `json:"price_in_cents"` + // The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days + Interval int `json:"interval"` + // A string representing the interval unit for this product, either month or day + IntervalUnit IntervalUnit `json:"interval_unit"` + AutoCreateSignupPage *bool `json:"auto_create_signup_page,omitempty"` + // A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProduct. +// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProduct. // It customizes the JSON marshaling process for CreateOrUpdateProduct objects. func (c *CreateOrUpdateProduct) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOrUpdateProduct object to a map representation for JSON marshaling. func (c *CreateOrUpdateProduct) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = c.Name - if c.Handle != nil { - structMap["handle"] = c.Handle - } - structMap["description"] = c.Description - if c.AccountingCode != nil { - structMap["accounting_code"] = c.AccountingCode - } - if c.RequireCreditCard != nil { - structMap["require_credit_card"] = c.RequireCreditCard - } - structMap["price_in_cents"] = c.PriceInCents - structMap["interval"] = c.Interval - structMap["interval_unit"] = c.IntervalUnit - if c.AutoCreateSignupPage != nil { - structMap["auto_create_signup_page"] = c.AutoCreateSignupPage - } - if c.TaxCode != nil { - structMap["tax_code"] = c.TaxCode - } - return structMap + structMap := make(map[string]any) + structMap["name"] = c.Name + if c.Handle != nil { + structMap["handle"] = c.Handle + } + structMap["description"] = c.Description + if c.AccountingCode != nil { + structMap["accounting_code"] = c.AccountingCode + } + if c.RequireCreditCard != nil { + structMap["require_credit_card"] = c.RequireCreditCard + } + structMap["price_in_cents"] = c.PriceInCents + structMap["interval"] = c.Interval + structMap["interval_unit"] = c.IntervalUnit + if c.AutoCreateSignupPage != nil { + structMap["auto_create_signup_page"] = c.AutoCreateSignupPage + } + if c.TaxCode != nil { + structMap["tax_code"] = c.TaxCode + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProduct. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProduct. // It customizes the JSON unmarshaling process for CreateOrUpdateProduct objects. func (c *CreateOrUpdateProduct) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - Handle *string `json:"handle,omitempty"` - Description string `json:"description"` - AccountingCode *string `json:"accounting_code,omitempty"` - RequireCreditCard *bool `json:"require_credit_card,omitempty"` - PriceInCents int64 `json:"price_in_cents"` - Interval int `json:"interval"` - IntervalUnit IntervalUnit `json:"interval_unit"` - AutoCreateSignupPage *bool `json:"auto_create_signup_page,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Name = temp.Name - c.Handle = temp.Handle - c.Description = temp.Description - c.AccountingCode = temp.AccountingCode - c.RequireCreditCard = temp.RequireCreditCard - c.PriceInCents = temp.PriceInCents - c.Interval = temp.Interval - c.IntervalUnit = temp.IntervalUnit - c.AutoCreateSignupPage = temp.AutoCreateSignupPage - c.TaxCode = temp.TaxCode - return nil + temp := &struct { + Name string `json:"name"` + Handle *string `json:"handle,omitempty"` + Description string `json:"description"` + AccountingCode *string `json:"accounting_code,omitempty"` + RequireCreditCard *bool `json:"require_credit_card,omitempty"` + PriceInCents int64 `json:"price_in_cents"` + Interval int `json:"interval"` + IntervalUnit IntervalUnit `json:"interval_unit"` + AutoCreateSignupPage *bool `json:"auto_create_signup_page,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Name = temp.Name + c.Handle = temp.Handle + c.Description = temp.Description + c.AccountingCode = temp.AccountingCode + c.RequireCreditCard = temp.RequireCreditCard + c.PriceInCents = temp.PriceInCents + c.Interval = temp.Interval + c.IntervalUnit = temp.IntervalUnit + c.AutoCreateSignupPage = temp.AutoCreateSignupPage + c.TaxCode = temp.TaxCode + return nil } diff --git a/models/create_or_update_product_request.go b/models/create_or_update_product_request.go index ddba4597..3ffeb142 100644 --- a/models/create_or_update_product_request.go +++ b/models/create_or_update_product_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOrUpdateProductRequest represents a CreateOrUpdateProductRequest struct. type CreateOrUpdateProductRequest struct { - Product CreateOrUpdateProduct `json:"product"` + Product CreateOrUpdateProduct `json:"product"` } -// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProductRequest. +// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProductRequest. // It customizes the JSON marshaling process for CreateOrUpdateProductRequest objects. func (c *CreateOrUpdateProductRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOrUpdateProductRequest object to a map representation for JSON marshaling. func (c *CreateOrUpdateProductRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["product"] = c.Product - return structMap + structMap := make(map[string]any) + structMap["product"] = c.Product.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProductRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProductRequest. // It customizes the JSON unmarshaling process for CreateOrUpdateProductRequest objects. func (c *CreateOrUpdateProductRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Product CreateOrUpdateProduct `json:"product"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Product = temp.Product - return nil + temp := &struct { + Product CreateOrUpdateProduct `json:"product"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Product = temp.Product + return nil } diff --git a/models/create_or_update_segment_price.go b/models/create_or_update_segment_price.go index de92f619..57467ca3 100644 --- a/models/create_or_update_segment_price.go +++ b/models/create_or_update_segment_price.go @@ -1,53 +1,53 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateOrUpdateSegmentPrice represents a CreateOrUpdateSegmentPrice struct. type CreateOrUpdateSegmentPrice struct { - StartingQuantity *int `json:"starting_quantity,omitempty"` - EndingQuantity *int `json:"ending_quantity,omitempty"` - // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice interface{} `json:"unit_price"` + StartingQuantity *int `json:"starting_quantity,omitempty"` + EndingQuantity *int `json:"ending_quantity,omitempty"` + // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice interface{} `json:"unit_price"` } -// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateSegmentPrice. +// MarshalJSON implements the json.Marshaler interface for CreateOrUpdateSegmentPrice. // It customizes the JSON marshaling process for CreateOrUpdateSegmentPrice objects. func (c *CreateOrUpdateSegmentPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateOrUpdateSegmentPrice object to a map representation for JSON marshaling. func (c *CreateOrUpdateSegmentPrice) toMap() map[string]any { - structMap := make(map[string]any) - if c.StartingQuantity != nil { - structMap["starting_quantity"] = c.StartingQuantity - } - if c.EndingQuantity != nil { - structMap["ending_quantity"] = c.EndingQuantity - } - structMap["unit_price"] = c.UnitPrice - return structMap + structMap := make(map[string]any) + if c.StartingQuantity != nil { + structMap["starting_quantity"] = c.StartingQuantity + } + if c.EndingQuantity != nil { + structMap["ending_quantity"] = c.EndingQuantity + } + structMap["unit_price"] = c.UnitPrice + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateSegmentPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateSegmentPrice. // It customizes the JSON unmarshaling process for CreateOrUpdateSegmentPrice objects. func (c *CreateOrUpdateSegmentPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - StartingQuantity *int `json:"starting_quantity,omitempty"` - EndingQuantity *int `json:"ending_quantity,omitempty"` - UnitPrice interface{} `json:"unit_price"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.StartingQuantity = temp.StartingQuantity - c.EndingQuantity = temp.EndingQuantity - c.UnitPrice = temp.UnitPrice - return nil + temp := &struct { + StartingQuantity *int `json:"starting_quantity,omitempty"` + EndingQuantity *int `json:"ending_quantity,omitempty"` + UnitPrice interface{} `json:"unit_price"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.StartingQuantity = temp.StartingQuantity + c.EndingQuantity = temp.EndingQuantity + c.UnitPrice = temp.UnitPrice + return nil } diff --git a/models/create_payment.go b/models/create_payment.go index 973ae35a..331ccd8a 100644 --- a/models/create_payment.go +++ b/models/create_payment.go @@ -1,52 +1,52 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePayment represents a CreatePayment struct. type CreatePayment struct { - Amount string `json:"amount"` - Memo string `json:"memo"` - PaymentDetails string `json:"payment_details"` - PaymentMethod string `json:"payment_method"` + Amount string `json:"amount"` + Memo string `json:"memo"` + PaymentDetails string `json:"payment_details"` + PaymentMethod string `json:"payment_method"` } -// MarshalJSON implements the json.Marshaler interface for CreatePayment. +// MarshalJSON implements the json.Marshaler interface for CreatePayment. // It customizes the JSON marshaling process for CreatePayment objects. func (c *CreatePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePayment object to a map representation for JSON marshaling. func (c *CreatePayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount"] = c.Amount - structMap["memo"] = c.Memo - structMap["payment_details"] = c.PaymentDetails - structMap["payment_method"] = c.PaymentMethod - return structMap + structMap := make(map[string]any) + structMap["amount"] = c.Amount + structMap["memo"] = c.Memo + structMap["payment_details"] = c.PaymentDetails + structMap["payment_method"] = c.PaymentMethod + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePayment. // It customizes the JSON unmarshaling process for CreatePayment objects. func (c *CreatePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount string `json:"amount"` - Memo string `json:"memo"` - PaymentDetails string `json:"payment_details"` - PaymentMethod string `json:"payment_method"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Amount = temp.Amount - c.Memo = temp.Memo - c.PaymentDetails = temp.PaymentDetails - c.PaymentMethod = temp.PaymentMethod - return nil + temp := &struct { + Amount string `json:"amount"` + Memo string `json:"memo"` + PaymentDetails string `json:"payment_details"` + PaymentMethod string `json:"payment_method"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Amount = temp.Amount + c.Memo = temp.Memo + c.PaymentDetails = temp.PaymentDetails + c.PaymentMethod = temp.PaymentMethod + return nil } diff --git a/models/create_payment_profile.go b/models/create_payment_profile.go index 0f44fc87..e2d1beaf 100644 --- a/models/create_payment_profile.go +++ b/models/create_payment_profile.go @@ -1,257 +1,257 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePaymentProfile represents a CreatePaymentProfile struct. type CreatePaymentProfile struct { - // Token received after sending billing informations using chargify.js. - ChargifyToken *string `json:"chargify_token,omitempty"` - Id *int `json:"id,omitempty"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - // First name on card or bank account. If omitted, the first_name from customer attributes will be used. - FirstName *string `json:"first_name,omitempty"` - // Last name on card or bank account. If omitted, the last_name from customer attributes will be used. - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - // The full credit card number - FullNumber *string `json:"full_number,omitempty"` - // The type of card used. - CardType *CardType `json:"card_type,omitempty"` - // (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 - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - // (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 - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - // The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. - BillingAddress *string `json:"billing_address,omitempty"` - // Second line of the customer’s billing address i.e. Apt. 100 - BillingAddress2 Optional[string] `json:"billing_address_2"` - // The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. - BillingCity *string `json:"billing_city,omitempty"` - // 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. - BillingState *string `json:"billing_state,omitempty"` - // 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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. - BillingCountry *string `json:"billing_country,omitempty"` - // The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. - BillingZip *string `json:"billing_zip,omitempty"` - // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - // The “token” provided by your vault storage for an already stored payment profile - VaultToken *string `json:"vault_token,omitempty"` - // (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - // (Required when creating a new payment profile) The Chargify customer id. - CustomerId *int `json:"customer_id,omitempty"` - // used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. - PaypalEmail *string `json:"paypal_email,omitempty"` // Deprecated - // used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. - PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` // Deprecated - // 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. - GatewayHandle *string `json:"gateway_handle,omitempty"` - // The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. - Cvv *string `json:"cvv,omitempty"` - // (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides - BankName *string `json:"bank_name,omitempty"` - // (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided - BankIban *string `json:"bank_iban,omitempty"` - // (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 - BankRoutingNumber *string `json:"bank_routing_number,omitempty"` - // (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is blank) The customerʼs bank account number - BankAccountNumber *string `json:"bank_account_number,omitempty"` - // (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. Alternatively, an IBAN can be provided - BankBranchCode *string `json:"bank_branch_code,omitempty"` - // Defaults to checking - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - // Defaults to personal - BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` - // (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI - LastFour *string `json:"last_four,omitempty"` + // Token received after sending billing informations using chargify.js. + ChargifyToken *string `json:"chargify_token,omitempty"` + Id *int `json:"id,omitempty"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + // First name on card or bank account. If omitted, the first_name from customer attributes will be used. + FirstName *string `json:"first_name,omitempty"` + // Last name on card or bank account. If omitted, the last_name from customer attributes will be used. + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + // The full credit card number + FullNumber *string `json:"full_number,omitempty"` + // The type of card used. + CardType *CardType `json:"card_type,omitempty"` + // (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 + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + // (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 + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + // The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. + BillingAddress *string `json:"billing_address,omitempty"` + // Second line of the customer’s billing address i.e. Apt. 100 + BillingAddress2 Optional[string] `json:"billing_address_2"` + // The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. + BillingCity *string `json:"billing_city,omitempty"` + // 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. + BillingState *string `json:"billing_state,omitempty"` + // 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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. + BillingCountry *string `json:"billing_country,omitempty"` + // The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. + BillingZip *string `json:"billing_zip,omitempty"` + // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + // The “token” provided by your vault storage for an already stored payment profile + VaultToken *string `json:"vault_token,omitempty"` + // (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + // (Required when creating a new payment profile) The Chargify customer id. + CustomerId *int `json:"customer_id,omitempty"` + // used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. + PaypalEmail *string `json:"paypal_email,omitempty"` // Deprecated + // used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. + PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` // Deprecated + // 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. + GatewayHandle *string `json:"gateway_handle,omitempty"` + // The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. + Cvv *string `json:"cvv,omitempty"` + // (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides + BankName *string `json:"bank_name,omitempty"` + // (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided + BankIban *string `json:"bank_iban,omitempty"` + // (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 + BankRoutingNumber *string `json:"bank_routing_number,omitempty"` + // (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is blank) The customerʼs bank account number + BankAccountNumber *string `json:"bank_account_number,omitempty"` + // (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. Alternatively, an IBAN can be provided + BankBranchCode *string `json:"bank_branch_code,omitempty"` + // Defaults to checking + BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` + // Defaults to personal + BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` + // (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI + LastFour *string `json:"last_four,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreatePaymentProfile. +// MarshalJSON implements the json.Marshaler interface for CreatePaymentProfile. // It customizes the JSON marshaling process for CreatePaymentProfile objects. func (c *CreatePaymentProfile) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePaymentProfile object to a map representation for JSON marshaling. func (c *CreatePaymentProfile) toMap() map[string]any { - structMap := make(map[string]any) - if c.ChargifyToken != nil { - structMap["chargify_token"] = c.ChargifyToken - } - if c.Id != nil { - structMap["id"] = c.Id - } - if c.PaymentType != nil { - structMap["payment_type"] = c.PaymentType - } - if c.FirstName != nil { - structMap["first_name"] = c.FirstName - } - if c.LastName != nil { - structMap["last_name"] = c.LastName - } - if c.MaskedCardNumber != nil { - structMap["masked_card_number"] = c.MaskedCardNumber - } - if c.FullNumber != nil { - structMap["full_number"] = c.FullNumber - } - if c.CardType != nil { - structMap["card_type"] = c.CardType - } - if c.ExpirationMonth != nil { - structMap["expiration_month"] = c.ExpirationMonth - } - if c.ExpirationYear != nil { - structMap["expiration_year"] = c.ExpirationYear - } - if c.BillingAddress != nil { - structMap["billing_address"] = c.BillingAddress - } - if c.BillingAddress2.IsValueSet() { - structMap["billing_address_2"] = c.BillingAddress2.Value() - } - if c.BillingCity != nil { - structMap["billing_city"] = c.BillingCity - } - if c.BillingState != nil { - structMap["billing_state"] = c.BillingState - } - if c.BillingCountry != nil { - structMap["billing_country"] = c.BillingCountry - } - if c.BillingZip != nil { - structMap["billing_zip"] = c.BillingZip - } - if c.CurrentVault != nil { - structMap["current_vault"] = c.CurrentVault - } - if c.VaultToken != nil { - structMap["vault_token"] = c.VaultToken - } - if c.CustomerVaultToken != nil { - structMap["customer_vault_token"] = c.CustomerVaultToken - } - if c.CustomerId != nil { - structMap["customer_id"] = c.CustomerId - } - if c.PaypalEmail != nil { - structMap["paypal_email"] = c.PaypalEmail - } - if c.PaymentMethodNonce != nil { - structMap["payment_method_nonce"] = c.PaymentMethodNonce - } - if c.GatewayHandle != nil { - structMap["gateway_handle"] = c.GatewayHandle - } - if c.Cvv != nil { - structMap["cvv"] = c.Cvv - } - if c.BankName != nil { - structMap["bank_name"] = c.BankName - } - if c.BankIban != nil { - structMap["bank_iban"] = c.BankIban - } - if c.BankRoutingNumber != nil { - structMap["bank_routing_number"] = c.BankRoutingNumber - } - if c.BankAccountNumber != nil { - structMap["bank_account_number"] = c.BankAccountNumber - } - if c.BankBranchCode != nil { - structMap["bank_branch_code"] = c.BankBranchCode - } - if c.BankAccountType != nil { - structMap["bank_account_type"] = c.BankAccountType - } - if c.BankAccountHolderType != nil { - structMap["bank_account_holder_type"] = c.BankAccountHolderType - } - if c.LastFour != nil { - structMap["last_four"] = c.LastFour - } - return structMap + structMap := make(map[string]any) + if c.ChargifyToken != nil { + structMap["chargify_token"] = c.ChargifyToken + } + if c.Id != nil { + structMap["id"] = c.Id + } + if c.PaymentType != nil { + structMap["payment_type"] = c.PaymentType + } + if c.FirstName != nil { + structMap["first_name"] = c.FirstName + } + if c.LastName != nil { + structMap["last_name"] = c.LastName + } + if c.MaskedCardNumber != nil { + structMap["masked_card_number"] = c.MaskedCardNumber + } + if c.FullNumber != nil { + structMap["full_number"] = c.FullNumber + } + if c.CardType != nil { + structMap["card_type"] = c.CardType + } + if c.ExpirationMonth != nil { + structMap["expiration_month"] = c.ExpirationMonth + } + if c.ExpirationYear != nil { + structMap["expiration_year"] = c.ExpirationYear + } + if c.BillingAddress != nil { + structMap["billing_address"] = c.BillingAddress + } + if c.BillingAddress2.IsValueSet() { + structMap["billing_address_2"] = c.BillingAddress2.Value() + } + if c.BillingCity != nil { + structMap["billing_city"] = c.BillingCity + } + if c.BillingState != nil { + structMap["billing_state"] = c.BillingState + } + if c.BillingCountry != nil { + structMap["billing_country"] = c.BillingCountry + } + if c.BillingZip != nil { + structMap["billing_zip"] = c.BillingZip + } + if c.CurrentVault != nil { + structMap["current_vault"] = c.CurrentVault + } + if c.VaultToken != nil { + structMap["vault_token"] = c.VaultToken + } + if c.CustomerVaultToken != nil { + structMap["customer_vault_token"] = c.CustomerVaultToken + } + if c.CustomerId != nil { + structMap["customer_id"] = c.CustomerId + } + if c.PaypalEmail != nil { + structMap["paypal_email"] = c.PaypalEmail + } + if c.PaymentMethodNonce != nil { + structMap["payment_method_nonce"] = c.PaymentMethodNonce + } + if c.GatewayHandle != nil { + structMap["gateway_handle"] = c.GatewayHandle + } + if c.Cvv != nil { + structMap["cvv"] = c.Cvv + } + if c.BankName != nil { + structMap["bank_name"] = c.BankName + } + if c.BankIban != nil { + structMap["bank_iban"] = c.BankIban + } + if c.BankRoutingNumber != nil { + structMap["bank_routing_number"] = c.BankRoutingNumber + } + if c.BankAccountNumber != nil { + structMap["bank_account_number"] = c.BankAccountNumber + } + if c.BankBranchCode != nil { + structMap["bank_branch_code"] = c.BankBranchCode + } + if c.BankAccountType != nil { + structMap["bank_account_type"] = c.BankAccountType + } + if c.BankAccountHolderType != nil { + structMap["bank_account_holder_type"] = c.BankAccountHolderType + } + if c.LastFour != nil { + structMap["last_four"] = c.LastFour + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfile. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfile. // It customizes the JSON unmarshaling process for CreatePaymentProfile objects. func (c *CreatePaymentProfile) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyToken *string `json:"chargify_token,omitempty"` - Id *int `json:"id,omitempty"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - FullNumber *string `json:"full_number,omitempty"` - CardType *CardType `json:"card_type,omitempty"` - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingAddress2 Optional[string] `json:"billing_address_2"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - VaultToken *string `json:"vault_token,omitempty"` - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaypalEmail *string `json:"paypal_email,omitempty"` - PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` - Cvv *string `json:"cvv,omitempty"` - BankName *string `json:"bank_name,omitempty"` - BankIban *string `json:"bank_iban,omitempty"` - BankRoutingNumber *string `json:"bank_routing_number,omitempty"` - BankAccountNumber *string `json:"bank_account_number,omitempty"` - BankBranchCode *string `json:"bank_branch_code,omitempty"` - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` - LastFour *string `json:"last_four,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ChargifyToken = temp.ChargifyToken - c.Id = temp.Id - c.PaymentType = temp.PaymentType - c.FirstName = temp.FirstName - c.LastName = temp.LastName - c.MaskedCardNumber = temp.MaskedCardNumber - c.FullNumber = temp.FullNumber - c.CardType = temp.CardType - c.ExpirationMonth = temp.ExpirationMonth - c.ExpirationYear = temp.ExpirationYear - c.BillingAddress = temp.BillingAddress - c.BillingAddress2 = temp.BillingAddress2 - c.BillingCity = temp.BillingCity - c.BillingState = temp.BillingState - c.BillingCountry = temp.BillingCountry - c.BillingZip = temp.BillingZip - c.CurrentVault = temp.CurrentVault - c.VaultToken = temp.VaultToken - c.CustomerVaultToken = temp.CustomerVaultToken - c.CustomerId = temp.CustomerId - c.PaypalEmail = temp.PaypalEmail - c.PaymentMethodNonce = temp.PaymentMethodNonce - c.GatewayHandle = temp.GatewayHandle - c.Cvv = temp.Cvv - c.BankName = temp.BankName - c.BankIban = temp.BankIban - c.BankRoutingNumber = temp.BankRoutingNumber - c.BankAccountNumber = temp.BankAccountNumber - c.BankBranchCode = temp.BankBranchCode - c.BankAccountType = temp.BankAccountType - c.BankAccountHolderType = temp.BankAccountHolderType - c.LastFour = temp.LastFour - return nil + temp := &struct { + ChargifyToken *string `json:"chargify_token,omitempty"` + Id *int `json:"id,omitempty"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + FullNumber *string `json:"full_number,omitempty"` + CardType *CardType `json:"card_type,omitempty"` + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingAddress2 Optional[string] `json:"billing_address_2"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + VaultToken *string `json:"vault_token,omitempty"` + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaypalEmail *string `json:"paypal_email,omitempty"` + PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` + Cvv *string `json:"cvv,omitempty"` + BankName *string `json:"bank_name,omitempty"` + BankIban *string `json:"bank_iban,omitempty"` + BankRoutingNumber *string `json:"bank_routing_number,omitempty"` + BankAccountNumber *string `json:"bank_account_number,omitempty"` + BankBranchCode *string `json:"bank_branch_code,omitempty"` + BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` + BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` + LastFour *string `json:"last_four,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ChargifyToken = temp.ChargifyToken + c.Id = temp.Id + c.PaymentType = temp.PaymentType + c.FirstName = temp.FirstName + c.LastName = temp.LastName + c.MaskedCardNumber = temp.MaskedCardNumber + c.FullNumber = temp.FullNumber + c.CardType = temp.CardType + c.ExpirationMonth = temp.ExpirationMonth + c.ExpirationYear = temp.ExpirationYear + c.BillingAddress = temp.BillingAddress + c.BillingAddress2 = temp.BillingAddress2 + c.BillingCity = temp.BillingCity + c.BillingState = temp.BillingState + c.BillingCountry = temp.BillingCountry + c.BillingZip = temp.BillingZip + c.CurrentVault = temp.CurrentVault + c.VaultToken = temp.VaultToken + c.CustomerVaultToken = temp.CustomerVaultToken + c.CustomerId = temp.CustomerId + c.PaypalEmail = temp.PaypalEmail + c.PaymentMethodNonce = temp.PaymentMethodNonce + c.GatewayHandle = temp.GatewayHandle + c.Cvv = temp.Cvv + c.BankName = temp.BankName + c.BankIban = temp.BankIban + c.BankRoutingNumber = temp.BankRoutingNumber + c.BankAccountNumber = temp.BankAccountNumber + c.BankBranchCode = temp.BankBranchCode + c.BankAccountType = temp.BankAccountType + c.BankAccountHolderType = temp.BankAccountHolderType + c.LastFour = temp.LastFour + return nil } diff --git a/models/create_payment_profile_request.go b/models/create_payment_profile_request.go index 05ccd6e2..f8c7e703 100644 --- a/models/create_payment_profile_request.go +++ b/models/create_payment_profile_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePaymentProfileRequest represents a CreatePaymentProfileRequest struct. type CreatePaymentProfileRequest struct { - PaymentProfile CreatePaymentProfile `json:"payment_profile"` + PaymentProfile CreatePaymentProfile `json:"payment_profile"` } -// MarshalJSON implements the json.Marshaler interface for CreatePaymentProfileRequest. +// MarshalJSON implements the json.Marshaler interface for CreatePaymentProfileRequest. // It customizes the JSON marshaling process for CreatePaymentProfileRequest objects. func (c *CreatePaymentProfileRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePaymentProfileRequest object to a map representation for JSON marshaling. func (c *CreatePaymentProfileRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment_profile"] = c.PaymentProfile - return structMap + structMap := make(map[string]any) + structMap["payment_profile"] = c.PaymentProfile.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfileRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfileRequest. // It customizes the JSON unmarshaling process for CreatePaymentProfileRequest objects. func (c *CreatePaymentProfileRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PaymentProfile CreatePaymentProfile `json:"payment_profile"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.PaymentProfile = temp.PaymentProfile - return nil + temp := &struct { + PaymentProfile CreatePaymentProfile `json:"payment_profile"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.PaymentProfile = temp.PaymentProfile + return nil } diff --git a/models/create_prepaid_component.go b/models/create_prepaid_component.go index 5b4e9293..e7e80d37 100644 --- a/models/create_prepaid_component.go +++ b/models/create_prepaid_component.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePrepaidComponent represents a CreatePrepaidComponent struct. type CreatePrepaidComponent struct { - PrepaidUsageComponent PrepaidUsageComponent `json:"prepaid_usage_component"` + PrepaidUsageComponent PrepaidUsageComponent `json:"prepaid_usage_component"` } -// MarshalJSON implements the json.Marshaler interface for CreatePrepaidComponent. +// MarshalJSON implements the json.Marshaler interface for CreatePrepaidComponent. // It customizes the JSON marshaling process for CreatePrepaidComponent objects. func (c *CreatePrepaidComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePrepaidComponent object to a map representation for JSON marshaling. func (c *CreatePrepaidComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepaid_usage_component"] = c.PrepaidUsageComponent - return structMap + structMap := make(map[string]any) + structMap["prepaid_usage_component"] = c.PrepaidUsageComponent.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaidComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaidComponent. // It customizes the JSON unmarshaling process for CreatePrepaidComponent objects. func (c *CreatePrepaidComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - PrepaidUsageComponent PrepaidUsageComponent `json:"prepaid_usage_component"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.PrepaidUsageComponent = temp.PrepaidUsageComponent - return nil + temp := &struct { + PrepaidUsageComponent PrepaidUsageComponent `json:"prepaid_usage_component"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.PrepaidUsageComponent = temp.PrepaidUsageComponent + return nil } diff --git a/models/create_prepayment.go b/models/create_prepayment.go index 50d25e9f..2ccd1c69 100644 --- a/models/create_prepayment.go +++ b/models/create_prepayment.go @@ -1,59 +1,59 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePrepayment represents a CreatePrepayment struct. type CreatePrepayment struct { - Amount float64 `json:"amount"` - Details string `json:"details"` - Memo string `json:"memo"` - // :- 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 PrepaymentMethod `json:"method"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` + Amount float64 `json:"amount"` + Details string `json:"details"` + Memo string `json:"memo"` + // :- 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 PrepaymentMethod `json:"method"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreatePrepayment. +// MarshalJSON implements the json.Marshaler interface for CreatePrepayment. // It customizes the JSON marshaling process for CreatePrepayment objects. func (c *CreatePrepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePrepayment object to a map representation for JSON marshaling. func (c *CreatePrepayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount"] = c.Amount - structMap["details"] = c.Details - structMap["memo"] = c.Memo - structMap["method"] = c.Method - if c.PaymentProfileId != nil { - structMap["payment_profile_id"] = c.PaymentProfileId - } - return structMap + structMap := make(map[string]any) + structMap["amount"] = c.Amount + structMap["details"] = c.Details + structMap["memo"] = c.Memo + structMap["method"] = c.Method + if c.PaymentProfileId != nil { + structMap["payment_profile_id"] = c.PaymentProfileId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepayment. // It customizes the JSON unmarshaling process for CreatePrepayment objects. func (c *CreatePrepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount float64 `json:"amount"` - Details string `json:"details"` - Memo string `json:"memo"` - Method PrepaymentMethod `json:"method"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Amount = temp.Amount - c.Details = temp.Details - c.Memo = temp.Memo - c.Method = temp.Method - c.PaymentProfileId = temp.PaymentProfileId - return nil + temp := &struct { + Amount float64 `json:"amount"` + Details string `json:"details"` + Memo string `json:"memo"` + Method PrepaymentMethod `json:"method"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Amount = temp.Amount + c.Details = temp.Details + c.Memo = temp.Memo + c.Method = temp.Method + c.PaymentProfileId = temp.PaymentProfileId + return nil } diff --git a/models/create_prepayment_request.go b/models/create_prepayment_request.go index 902becb9..23d6b5a1 100644 --- a/models/create_prepayment_request.go +++ b/models/create_prepayment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePrepaymentRequest represents a CreatePrepaymentRequest struct. type CreatePrepaymentRequest struct { - Prepayment CreatePrepayment `json:"prepayment"` + Prepayment CreatePrepayment `json:"prepayment"` } -// MarshalJSON implements the json.Marshaler interface for CreatePrepaymentRequest. +// MarshalJSON implements the json.Marshaler interface for CreatePrepaymentRequest. // It customizes the JSON marshaling process for CreatePrepaymentRequest objects. func (c *CreatePrepaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePrepaymentRequest object to a map representation for JSON marshaling. func (c *CreatePrepaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayment"] = c.Prepayment - return structMap + structMap := make(map[string]any) + structMap["prepayment"] = c.Prepayment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentRequest. // It customizes the JSON unmarshaling process for CreatePrepaymentRequest objects. func (c *CreatePrepaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayment CreatePrepayment `json:"prepayment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Prepayment = temp.Prepayment - return nil + temp := &struct { + Prepayment CreatePrepayment `json:"prepayment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Prepayment = temp.Prepayment + return nil } diff --git a/models/create_prepayment_response.go b/models/create_prepayment_response.go index b85f9c21..42e75900 100644 --- a/models/create_prepayment_response.go +++ b/models/create_prepayment_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatePrepaymentResponse represents a CreatePrepaymentResponse struct. type CreatePrepaymentResponse struct { - Prepayment CreatedPrepayment `json:"prepayment"` + Prepayment CreatedPrepayment `json:"prepayment"` } -// MarshalJSON implements the json.Marshaler interface for CreatePrepaymentResponse. +// MarshalJSON implements the json.Marshaler interface for CreatePrepaymentResponse. // It customizes the JSON marshaling process for CreatePrepaymentResponse objects. func (c *CreatePrepaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatePrepaymentResponse object to a map representation for JSON marshaling. func (c *CreatePrepaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayment"] = c.Prepayment - return structMap + structMap := make(map[string]any) + structMap["prepayment"] = c.Prepayment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentResponse. // It customizes the JSON unmarshaling process for CreatePrepaymentResponse objects. func (c *CreatePrepaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayment CreatedPrepayment `json:"prepayment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Prepayment = temp.Prepayment - return nil + temp := &struct { + Prepayment CreatedPrepayment `json:"prepayment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Prepayment = temp.Prepayment + return nil } diff --git a/models/create_product_currency_price.go b/models/create_product_currency_price.go index 375dc9ce..702ee5d6 100644 --- a/models/create_product_currency_price.go +++ b/models/create_product_currency_price.go @@ -1,51 +1,51 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductCurrencyPrice represents a CreateProductCurrencyPrice struct. type CreateProductCurrencyPrice struct { - // ISO code for one of the site level currencies. - Currency string `json:"currency"` - // Price for the given role. - Price int `json:"price"` - // Role for the price. - Role CurrencyPriceRole `json:"role"` + // ISO code for one of the site level currencies. + Currency string `json:"currency"` + // Price for the given role. + Price int `json:"price"` + // Role for the price. + Role CurrencyPriceRole `json:"role"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPrice. +// MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPrice. // It customizes the JSON marshaling process for CreateProductCurrencyPrice objects. func (c *CreateProductCurrencyPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductCurrencyPrice object to a map representation for JSON marshaling. func (c *CreateProductCurrencyPrice) toMap() map[string]any { - structMap := make(map[string]any) - structMap["currency"] = c.Currency - structMap["price"] = c.Price - structMap["role"] = c.Role - return structMap + structMap := make(map[string]any) + structMap["currency"] = c.Currency + structMap["price"] = c.Price + structMap["role"] = c.Role + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPrice. // It customizes the JSON unmarshaling process for CreateProductCurrencyPrice objects. func (c *CreateProductCurrencyPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Currency string `json:"currency"` - Price int `json:"price"` - Role CurrencyPriceRole `json:"role"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Currency = temp.Currency - c.Price = temp.Price - c.Role = temp.Role - return nil + temp := &struct { + Currency string `json:"currency"` + Price int `json:"price"` + Role CurrencyPriceRole `json:"role"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Currency = temp.Currency + c.Price = temp.Price + c.Role = temp.Role + return nil } diff --git a/models/create_product_currency_prices_request.go b/models/create_product_currency_prices_request.go index bd1ecc16..b9e9682a 100644 --- a/models/create_product_currency_prices_request.go +++ b/models/create_product_currency_prices_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductCurrencyPricesRequest represents a CreateProductCurrencyPricesRequest struct. type CreateProductCurrencyPricesRequest struct { - CurrencyPrices []CreateProductCurrencyPrice `json:"currency_prices"` + CurrencyPrices []CreateProductCurrencyPrice `json:"currency_prices"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPricesRequest. +// MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPricesRequest. // It customizes the JSON marshaling process for CreateProductCurrencyPricesRequest objects. func (c *CreateProductCurrencyPricesRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductCurrencyPricesRequest object to a map representation for JSON marshaling. func (c *CreateProductCurrencyPricesRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["currency_prices"] = c.CurrencyPrices - return structMap + structMap := make(map[string]any) + structMap["currency_prices"] = c.CurrencyPrices + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPricesRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPricesRequest. // It customizes the JSON unmarshaling process for CreateProductCurrencyPricesRequest objects. func (c *CreateProductCurrencyPricesRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrencyPrices []CreateProductCurrencyPrice `json:"currency_prices"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.CurrencyPrices = temp.CurrencyPrices - return nil + temp := &struct { + CurrencyPrices []CreateProductCurrencyPrice `json:"currency_prices"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.CurrencyPrices = temp.CurrencyPrices + return nil } diff --git a/models/create_product_family.go b/models/create_product_family.go index 3796c225..41811d50 100644 --- a/models/create_product_family.go +++ b/models/create_product_family.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductFamily represents a CreateProductFamily struct. type CreateProductFamily struct { - Name *string `json:"name,omitempty"` - Description Optional[string] `json:"description"` + Name *string `json:"name,omitempty"` + Description Optional[string] `json:"description"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductFamily. +// MarshalJSON implements the json.Marshaler interface for CreateProductFamily. // It customizes the JSON marshaling process for CreateProductFamily objects. func (c *CreateProductFamily) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductFamily object to a map representation for JSON marshaling. func (c *CreateProductFamily) toMap() map[string]any { - structMap := make(map[string]any) - if c.Name != nil { - structMap["name"] = c.Name - } - if c.Description.IsValueSet() { - structMap["description"] = c.Description.Value() - } - return structMap + structMap := make(map[string]any) + if c.Name != nil { + structMap["name"] = c.Name + } + if c.Description.IsValueSet() { + structMap["description"] = c.Description.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamily. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamily. // It customizes the JSON unmarshaling process for CreateProductFamily objects. func (c *CreateProductFamily) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Description Optional[string] `json:"description"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Name = temp.Name - c.Description = temp.Description - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Description Optional[string] `json:"description"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Name = temp.Name + c.Description = temp.Description + return nil } diff --git a/models/create_product_family_request.go b/models/create_product_family_request.go index d6e9b556..b35e81f1 100644 --- a/models/create_product_family_request.go +++ b/models/create_product_family_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductFamilyRequest represents a CreateProductFamilyRequest struct. type CreateProductFamilyRequest struct { - ProductFamily CreateProductFamily `json:"product_family"` + ProductFamily CreateProductFamily `json:"product_family"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductFamilyRequest. +// MarshalJSON implements the json.Marshaler interface for CreateProductFamilyRequest. // It customizes the JSON marshaling process for CreateProductFamilyRequest objects. func (c *CreateProductFamilyRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductFamilyRequest object to a map representation for JSON marshaling. func (c *CreateProductFamilyRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["product_family"] = c.ProductFamily - return structMap + structMap := make(map[string]any) + structMap["product_family"] = c.ProductFamily.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamilyRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamilyRequest. // It customizes the JSON unmarshaling process for CreateProductFamilyRequest objects. func (c *CreateProductFamilyRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductFamily CreateProductFamily `json:"product_family"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ProductFamily = temp.ProductFamily - return nil + temp := &struct { + ProductFamily CreateProductFamily `json:"product_family"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ProductFamily = temp.ProductFamily + return nil } diff --git a/models/create_product_price_point.go b/models/create_product_price_point.go index e7592177..08a0ce27 100644 --- a/models/create_product_price_point.go +++ b/models/create_product_price_point.go @@ -1,124 +1,124 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductPricePoint represents a CreateProductPricePoint struct. type CreateProductPricePoint struct { - // The product price point name - Name string `json:"name"` - // The product price point API handle - Handle *string `json:"handle,omitempty"` - // The product price point price, in integer cents - PriceInCents int64 `json:"price_in_cents"` - // 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 `json:"interval"` - // A string representing the interval unit for this product price point, either month or day - IntervalUnit IntervalUnit `json:"interval_unit"` - // The product price point trial price, in integer cents - TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` - // The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days - TrialInterval *int `json:"trial_interval,omitempty"` - // A string representing the trial interval unit for this product price point, either month or day - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - TrialType *string `json:"trial_type,omitempty"` - // The product price point initial charge, in integer cents - InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - // 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 every 30 days - ExpirationInterval *int `json:"expiration_interval,omitempty"` - // A string representing the expiration interval unit for this product price point, either month or day - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - // Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + // The product price point name + Name string `json:"name"` + // The product price point API handle + Handle *string `json:"handle,omitempty"` + // The product price point price, in integer cents + PriceInCents int64 `json:"price_in_cents"` + // 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 `json:"interval"` + // A string representing the interval unit for this product price point, either month or day + IntervalUnit IntervalUnit `json:"interval_unit"` + // The product price point trial price, in integer cents + TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` + // The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days + TrialInterval *int `json:"trial_interval,omitempty"` + // A string representing the trial interval unit for this product price point, either month or day + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + TrialType *string `json:"trial_type,omitempty"` + // The product price point initial charge, in integer cents + InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + // 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 every 30 days + ExpirationInterval *int `json:"expiration_interval,omitempty"` + // A string representing the expiration interval unit for this product price point, either month or day + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + // Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductPricePoint. +// MarshalJSON implements the json.Marshaler interface for CreateProductPricePoint. // It customizes the JSON marshaling process for CreateProductPricePoint objects. func (c *CreateProductPricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductPricePoint object to a map representation for JSON marshaling. func (c *CreateProductPricePoint) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = c.Name - if c.Handle != nil { - structMap["handle"] = c.Handle - } - structMap["price_in_cents"] = c.PriceInCents - structMap["interval"] = c.Interval - structMap["interval_unit"] = c.IntervalUnit - if c.TrialPriceInCents != nil { - structMap["trial_price_in_cents"] = c.TrialPriceInCents - } - if c.TrialInterval != nil { - structMap["trial_interval"] = c.TrialInterval - } - if c.TrialIntervalUnit != nil { - structMap["trial_interval_unit"] = c.TrialIntervalUnit - } - if c.TrialType != nil { - structMap["trial_type"] = c.TrialType - } - if c.InitialChargeInCents != nil { - structMap["initial_charge_in_cents"] = c.InitialChargeInCents - } - if c.InitialChargeAfterTrial != nil { - structMap["initial_charge_after_trial"] = c.InitialChargeAfterTrial - } - if c.ExpirationInterval != nil { - structMap["expiration_interval"] = c.ExpirationInterval - } - if c.ExpirationIntervalUnit != nil { - structMap["expiration_interval_unit"] = c.ExpirationIntervalUnit - } - if c.UseSiteExchangeRate != nil { - structMap["use_site_exchange_rate"] = c.UseSiteExchangeRate - } - return structMap + structMap := make(map[string]any) + structMap["name"] = c.Name + if c.Handle != nil { + structMap["handle"] = c.Handle + } + structMap["price_in_cents"] = c.PriceInCents + structMap["interval"] = c.Interval + structMap["interval_unit"] = c.IntervalUnit + if c.TrialPriceInCents != nil { + structMap["trial_price_in_cents"] = c.TrialPriceInCents + } + if c.TrialInterval != nil { + structMap["trial_interval"] = c.TrialInterval + } + if c.TrialIntervalUnit != nil { + structMap["trial_interval_unit"] = c.TrialIntervalUnit + } + if c.TrialType != nil { + structMap["trial_type"] = c.TrialType + } + if c.InitialChargeInCents != nil { + structMap["initial_charge_in_cents"] = c.InitialChargeInCents + } + if c.InitialChargeAfterTrial != nil { + structMap["initial_charge_after_trial"] = c.InitialChargeAfterTrial + } + if c.ExpirationInterval != nil { + structMap["expiration_interval"] = c.ExpirationInterval + } + if c.ExpirationIntervalUnit != nil { + structMap["expiration_interval_unit"] = c.ExpirationIntervalUnit + } + if c.UseSiteExchangeRate != nil { + structMap["use_site_exchange_rate"] = c.UseSiteExchangeRate + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePoint. // It customizes the JSON unmarshaling process for CreateProductPricePoint objects. func (c *CreateProductPricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - Handle *string `json:"handle,omitempty"` - PriceInCents int64 `json:"price_in_cents"` - Interval int `json:"interval"` - IntervalUnit IntervalUnit `json:"interval_unit"` - TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` - TrialInterval *int `json:"trial_interval,omitempty"` - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - TrialType *string `json:"trial_type,omitempty"` - InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - ExpirationInterval *int `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Name = temp.Name - c.Handle = temp.Handle - c.PriceInCents = temp.PriceInCents - c.Interval = temp.Interval - c.IntervalUnit = temp.IntervalUnit - c.TrialPriceInCents = temp.TrialPriceInCents - c.TrialInterval = temp.TrialInterval - c.TrialIntervalUnit = temp.TrialIntervalUnit - c.TrialType = temp.TrialType - c.InitialChargeInCents = temp.InitialChargeInCents - c.InitialChargeAfterTrial = temp.InitialChargeAfterTrial - c.ExpirationInterval = temp.ExpirationInterval - c.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - c.UseSiteExchangeRate = temp.UseSiteExchangeRate - return nil + temp := &struct { + Name string `json:"name"` + Handle *string `json:"handle,omitempty"` + PriceInCents int64 `json:"price_in_cents"` + Interval int `json:"interval"` + IntervalUnit IntervalUnit `json:"interval_unit"` + TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` + TrialInterval *int `json:"trial_interval,omitempty"` + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + TrialType *string `json:"trial_type,omitempty"` + InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + ExpirationInterval *int `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Name = temp.Name + c.Handle = temp.Handle + c.PriceInCents = temp.PriceInCents + c.Interval = temp.Interval + c.IntervalUnit = temp.IntervalUnit + c.TrialPriceInCents = temp.TrialPriceInCents + c.TrialInterval = temp.TrialInterval + c.TrialIntervalUnit = temp.TrialIntervalUnit + c.TrialType = temp.TrialType + c.InitialChargeInCents = temp.InitialChargeInCents + c.InitialChargeAfterTrial = temp.InitialChargeAfterTrial + c.ExpirationInterval = temp.ExpirationInterval + c.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + c.UseSiteExchangeRate = temp.UseSiteExchangeRate + return nil } diff --git a/models/create_product_price_point_request.go b/models/create_product_price_point_request.go index f3ab7bef..618509d9 100644 --- a/models/create_product_price_point_request.go +++ b/models/create_product_price_point_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateProductPricePointRequest represents a CreateProductPricePointRequest struct. type CreateProductPricePointRequest struct { - PricePoint CreateProductPricePoint `json:"price_point"` + PricePoint CreateProductPricePoint `json:"price_point"` } -// MarshalJSON implements the json.Marshaler interface for CreateProductPricePointRequest. +// MarshalJSON implements the json.Marshaler interface for CreateProductPricePointRequest. // It customizes the JSON marshaling process for CreateProductPricePointRequest objects. func (c *CreateProductPricePointRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateProductPricePointRequest object to a map representation for JSON marshaling. func (c *CreateProductPricePointRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["price_point"] = c.PricePoint - return structMap + structMap := make(map[string]any) + structMap["price_point"] = c.PricePoint.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePointRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePointRequest. // It customizes the JSON unmarshaling process for CreateProductPricePointRequest objects. func (c *CreateProductPricePointRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoint CreateProductPricePoint `json:"price_point"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.PricePoint = temp.PricePoint - return nil + temp := &struct { + PricePoint CreateProductPricePoint `json:"price_point"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.PricePoint = temp.PricePoint + return nil } diff --git a/models/create_quantity_based_component.go b/models/create_quantity_based_component.go index 13c7cdc6..9c1da459 100644 --- a/models/create_quantity_based_component.go +++ b/models/create_quantity_based_component.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateQuantityBasedComponent represents a CreateQuantityBasedComponent struct. type CreateQuantityBasedComponent struct { - QuantityBasedComponent QuantityBasedComponent `json:"quantity_based_component"` + QuantityBasedComponent QuantityBasedComponent `json:"quantity_based_component"` } -// MarshalJSON implements the json.Marshaler interface for CreateQuantityBasedComponent. +// MarshalJSON implements the json.Marshaler interface for CreateQuantityBasedComponent. // It customizes the JSON marshaling process for CreateQuantityBasedComponent objects. func (c *CreateQuantityBasedComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateQuantityBasedComponent object to a map representation for JSON marshaling. func (c *CreateQuantityBasedComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["quantity_based_component"] = c.QuantityBasedComponent - return structMap + structMap := make(map[string]any) + structMap["quantity_based_component"] = c.QuantityBasedComponent.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateQuantityBasedComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateQuantityBasedComponent. // It customizes the JSON unmarshaling process for CreateQuantityBasedComponent objects. func (c *CreateQuantityBasedComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - QuantityBasedComponent QuantityBasedComponent `json:"quantity_based_component"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.QuantityBasedComponent = temp.QuantityBasedComponent - return nil + temp := &struct { + QuantityBasedComponent QuantityBasedComponent `json:"quantity_based_component"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.QuantityBasedComponent = temp.QuantityBasedComponent + return nil } diff --git a/models/create_reason_code.go b/models/create_reason_code.go index 84b9526f..78d0b3be 100644 --- a/models/create_reason_code.go +++ b/models/create_reason_code.go @@ -1,53 +1,53 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateReasonCode represents a CreateReasonCode struct. type CreateReasonCode struct { - // The unique identifier for the ReasonCode - Code string `json:"code"` - // The friendly summary of what the code signifies - Description string `json:"description"` - // The order that code appears in lists - Position *int `json:"position,omitempty"` + // The unique identifier for the ReasonCode + Code string `json:"code"` + // The friendly summary of what the code signifies + Description string `json:"description"` + // The order that code appears in lists + Position *int `json:"position,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateReasonCode. +// MarshalJSON implements the json.Marshaler interface for CreateReasonCode. // It customizes the JSON marshaling process for CreateReasonCode objects. func (c *CreateReasonCode) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateReasonCode object to a map representation for JSON marshaling. func (c *CreateReasonCode) toMap() map[string]any { - structMap := make(map[string]any) - structMap["code"] = c.Code - structMap["description"] = c.Description - if c.Position != nil { - structMap["position"] = c.Position - } - return structMap + structMap := make(map[string]any) + structMap["code"] = c.Code + structMap["description"] = c.Description + if c.Position != nil { + structMap["position"] = c.Position + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCode. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCode. // It customizes the JSON unmarshaling process for CreateReasonCode objects. func (c *CreateReasonCode) UnmarshalJSON(input []byte) error { - temp := &struct { - Code string `json:"code"` - Description string `json:"description"` - Position *int `json:"position,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Code = temp.Code - c.Description = temp.Description - c.Position = temp.Position - return nil + temp := &struct { + Code string `json:"code"` + Description string `json:"description"` + Position *int `json:"position,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Code = temp.Code + c.Description = temp.Description + c.Position = temp.Position + return nil } diff --git a/models/create_reason_code_request.go b/models/create_reason_code_request.go index 11a30c82..52d4a11f 100644 --- a/models/create_reason_code_request.go +++ b/models/create_reason_code_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateReasonCodeRequest represents a CreateReasonCodeRequest struct. type CreateReasonCodeRequest struct { - ReasonCode CreateReasonCode `json:"reason_code"` + ReasonCode CreateReasonCode `json:"reason_code"` } -// MarshalJSON implements the json.Marshaler interface for CreateReasonCodeRequest. +// MarshalJSON implements the json.Marshaler interface for CreateReasonCodeRequest. // It customizes the JSON marshaling process for CreateReasonCodeRequest objects. func (c *CreateReasonCodeRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateReasonCodeRequest object to a map representation for JSON marshaling. func (c *CreateReasonCodeRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["reason_code"] = c.ReasonCode - return structMap + structMap := make(map[string]any) + structMap["reason_code"] = c.ReasonCode.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCodeRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCodeRequest. // It customizes the JSON unmarshaling process for CreateReasonCodeRequest objects. func (c *CreateReasonCodeRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - ReasonCode CreateReasonCode `json:"reason_code"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ReasonCode = temp.ReasonCode - return nil + temp := &struct { + ReasonCode CreateReasonCode `json:"reason_code"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ReasonCode = temp.ReasonCode + return nil } diff --git a/models/create_segment.go b/models/create_segment.go index 3fab3393..8d6eadfa 100644 --- a/models/create_segment.go +++ b/models/create_segment.go @@ -1,75 +1,75 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSegment represents a CreateSegment struct. type CreateSegment struct { - // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. - SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` - // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. - SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` - // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. - SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` - // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. - SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` + // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. + SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` + // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. + SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` + // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. + SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` + // A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric. + SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateSegment. +// MarshalJSON implements the json.Marshaler interface for CreateSegment. // It customizes the JSON marshaling process for CreateSegment objects. func (c *CreateSegment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSegment object to a map representation for JSON marshaling. func (c *CreateSegment) toMap() map[string]any { - structMap := make(map[string]any) - if c.SegmentProperty1Value != nil { - structMap["segment_property_1_value"] = c.SegmentProperty1Value - } - if c.SegmentProperty2Value != nil { - structMap["segment_property_2_value"] = c.SegmentProperty2Value - } - if c.SegmentProperty3Value != nil { - structMap["segment_property_3_value"] = c.SegmentProperty3Value - } - if c.SegmentProperty4Value != nil { - structMap["segment_property_4_value"] = c.SegmentProperty4Value - } - structMap["pricing_scheme"] = c.PricingScheme - if c.Prices != nil { - structMap["prices"] = c.Prices - } - return structMap + structMap := make(map[string]any) + if c.SegmentProperty1Value != nil { + structMap["segment_property_1_value"] = c.SegmentProperty1Value + } + if c.SegmentProperty2Value != nil { + structMap["segment_property_2_value"] = c.SegmentProperty2Value + } + if c.SegmentProperty3Value != nil { + structMap["segment_property_3_value"] = c.SegmentProperty3Value + } + if c.SegmentProperty4Value != nil { + structMap["segment_property_4_value"] = c.SegmentProperty4Value + } + structMap["pricing_scheme"] = c.PricingScheme + if c.Prices != nil { + structMap["prices"] = c.Prices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSegment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSegment. // It customizes the JSON unmarshaling process for CreateSegment objects. func (c *CreateSegment) UnmarshalJSON(input []byte) error { - temp := &struct { - SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` - SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` - SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` - SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.SegmentProperty1Value = temp.SegmentProperty1Value - c.SegmentProperty2Value = temp.SegmentProperty2Value - c.SegmentProperty3Value = temp.SegmentProperty3Value - c.SegmentProperty4Value = temp.SegmentProperty4Value - c.PricingScheme = temp.PricingScheme - c.Prices = temp.Prices - return nil + temp := &struct { + SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` + SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` + SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` + SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.SegmentProperty1Value = temp.SegmentProperty1Value + c.SegmentProperty2Value = temp.SegmentProperty2Value + c.SegmentProperty3Value = temp.SegmentProperty3Value + c.SegmentProperty4Value = temp.SegmentProperty4Value + c.PricingScheme = temp.PricingScheme + c.Prices = temp.Prices + return nil } diff --git a/models/create_segment_request.go b/models/create_segment_request.go index 8a293a48..aadeadf4 100644 --- a/models/create_segment_request.go +++ b/models/create_segment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSegmentRequest represents a CreateSegmentRequest struct. type CreateSegmentRequest struct { - Segment CreateSegment `json:"segment"` + Segment CreateSegment `json:"segment"` } -// MarshalJSON implements the json.Marshaler interface for CreateSegmentRequest. +// MarshalJSON implements the json.Marshaler interface for CreateSegmentRequest. // It customizes the JSON marshaling process for CreateSegmentRequest objects. func (c *CreateSegmentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSegmentRequest object to a map representation for JSON marshaling. func (c *CreateSegmentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["segment"] = c.Segment - return structMap + structMap := make(map[string]any) + structMap["segment"] = c.Segment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSegmentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSegmentRequest. // It customizes the JSON unmarshaling process for CreateSegmentRequest objects. func (c *CreateSegmentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Segment CreateSegment `json:"segment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Segment = temp.Segment - return nil + temp := &struct { + Segment CreateSegment `json:"segment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Segment = temp.Segment + return nil } diff --git a/models/create_subscription.go b/models/create_subscription.go index 5e6ad7de..49d1fca2 100644 --- a/models/create_subscription.go +++ b/models/create_subscription.go @@ -1,398 +1,404 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // CreateSubscription represents a CreateSubscription struct. type CreateSubscription struct { - // The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. - ProductHandle *string `json:"product_handle,omitempty"` - // The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead. - ProductId *int `json:"product_id,omitempty"` - // The user-friendly API handle of a product's particular price point. - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - // The ID of the particular price point on the product. - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - // (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. - CouponCode *string `json:"coupon_code,omitempty"` - // An array for all the coupons attached to the subscription. - CouponCodes []string `json:"coupon_codes,omitempty"` - // 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`. - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - // (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. - ReceivesInvoiceEmails *string `json:"receives_invoice_emails,omitempty"` - // (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. - NetTerms *string `json:"net_terms,omitempty"` - // The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. - CustomerId *int `json:"customer_id,omitempty"` - // (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-chargify.zendesk.com/hc/en-us/articles/5404863655821#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. - NextBillingAt *time.Time `json:"next_billing_at,omitempty"` - // (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. - InitialBillingAt *string `json:"initial_billing_at,omitempty"` - // 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. - StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` - SalesRepId *int `json:"sales_rep_id,omitempty"` - // 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) - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - // The reference value (provided by your app) for the subscription itelf. - Reference *string `json:"reference,omitempty"` - CustomerAttributes *CustomerAttributes `json:"customer_attributes,omitempty"` - // alias to credit_card_attributes - PaymentProfileAttributes *PaymentProfileAttributes `json:"payment_profile_attributes,omitempty"` - // Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. - CreditCardAttributes *PaymentProfileAttributes `json:"credit_card_attributes,omitempty"` - BankAccountAttributes *BankAccountAttributes `json:"bank_account_attributes,omitempty"` - // (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677) for more information. - Components []CreateSubscriptionComponent `json:"components,omitempty"` - // (Optional). Cannot be used when also specifying next_billing_at - CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` - // (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. - Metafields map[string]string `json:"metafields,omitempty"` - // 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. - CustomerReference *string `json:"customer_reference,omitempty"` - Group *GroupSettings `json:"group,omitempty"` - // A valid referral code. (optional, see [Referrals](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405420204045-Referrals-Reference#how-to-obtain-referral-codes) for more details). If supplied, must be valid, or else subscription creation will fail. - Ref *string `json:"ref,omitempty"` - // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about the reason for cancellation. - CancellationMessage *string `json:"cancellation_message,omitempty"` - // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about how the subscription was canceled. - CancellationMethod *string `json:"cancellation_method,omitempty"` - // (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. - Currency *string `json:"currency,omitempty"` - // Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. - ExpiresAt *time.Time `json:"expires_at,omitempty"` - // (Optional, default false) When set to true, and when next_billing_at is present, if the subscription expires, the expires_at will be shifted by the same amount of time as the difference between the old and new “next billing” dates. - ExpirationTracksNextBillingChange *string `json:"expiration_tracks_next_billing_change,omitempty"` - // (Optional) The ACH authorization agreement terms. If enabled, an email will be sent to the customer with a copy of the terms. - AgreementTerms *string `json:"agreement_terms,omitempty"` - // (Optional) The first name of the person authorizing the ACH agreement. - AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"` - // (Optional) The last name of the person authorizing the ACH agreement. - AuthorizerLastName *string `json:"authorizer_last_name,omitempty"` - // (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). - CalendarBillingFirstCharge *string `json:"calendar_billing_first_charge,omitempty"` - // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. - ReasonCode *string `json:"reason_code,omitempty"` - // (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. - ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` - // 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 - OfferId *interface{} `json:"offer_id,omitempty"` - PrepaidConfiguration *UpsertPrepaidConfiguration `json:"prepaid_configuration,omitempty"` - // Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. - PreviousBillingAt *time.Time `json:"previous_billing_at,omitempty"` - // Setting this attribute to true will cause the subscription's MRR to be added to your MRR analytics immediately. For this value to be honored, a next_billing_at must be present and set to a future date. This key/value will not be returned in the subscription response body. - ImportMrr *bool `json:"import_mrr,omitempty"` - CanceledAt *string `json:"canceled_at,omitempty"` - ActivatedAt *time.Time `json:"activated_at,omitempty"` - // Required when creating a subscription with Maxio Payments. - AgreementAcceptance *AgreementAcceptance `json:"agreement_acceptance,omitempty"` - // (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. - AchAgreement *ACHAgreement `json:"ach_agreement,omitempty"` - // 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. - DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` - // Time zone for the Dunning Communication Delay feature. - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` - // Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. - SkipBillingManifestTaxes *bool `json:"skip_billing_manifest_taxes,omitempty"` + // The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. + ProductHandle *string `json:"product_handle,omitempty"` + // The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead. + ProductId *int `json:"product_id,omitempty"` + // The user-friendly API handle of a product's particular price point. + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + // The ID of the particular price point on the product. + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + // (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. + CouponCode *string `json:"coupon_code,omitempty"` + // An array for all the coupons attached to the subscription. + CouponCodes []string `json:"coupon_codes,omitempty"` + // 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`. + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + // (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. + ReceivesInvoiceEmails *string `json:"receives_invoice_emails,omitempty"` + // (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. + NetTerms *string `json:"net_terms,omitempty"` + // The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. + CustomerId *int `json:"customer_id,omitempty"` + // (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-chargify.zendesk.com/hc/en-us/articles/5404863655821#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. + NextBillingAt *time.Time `json:"next_billing_at,omitempty"` + // (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. + InitialBillingAt *time.Time `json:"initial_billing_at,omitempty"` + // 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. + StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` + SalesRepId *int `json:"sales_rep_id,omitempty"` + // 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) + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + // The reference value (provided by your app) for the subscription itelf. + Reference *string `json:"reference,omitempty"` + CustomerAttributes *CustomerAttributes `json:"customer_attributes,omitempty"` + // alias to credit_card_attributes + PaymentProfileAttributes *PaymentProfileAttributes `json:"payment_profile_attributes,omitempty"` + // Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. + CreditCardAttributes *PaymentProfileAttributes `json:"credit_card_attributes,omitempty"` + BankAccountAttributes *BankAccountAttributes `json:"bank_account_attributes,omitempty"` + // (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677) for more information. + Components []CreateSubscriptionComponent `json:"components,omitempty"` + // (Optional). Cannot be used when also specifying next_billing_at + CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` + // (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. + Metafields map[string]string `json:"metafields,omitempty"` + // 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. + CustomerReference *string `json:"customer_reference,omitempty"` + Group *GroupSettings `json:"group,omitempty"` + // A valid referral code. (optional, see [Referrals](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405420204045-Referrals-Reference#how-to-obtain-referral-codes) for more details). If supplied, must be valid, or else subscription creation will fail. + Ref *string `json:"ref,omitempty"` + // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about the reason for cancellation. + CancellationMessage *string `json:"cancellation_message,omitempty"` + // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about how the subscription was canceled. + CancellationMethod *string `json:"cancellation_method,omitempty"` + // (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. + Currency *string `json:"currency,omitempty"` + // Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // (Optional, default false) When set to true, and when next_billing_at is present, if the subscription expires, the expires_at will be shifted by the same amount of time as the difference between the old and new “next billing” dates. + ExpirationTracksNextBillingChange *string `json:"expiration_tracks_next_billing_change,omitempty"` + // (Optional) The ACH authorization agreement terms. If enabled, an email will be sent to the customer with a copy of the terms. + AgreementTerms *string `json:"agreement_terms,omitempty"` + // (Optional) The first name of the person authorizing the ACH agreement. + AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"` + // (Optional) The last name of the person authorizing the ACH agreement. + AuthorizerLastName *string `json:"authorizer_last_name,omitempty"` + // (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). + CalendarBillingFirstCharge *string `json:"calendar_billing_first_charge,omitempty"` + // (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. + ReasonCode *string `json:"reason_code,omitempty"` + // (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. + ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` + // 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 + OfferId *interface{} `json:"offer_id,omitempty"` + PrepaidConfiguration *UpsertPrepaidConfiguration `json:"prepaid_configuration,omitempty"` + // Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. + PreviousBillingAt *time.Time `json:"previous_billing_at,omitempty"` + // Setting this attribute to true will cause the subscription's MRR to be added to your MRR analytics immediately. For this value to be honored, a next_billing_at must be present and set to a future date. This key/value will not be returned in the subscription response body. + ImportMrr *bool `json:"import_mrr,omitempty"` + CanceledAt *string `json:"canceled_at,omitempty"` + ActivatedAt *time.Time `json:"activated_at,omitempty"` + // Required when creating a subscription with Maxio Payments. + AgreementAcceptance *AgreementAcceptance `json:"agreement_acceptance,omitempty"` + // (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. + AchAgreement *ACHAgreement `json:"ach_agreement,omitempty"` + // 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. + DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` + // Time zone for the Dunning Communication Delay feature. + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + // Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. + SkipBillingManifestTaxes *bool `json:"skip_billing_manifest_taxes,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateSubscription. +// MarshalJSON implements the json.Marshaler interface for CreateSubscription. // It customizes the JSON marshaling process for CreateSubscription objects. func (c *CreateSubscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSubscription object to a map representation for JSON marshaling. func (c *CreateSubscription) toMap() map[string]any { - structMap := make(map[string]any) - if c.ProductHandle != nil { - structMap["product_handle"] = c.ProductHandle - } - if c.ProductId != nil { - structMap["product_id"] = c.ProductId - } - if c.ProductPricePointHandle != nil { - structMap["product_price_point_handle"] = c.ProductPricePointHandle - } - if c.ProductPricePointId != nil { - structMap["product_price_point_id"] = c.ProductPricePointId - } - if c.CustomPrice != nil { - structMap["custom_price"] = c.CustomPrice - } - if c.CouponCode != nil { - structMap["coupon_code"] = c.CouponCode - } - if c.CouponCodes != nil { - structMap["coupon_codes"] = c.CouponCodes - } - if c.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = c.PaymentCollectionMethod - } - if c.ReceivesInvoiceEmails != nil { - structMap["receives_invoice_emails"] = c.ReceivesInvoiceEmails - } - if c.NetTerms != nil { - structMap["net_terms"] = c.NetTerms - } - if c.CustomerId != nil { - structMap["customer_id"] = c.CustomerId - } - if c.NextBillingAt != nil { - structMap["next_billing_at"] = c.NextBillingAt.Format(time.RFC3339) - } - if c.InitialBillingAt != nil { - structMap["initial_billing_at"] = c.InitialBillingAt - } - if c.StoredCredentialTransactionId != nil { - structMap["stored_credential_transaction_id"] = c.StoredCredentialTransactionId - } - if c.SalesRepId != nil { - structMap["sales_rep_id"] = c.SalesRepId - } - if c.PaymentProfileId != nil { - structMap["payment_profile_id"] = c.PaymentProfileId - } - if c.Reference != nil { - structMap["reference"] = c.Reference - } - if c.CustomerAttributes != nil { - structMap["customer_attributes"] = c.CustomerAttributes - } - if c.PaymentProfileAttributes != nil { - structMap["payment_profile_attributes"] = c.PaymentProfileAttributes - } - if c.CreditCardAttributes != nil { - structMap["credit_card_attributes"] = c.CreditCardAttributes - } - if c.BankAccountAttributes != nil { - structMap["bank_account_attributes"] = c.BankAccountAttributes - } - if c.Components != nil { - structMap["components"] = c.Components - } - if c.CalendarBilling != nil { - structMap["calendar_billing"] = c.CalendarBilling - } - if c.Metafields != nil { - structMap["metafields"] = c.Metafields - } - if c.CustomerReference != nil { - structMap["customer_reference"] = c.CustomerReference - } - if c.Group != nil { - structMap["group"] = c.Group - } - if c.Ref != nil { - structMap["ref"] = c.Ref - } - if c.CancellationMessage != nil { - structMap["cancellation_message"] = c.CancellationMessage - } - if c.CancellationMethod != nil { - structMap["cancellation_method"] = c.CancellationMethod - } - if c.Currency != nil { - structMap["currency"] = c.Currency - } - if c.ExpiresAt != nil { - structMap["expires_at"] = c.ExpiresAt.Format(time.RFC3339) - } - if c.ExpirationTracksNextBillingChange != nil { - structMap["expiration_tracks_next_billing_change"] = c.ExpirationTracksNextBillingChange - } - if c.AgreementTerms != nil { - structMap["agreement_terms"] = c.AgreementTerms - } - if c.AuthorizerFirstName != nil { - structMap["authorizer_first_name"] = c.AuthorizerFirstName - } - if c.AuthorizerLastName != nil { - structMap["authorizer_last_name"] = c.AuthorizerLastName - } - if c.CalendarBillingFirstCharge != nil { - structMap["calendar_billing_first_charge"] = c.CalendarBillingFirstCharge - } - if c.ReasonCode != nil { - structMap["reason_code"] = c.ReasonCode - } - if c.ProductChangeDelayed != nil { - structMap["product_change_delayed"] = c.ProductChangeDelayed - } - if c.OfferId != nil { - structMap["offer_id"] = c.OfferId - } - if c.PrepaidConfiguration != nil { - structMap["prepaid_configuration"] = c.PrepaidConfiguration - } - if c.PreviousBillingAt != nil { - structMap["previous_billing_at"] = c.PreviousBillingAt.Format(time.RFC3339) - } - if c.ImportMrr != nil { - structMap["import_mrr"] = c.ImportMrr - } - if c.CanceledAt != nil { - structMap["canceled_at"] = c.CanceledAt - } - if c.ActivatedAt != nil { - structMap["activated_at"] = c.ActivatedAt.Format(time.RFC3339) - } - if c.AgreementAcceptance != nil { - structMap["agreement_acceptance"] = c.AgreementAcceptance - } - if c.AchAgreement != nil { - structMap["ach_agreement"] = c.AchAgreement - } - if c.DunningCommunicationDelayEnabled.IsValueSet() { - structMap["dunning_communication_delay_enabled"] = c.DunningCommunicationDelayEnabled.Value() - } - if c.DunningCommunicationDelayTimeZone.IsValueSet() { - structMap["dunning_communication_delay_time_zone"] = c.DunningCommunicationDelayTimeZone.Value() - } - if c.SkipBillingManifestTaxes != nil { - structMap["skip_billing_manifest_taxes"] = c.SkipBillingManifestTaxes - } - return structMap + structMap := make(map[string]any) + if c.ProductHandle != nil { + structMap["product_handle"] = c.ProductHandle + } + if c.ProductId != nil { + structMap["product_id"] = c.ProductId + } + if c.ProductPricePointHandle != nil { + structMap["product_price_point_handle"] = c.ProductPricePointHandle + } + if c.ProductPricePointId != nil { + structMap["product_price_point_id"] = c.ProductPricePointId + } + if c.CustomPrice != nil { + structMap["custom_price"] = c.CustomPrice.toMap() + } + if c.CouponCode != nil { + structMap["coupon_code"] = c.CouponCode + } + if c.CouponCodes != nil { + structMap["coupon_codes"] = c.CouponCodes + } + if c.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = c.PaymentCollectionMethod + } + if c.ReceivesInvoiceEmails != nil { + structMap["receives_invoice_emails"] = c.ReceivesInvoiceEmails + } + if c.NetTerms != nil { + structMap["net_terms"] = c.NetTerms + } + if c.CustomerId != nil { + structMap["customer_id"] = c.CustomerId + } + if c.NextBillingAt != nil { + structMap["next_billing_at"] = c.NextBillingAt.Format(time.RFC3339) + } + if c.InitialBillingAt != nil { + structMap["initial_billing_at"] = c.InitialBillingAt.Format(time.RFC3339) + } + if c.StoredCredentialTransactionId != nil { + structMap["stored_credential_transaction_id"] = c.StoredCredentialTransactionId + } + if c.SalesRepId != nil { + structMap["sales_rep_id"] = c.SalesRepId + } + if c.PaymentProfileId != nil { + structMap["payment_profile_id"] = c.PaymentProfileId + } + if c.Reference != nil { + structMap["reference"] = c.Reference + } + if c.CustomerAttributes != nil { + structMap["customer_attributes"] = c.CustomerAttributes.toMap() + } + if c.PaymentProfileAttributes != nil { + structMap["payment_profile_attributes"] = c.PaymentProfileAttributes.toMap() + } + if c.CreditCardAttributes != nil { + structMap["credit_card_attributes"] = c.CreditCardAttributes.toMap() + } + if c.BankAccountAttributes != nil { + structMap["bank_account_attributes"] = c.BankAccountAttributes.toMap() + } + if c.Components != nil { + structMap["components"] = c.Components + } + if c.CalendarBilling != nil { + structMap["calendar_billing"] = c.CalendarBilling.toMap() + } + if c.Metafields != nil { + structMap["metafields"] = c.Metafields + } + if c.CustomerReference != nil { + structMap["customer_reference"] = c.CustomerReference + } + if c.Group != nil { + structMap["group"] = c.Group.toMap() + } + if c.Ref != nil { + structMap["ref"] = c.Ref + } + if c.CancellationMessage != nil { + structMap["cancellation_message"] = c.CancellationMessage + } + if c.CancellationMethod != nil { + structMap["cancellation_method"] = c.CancellationMethod + } + if c.Currency != nil { + structMap["currency"] = c.Currency + } + if c.ExpiresAt != nil { + structMap["expires_at"] = c.ExpiresAt.Format(time.RFC3339) + } + if c.ExpirationTracksNextBillingChange != nil { + structMap["expiration_tracks_next_billing_change"] = c.ExpirationTracksNextBillingChange + } + if c.AgreementTerms != nil { + structMap["agreement_terms"] = c.AgreementTerms + } + if c.AuthorizerFirstName != nil { + structMap["authorizer_first_name"] = c.AuthorizerFirstName + } + if c.AuthorizerLastName != nil { + structMap["authorizer_last_name"] = c.AuthorizerLastName + } + if c.CalendarBillingFirstCharge != nil { + structMap["calendar_billing_first_charge"] = c.CalendarBillingFirstCharge + } + if c.ReasonCode != nil { + structMap["reason_code"] = c.ReasonCode + } + if c.ProductChangeDelayed != nil { + structMap["product_change_delayed"] = c.ProductChangeDelayed + } + if c.OfferId != nil { + structMap["offer_id"] = c.OfferId + } + if c.PrepaidConfiguration != nil { + structMap["prepaid_configuration"] = c.PrepaidConfiguration.toMap() + } + if c.PreviousBillingAt != nil { + structMap["previous_billing_at"] = c.PreviousBillingAt.Format(time.RFC3339) + } + if c.ImportMrr != nil { + structMap["import_mrr"] = c.ImportMrr + } + if c.CanceledAt != nil { + structMap["canceled_at"] = c.CanceledAt + } + if c.ActivatedAt != nil { + structMap["activated_at"] = c.ActivatedAt.Format(time.RFC3339) + } + if c.AgreementAcceptance != nil { + structMap["agreement_acceptance"] = c.AgreementAcceptance.toMap() + } + if c.AchAgreement != nil { + structMap["ach_agreement"] = c.AchAgreement.toMap() + } + if c.DunningCommunicationDelayEnabled.IsValueSet() { + structMap["dunning_communication_delay_enabled"] = c.DunningCommunicationDelayEnabled.Value() + } + if c.DunningCommunicationDelayTimeZone.IsValueSet() { + structMap["dunning_communication_delay_time_zone"] = c.DunningCommunicationDelayTimeZone.Value() + } + if c.SkipBillingManifestTaxes != nil { + structMap["skip_billing_manifest_taxes"] = c.SkipBillingManifestTaxes + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscription. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscription. // It customizes the JSON unmarshaling process for CreateSubscription objects. func (c *CreateSubscription) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductHandle *string `json:"product_handle,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - CouponCode *string `json:"coupon_code,omitempty"` - CouponCodes []string `json:"coupon_codes,omitempty"` - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - ReceivesInvoiceEmails *string `json:"receives_invoice_emails,omitempty"` - NetTerms *string `json:"net_terms,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - NextBillingAt *string `json:"next_billing_at,omitempty"` - InitialBillingAt *string `json:"initial_billing_at,omitempty"` - StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` - SalesRepId *int `json:"sales_rep_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - Reference *string `json:"reference,omitempty"` - CustomerAttributes *CustomerAttributes `json:"customer_attributes,omitempty"` - PaymentProfileAttributes *PaymentProfileAttributes `json:"payment_profile_attributes,omitempty"` - CreditCardAttributes *PaymentProfileAttributes `json:"credit_card_attributes,omitempty"` - BankAccountAttributes *BankAccountAttributes `json:"bank_account_attributes,omitempty"` - Components []CreateSubscriptionComponent `json:"components,omitempty"` - CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` - Metafields map[string]string `json:"metafields,omitempty"` - CustomerReference *string `json:"customer_reference,omitempty"` - Group *GroupSettings `json:"group,omitempty"` - Ref *string `json:"ref,omitempty"` - CancellationMessage *string `json:"cancellation_message,omitempty"` - CancellationMethod *string `json:"cancellation_method,omitempty"` - Currency *string `json:"currency,omitempty"` - ExpiresAt *string `json:"expires_at,omitempty"` - ExpirationTracksNextBillingChange *string `json:"expiration_tracks_next_billing_change,omitempty"` - AgreementTerms *string `json:"agreement_terms,omitempty"` - AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"` - AuthorizerLastName *string `json:"authorizer_last_name,omitempty"` - CalendarBillingFirstCharge *string `json:"calendar_billing_first_charge,omitempty"` - ReasonCode *string `json:"reason_code,omitempty"` - ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` - OfferId *interface{} `json:"offer_id,omitempty"` - PrepaidConfiguration *UpsertPrepaidConfiguration `json:"prepaid_configuration,omitempty"` - PreviousBillingAt *string `json:"previous_billing_at,omitempty"` - ImportMrr *bool `json:"import_mrr,omitempty"` - CanceledAt *string `json:"canceled_at,omitempty"` - ActivatedAt *string `json:"activated_at,omitempty"` - AgreementAcceptance *AgreementAcceptance `json:"agreement_acceptance,omitempty"` - AchAgreement *ACHAgreement `json:"ach_agreement,omitempty"` - DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` - SkipBillingManifestTaxes *bool `json:"skip_billing_manifest_taxes,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ProductHandle = temp.ProductHandle - c.ProductId = temp.ProductId - c.ProductPricePointHandle = temp.ProductPricePointHandle - c.ProductPricePointId = temp.ProductPricePointId - c.CustomPrice = temp.CustomPrice - c.CouponCode = temp.CouponCode - c.CouponCodes = temp.CouponCodes - c.PaymentCollectionMethod = temp.PaymentCollectionMethod - c.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails - c.NetTerms = temp.NetTerms - c.CustomerId = temp.CustomerId - if temp.NextBillingAt != nil { - NextBillingAtVal, err := time.Parse(time.RFC3339, *temp.NextBillingAt) - if err != nil { - log.Fatalf("Cannot Parse next_billing_at as % s format.", time.RFC3339) - } - c.NextBillingAt = &NextBillingAtVal - } - c.InitialBillingAt = temp.InitialBillingAt - c.StoredCredentialTransactionId = temp.StoredCredentialTransactionId - c.SalesRepId = temp.SalesRepId - c.PaymentProfileId = temp.PaymentProfileId - c.Reference = temp.Reference - c.CustomerAttributes = temp.CustomerAttributes - c.PaymentProfileAttributes = temp.PaymentProfileAttributes - c.CreditCardAttributes = temp.CreditCardAttributes - c.BankAccountAttributes = temp.BankAccountAttributes - c.Components = temp.Components - c.CalendarBilling = temp.CalendarBilling - c.Metafields = temp.Metafields - c.CustomerReference = temp.CustomerReference - c.Group = temp.Group - c.Ref = temp.Ref - c.CancellationMessage = temp.CancellationMessage - c.CancellationMethod = temp.CancellationMethod - c.Currency = temp.Currency - if temp.ExpiresAt != nil { - ExpiresAtVal, err := time.Parse(time.RFC3339, *temp.ExpiresAt) - if err != nil { - log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) - } - c.ExpiresAt = &ExpiresAtVal - } - c.ExpirationTracksNextBillingChange = temp.ExpirationTracksNextBillingChange - c.AgreementTerms = temp.AgreementTerms - c.AuthorizerFirstName = temp.AuthorizerFirstName - c.AuthorizerLastName = temp.AuthorizerLastName - c.CalendarBillingFirstCharge = temp.CalendarBillingFirstCharge - c.ReasonCode = temp.ReasonCode - c.ProductChangeDelayed = temp.ProductChangeDelayed - c.OfferId = temp.OfferId - c.PrepaidConfiguration = temp.PrepaidConfiguration - if temp.PreviousBillingAt != nil { - PreviousBillingAtVal, err := time.Parse(time.RFC3339, *temp.PreviousBillingAt) - if err != nil { - log.Fatalf("Cannot Parse previous_billing_at as % s format.", time.RFC3339) - } - c.PreviousBillingAt = &PreviousBillingAtVal - } - c.ImportMrr = temp.ImportMrr - c.CanceledAt = temp.CanceledAt - if temp.ActivatedAt != nil { - ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) - if err != nil { - log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) - } - c.ActivatedAt = &ActivatedAtVal - } - c.AgreementAcceptance = temp.AgreementAcceptance - c.AchAgreement = temp.AchAgreement - c.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled - c.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone - c.SkipBillingManifestTaxes = temp.SkipBillingManifestTaxes - return nil + temp := &struct { + ProductHandle *string `json:"product_handle,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + CouponCode *string `json:"coupon_code,omitempty"` + CouponCodes []string `json:"coupon_codes,omitempty"` + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + ReceivesInvoiceEmails *string `json:"receives_invoice_emails,omitempty"` + NetTerms *string `json:"net_terms,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + NextBillingAt *string `json:"next_billing_at,omitempty"` + InitialBillingAt *string `json:"initial_billing_at,omitempty"` + StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` + SalesRepId *int `json:"sales_rep_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + Reference *string `json:"reference,omitempty"` + CustomerAttributes *CustomerAttributes `json:"customer_attributes,omitempty"` + PaymentProfileAttributes *PaymentProfileAttributes `json:"payment_profile_attributes,omitempty"` + CreditCardAttributes *PaymentProfileAttributes `json:"credit_card_attributes,omitempty"` + BankAccountAttributes *BankAccountAttributes `json:"bank_account_attributes,omitempty"` + Components []CreateSubscriptionComponent `json:"components,omitempty"` + CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` + Metafields map[string]string `json:"metafields,omitempty"` + CustomerReference *string `json:"customer_reference,omitempty"` + Group *GroupSettings `json:"group,omitempty"` + Ref *string `json:"ref,omitempty"` + CancellationMessage *string `json:"cancellation_message,omitempty"` + CancellationMethod *string `json:"cancellation_method,omitempty"` + Currency *string `json:"currency,omitempty"` + ExpiresAt *string `json:"expires_at,omitempty"` + ExpirationTracksNextBillingChange *string `json:"expiration_tracks_next_billing_change,omitempty"` + AgreementTerms *string `json:"agreement_terms,omitempty"` + AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"` + AuthorizerLastName *string `json:"authorizer_last_name,omitempty"` + CalendarBillingFirstCharge *string `json:"calendar_billing_first_charge,omitempty"` + ReasonCode *string `json:"reason_code,omitempty"` + ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` + OfferId *interface{} `json:"offer_id,omitempty"` + PrepaidConfiguration *UpsertPrepaidConfiguration `json:"prepaid_configuration,omitempty"` + PreviousBillingAt *string `json:"previous_billing_at,omitempty"` + ImportMrr *bool `json:"import_mrr,omitempty"` + CanceledAt *string `json:"canceled_at,omitempty"` + ActivatedAt *string `json:"activated_at,omitempty"` + AgreementAcceptance *AgreementAcceptance `json:"agreement_acceptance,omitempty"` + AchAgreement *ACHAgreement `json:"ach_agreement,omitempty"` + DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + SkipBillingManifestTaxes *bool `json:"skip_billing_manifest_taxes,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ProductHandle = temp.ProductHandle + c.ProductId = temp.ProductId + c.ProductPricePointHandle = temp.ProductPricePointHandle + c.ProductPricePointId = temp.ProductPricePointId + c.CustomPrice = temp.CustomPrice + c.CouponCode = temp.CouponCode + c.CouponCodes = temp.CouponCodes + c.PaymentCollectionMethod = temp.PaymentCollectionMethod + c.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails + c.NetTerms = temp.NetTerms + c.CustomerId = temp.CustomerId + if temp.NextBillingAt != nil { + NextBillingAtVal, err := time.Parse(time.RFC3339, *temp.NextBillingAt) + if err != nil { + log.Fatalf("Cannot Parse next_billing_at as % s format.", time.RFC3339) + } + c.NextBillingAt = &NextBillingAtVal + } + if temp.InitialBillingAt != nil { + InitialBillingAtVal, err := time.Parse(time.RFC3339, *temp.InitialBillingAt) + if err != nil { + log.Fatalf("Cannot Parse initial_billing_at as % s format.", time.RFC3339) + } + c.InitialBillingAt = &InitialBillingAtVal + } + c.StoredCredentialTransactionId = temp.StoredCredentialTransactionId + c.SalesRepId = temp.SalesRepId + c.PaymentProfileId = temp.PaymentProfileId + c.Reference = temp.Reference + c.CustomerAttributes = temp.CustomerAttributes + c.PaymentProfileAttributes = temp.PaymentProfileAttributes + c.CreditCardAttributes = temp.CreditCardAttributes + c.BankAccountAttributes = temp.BankAccountAttributes + c.Components = temp.Components + c.CalendarBilling = temp.CalendarBilling + c.Metafields = temp.Metafields + c.CustomerReference = temp.CustomerReference + c.Group = temp.Group + c.Ref = temp.Ref + c.CancellationMessage = temp.CancellationMessage + c.CancellationMethod = temp.CancellationMethod + c.Currency = temp.Currency + if temp.ExpiresAt != nil { + ExpiresAtVal, err := time.Parse(time.RFC3339, *temp.ExpiresAt) + if err != nil { + log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) + } + c.ExpiresAt = &ExpiresAtVal + } + c.ExpirationTracksNextBillingChange = temp.ExpirationTracksNextBillingChange + c.AgreementTerms = temp.AgreementTerms + c.AuthorizerFirstName = temp.AuthorizerFirstName + c.AuthorizerLastName = temp.AuthorizerLastName + c.CalendarBillingFirstCharge = temp.CalendarBillingFirstCharge + c.ReasonCode = temp.ReasonCode + c.ProductChangeDelayed = temp.ProductChangeDelayed + c.OfferId = temp.OfferId + c.PrepaidConfiguration = temp.PrepaidConfiguration + if temp.PreviousBillingAt != nil { + PreviousBillingAtVal, err := time.Parse(time.RFC3339, *temp.PreviousBillingAt) + if err != nil { + log.Fatalf("Cannot Parse previous_billing_at as % s format.", time.RFC3339) + } + c.PreviousBillingAt = &PreviousBillingAtVal + } + c.ImportMrr = temp.ImportMrr + c.CanceledAt = temp.CanceledAt + if temp.ActivatedAt != nil { + ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) + if err != nil { + log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) + } + c.ActivatedAt = &ActivatedAtVal + } + c.AgreementAcceptance = temp.AgreementAcceptance + c.AchAgreement = temp.AchAgreement + c.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled + c.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone + c.SkipBillingManifestTaxes = temp.SkipBillingManifestTaxes + return nil } diff --git a/models/create_subscription_component.go b/models/create_subscription_component.go index 12c105f4..689a1628 100644 --- a/models/create_subscription_component.go +++ b/models/create_subscription_component.go @@ -1,83 +1,83 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSubscriptionComponent represents a CreateSubscriptionComponent struct. type CreateSubscriptionComponent struct { - ComponentId *interface{} `json:"component_id,omitempty"` - // Used for on/off components only. - Enabled *bool `json:"enabled,omitempty"` - // Used for metered and events based components. - UnitBalance *int `json:"unit_balance,omitempty"` - // Used for quantity based components. - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - // Deprecated. Use `allocated_quantity` instead. - Quantity *int `json:"quantity,omitempty"` // Deprecated - PricePointId *interface{} `json:"price_point_id,omitempty"` - // Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. - CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` + ComponentId *interface{} `json:"component_id,omitempty"` + // Used for on/off components only. + Enabled *bool `json:"enabled,omitempty"` + // Used for metered and events based components. + UnitBalance *int `json:"unit_balance,omitempty"` + // Used for quantity based components. + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + // Deprecated. Use `allocated_quantity` instead. + Quantity *int `json:"quantity,omitempty"` // Deprecated + PricePointId *interface{} `json:"price_point_id,omitempty"` + // Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. + CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionComponent. +// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionComponent. // It customizes the JSON marshaling process for CreateSubscriptionComponent objects. func (c *CreateSubscriptionComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSubscriptionComponent object to a map representation for JSON marshaling. func (c *CreateSubscriptionComponent) toMap() map[string]any { - structMap := make(map[string]any) - if c.ComponentId != nil { - structMap["component_id"] = c.ComponentId - } - if c.Enabled != nil { - structMap["enabled"] = c.Enabled - } - if c.UnitBalance != nil { - structMap["unit_balance"] = c.UnitBalance - } - if c.AllocatedQuantity != nil { - structMap["allocated_quantity"] = c.AllocatedQuantity - } - if c.Quantity != nil { - structMap["quantity"] = c.Quantity - } - if c.PricePointId != nil { - structMap["price_point_id"] = c.PricePointId - } - if c.CustomPrice != nil { - structMap["custom_price"] = c.CustomPrice - } - return structMap + structMap := make(map[string]any) + if c.ComponentId != nil { + structMap["component_id"] = c.ComponentId + } + if c.Enabled != nil { + structMap["enabled"] = c.Enabled + } + if c.UnitBalance != nil { + structMap["unit_balance"] = c.UnitBalance + } + if c.AllocatedQuantity != nil { + structMap["allocated_quantity"] = c.AllocatedQuantity + } + if c.Quantity != nil { + structMap["quantity"] = c.Quantity + } + if c.PricePointId != nil { + structMap["price_point_id"] = c.PricePointId + } + if c.CustomPrice != nil { + structMap["custom_price"] = c.CustomPrice.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionComponent. // It customizes the JSON unmarshaling process for CreateSubscriptionComponent objects. func (c *CreateSubscriptionComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *interface{} `json:"component_id,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - UnitBalance *int `json:"unit_balance,omitempty"` - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - Quantity *int `json:"quantity,omitempty"` - PricePointId *interface{} `json:"price_point_id,omitempty"` - CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ComponentId = temp.ComponentId - c.Enabled = temp.Enabled - c.UnitBalance = temp.UnitBalance - c.AllocatedQuantity = temp.AllocatedQuantity - c.Quantity = temp.Quantity - c.PricePointId = temp.PricePointId - c.CustomPrice = temp.CustomPrice - return nil + temp := &struct { + ComponentId *interface{} `json:"component_id,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + UnitBalance *int `json:"unit_balance,omitempty"` + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + Quantity *int `json:"quantity,omitempty"` + PricePointId *interface{} `json:"price_point_id,omitempty"` + CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ComponentId = temp.ComponentId + c.Enabled = temp.Enabled + c.UnitBalance = temp.UnitBalance + c.AllocatedQuantity = temp.AllocatedQuantity + c.Quantity = temp.Quantity + c.PricePointId = temp.PricePointId + c.CustomPrice = temp.CustomPrice + return nil } diff --git a/models/create_subscription_group.go b/models/create_subscription_group.go index cff207e7..f7e11662 100644 --- a/models/create_subscription_group.go +++ b/models/create_subscription_group.go @@ -1,46 +1,46 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSubscriptionGroup represents a CreateSubscriptionGroup struct. type CreateSubscriptionGroup struct { - SubscriptionId interface{} `json:"subscription_id"` - MemberIds []int `json:"member_ids,omitempty"` + SubscriptionId interface{} `json:"subscription_id"` + MemberIds []int `json:"member_ids,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroup. +// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroup. // It customizes the JSON marshaling process for CreateSubscriptionGroup objects. func (c *CreateSubscriptionGroup) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSubscriptionGroup object to a map representation for JSON marshaling. func (c *CreateSubscriptionGroup) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_id"] = c.SubscriptionId - if c.MemberIds != nil { - structMap["member_ids"] = c.MemberIds - } - return structMap + structMap := make(map[string]any) + structMap["subscription_id"] = c.SubscriptionId + if c.MemberIds != nil { + structMap["member_ids"] = c.MemberIds + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroup. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroup. // It customizes the JSON unmarshaling process for CreateSubscriptionGroup objects. func (c *CreateSubscriptionGroup) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionId interface{} `json:"subscription_id"` - MemberIds []int `json:"member_ids,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.SubscriptionId = temp.SubscriptionId - c.MemberIds = temp.MemberIds - return nil + temp := &struct { + SubscriptionId interface{} `json:"subscription_id"` + MemberIds []int `json:"member_ids,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.SubscriptionId = temp.SubscriptionId + c.MemberIds = temp.MemberIds + return nil } diff --git a/models/create_subscription_group_request.go b/models/create_subscription_group_request.go index 1685007f..373b93fc 100644 --- a/models/create_subscription_group_request.go +++ b/models/create_subscription_group_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSubscriptionGroupRequest represents a CreateSubscriptionGroupRequest struct. type CreateSubscriptionGroupRequest struct { - SubscriptionGroup CreateSubscriptionGroup `json:"subscription_group"` + SubscriptionGroup CreateSubscriptionGroup `json:"subscription_group"` } -// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroupRequest. +// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroupRequest. // It customizes the JSON marshaling process for CreateSubscriptionGroupRequest objects. func (c *CreateSubscriptionGroupRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSubscriptionGroupRequest object to a map representation for JSON marshaling. func (c *CreateSubscriptionGroupRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_group"] = c.SubscriptionGroup - return structMap + structMap := make(map[string]any) + structMap["subscription_group"] = c.SubscriptionGroup.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroupRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroupRequest. // It customizes the JSON unmarshaling process for CreateSubscriptionGroupRequest objects. func (c *CreateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionGroup CreateSubscriptionGroup `json:"subscription_group"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.SubscriptionGroup = temp.SubscriptionGroup - return nil + temp := &struct { + SubscriptionGroup CreateSubscriptionGroup `json:"subscription_group"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.SubscriptionGroup = temp.SubscriptionGroup + return nil } diff --git a/models/create_subscription_request.go b/models/create_subscription_request.go index 770fad38..3dc42c7c 100644 --- a/models/create_subscription_request.go +++ b/models/create_subscription_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateSubscriptionRequest represents a CreateSubscriptionRequest struct. type CreateSubscriptionRequest struct { - Subscription CreateSubscription `json:"subscription"` + Subscription CreateSubscription `json:"subscription"` } -// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionRequest. +// MarshalJSON implements the json.Marshaler interface for CreateSubscriptionRequest. // It customizes the JSON marshaling process for CreateSubscriptionRequest objects. func (c *CreateSubscriptionRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateSubscriptionRequest object to a map representation for JSON marshaling. func (c *CreateSubscriptionRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription"] = c.Subscription - return structMap + structMap := make(map[string]any) + structMap["subscription"] = c.Subscription.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionRequest. // It customizes the JSON unmarshaling process for CreateSubscriptionRequest objects. func (c *CreateSubscriptionRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscription CreateSubscription `json:"subscription"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Subscription = temp.Subscription - return nil + temp := &struct { + Subscription CreateSubscription `json:"subscription"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Subscription = temp.Subscription + return nil } diff --git a/models/create_usage.go b/models/create_usage.go index a05fc4c0..3dc11922 100644 --- a/models/create_usage.go +++ b/models/create_usage.go @@ -1,62 +1,62 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateUsage represents a CreateUsage struct. type CreateUsage struct { - // integer by default or decimal number if fractional quantities are enabled for the component - Quantity *float64 `json:"quantity,omitempty"` - PricePointId *string `json:"price_point_id,omitempty"` - Memo *string `json:"memo,omitempty"` - // This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled - BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"` + // integer by default or decimal number if fractional quantities are enabled for the component + Quantity *float64 `json:"quantity,omitempty"` + PricePointId *string `json:"price_point_id,omitempty"` + Memo *string `json:"memo,omitempty"` + // This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled + BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreateUsage. +// MarshalJSON implements the json.Marshaler interface for CreateUsage. // It customizes the JSON marshaling process for CreateUsage objects. func (c *CreateUsage) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateUsage object to a map representation for JSON marshaling. func (c *CreateUsage) toMap() map[string]any { - structMap := make(map[string]any) - if c.Quantity != nil { - structMap["quantity"] = c.Quantity - } - if c.PricePointId != nil { - structMap["price_point_id"] = c.PricePointId - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.BillingSchedule != nil { - structMap["billing_schedule"] = c.BillingSchedule - } - return structMap + structMap := make(map[string]any) + if c.Quantity != nil { + structMap["quantity"] = c.Quantity + } + if c.PricePointId != nil { + structMap["price_point_id"] = c.PricePointId + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.BillingSchedule != nil { + structMap["billing_schedule"] = c.BillingSchedule.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateUsage. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateUsage. // It customizes the JSON unmarshaling process for CreateUsage objects. func (c *CreateUsage) UnmarshalJSON(input []byte) error { - temp := &struct { - Quantity *float64 `json:"quantity,omitempty"` - PricePointId *string `json:"price_point_id,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Quantity = temp.Quantity - c.PricePointId = temp.PricePointId - c.Memo = temp.Memo - c.BillingSchedule = temp.BillingSchedule - return nil + temp := &struct { + Quantity *float64 `json:"quantity,omitempty"` + PricePointId *string `json:"price_point_id,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Quantity = temp.Quantity + c.PricePointId = temp.PricePointId + c.Memo = temp.Memo + c.BillingSchedule = temp.BillingSchedule + return nil } diff --git a/models/create_usage_request.go b/models/create_usage_request.go index 57e0a0d5..29b018dd 100644 --- a/models/create_usage_request.go +++ b/models/create_usage_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreateUsageRequest represents a CreateUsageRequest struct. type CreateUsageRequest struct { - Usage CreateUsage `json:"usage"` + Usage CreateUsage `json:"usage"` } -// MarshalJSON implements the json.Marshaler interface for CreateUsageRequest. +// MarshalJSON implements the json.Marshaler interface for CreateUsageRequest. // It customizes the JSON marshaling process for CreateUsageRequest objects. func (c *CreateUsageRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreateUsageRequest object to a map representation for JSON marshaling. func (c *CreateUsageRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["usage"] = c.Usage - return structMap + structMap := make(map[string]any) + structMap["usage"] = c.Usage.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreateUsageRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreateUsageRequest. // It customizes the JSON unmarshaling process for CreateUsageRequest objects. func (c *CreateUsageRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Usage CreateUsage `json:"usage"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Usage = temp.Usage - return nil + temp := &struct { + Usage CreateUsage `json:"usage"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Usage = temp.Usage + return nil } diff --git a/models/created_prepayment.go b/models/created_prepayment.go index 867ebc71..fd32c9b0 100644 --- a/models/created_prepayment.go +++ b/models/created_prepayment.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreatedPrepayment represents a CreatedPrepayment struct. type CreatedPrepayment struct { - Id *int `json:"id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Memo *string `json:"memo,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - StartingBalanceInCents *int64 `json:"starting_balance_in_cents,omitempty"` - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + Id *int `json:"id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Memo *string `json:"memo,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + StartingBalanceInCents *int64 `json:"starting_balance_in_cents,omitempty"` + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreatedPrepayment. +// MarshalJSON implements the json.Marshaler interface for CreatedPrepayment. // It customizes the JSON marshaling process for CreatedPrepayment objects. func (c *CreatedPrepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreatedPrepayment object to a map representation for JSON marshaling. func (c *CreatedPrepayment) toMap() map[string]any { - structMap := make(map[string]any) - if c.Id != nil { - structMap["id"] = c.Id - } - if c.SubscriptionId != nil { - structMap["subscription_id"] = c.SubscriptionId - } - if c.AmountInCents != nil { - structMap["amount_in_cents"] = c.AmountInCents - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.CreatedAt != nil { - structMap["created_at"] = c.CreatedAt - } - if c.StartingBalanceInCents != nil { - structMap["starting_balance_in_cents"] = c.StartingBalanceInCents - } - if c.EndingBalanceInCents != nil { - structMap["ending_balance_in_cents"] = c.EndingBalanceInCents - } - return structMap + structMap := make(map[string]any) + if c.Id != nil { + structMap["id"] = c.Id + } + if c.SubscriptionId != nil { + structMap["subscription_id"] = c.SubscriptionId + } + if c.AmountInCents != nil { + structMap["amount_in_cents"] = c.AmountInCents + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.CreatedAt != nil { + structMap["created_at"] = c.CreatedAt + } + if c.StartingBalanceInCents != nil { + structMap["starting_balance_in_cents"] = c.StartingBalanceInCents + } + if c.EndingBalanceInCents != nil { + structMap["ending_balance_in_cents"] = c.EndingBalanceInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreatedPrepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for CreatedPrepayment. // It customizes the JSON unmarshaling process for CreatedPrepayment objects. func (c *CreatedPrepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Memo *string `json:"memo,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - StartingBalanceInCents *int64 `json:"starting_balance_in_cents,omitempty"` - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Id = temp.Id - c.SubscriptionId = temp.SubscriptionId - c.AmountInCents = temp.AmountInCents - c.Memo = temp.Memo - c.CreatedAt = temp.CreatedAt - c.StartingBalanceInCents = temp.StartingBalanceInCents - c.EndingBalanceInCents = temp.EndingBalanceInCents - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Memo *string `json:"memo,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + StartingBalanceInCents *int64 `json:"starting_balance_in_cents,omitempty"` + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Id = temp.Id + c.SubscriptionId = temp.SubscriptionId + c.AmountInCents = temp.AmountInCents + c.Memo = temp.Memo + c.CreatedAt = temp.CreatedAt + c.StartingBalanceInCents = temp.StartingBalanceInCents + c.EndingBalanceInCents = temp.EndingBalanceInCents + return nil } diff --git a/models/credit_card_attributes.go b/models/credit_card_attributes.go index 31add3bd..e565abbc 100644 --- a/models/credit_card_attributes.go +++ b/models/credit_card_attributes.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreditCardAttributes represents a CreditCardAttributes struct. type CreditCardAttributes struct { - FullNumber *string `json:"full_number,omitempty"` - ExpirationMonth *string `json:"expiration_month,omitempty"` - ExpirationYear *string `json:"expiration_year,omitempty"` + FullNumber *string `json:"full_number,omitempty"` + ExpirationMonth *string `json:"expiration_month,omitempty"` + ExpirationYear *string `json:"expiration_year,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreditCardAttributes. +// MarshalJSON implements the json.Marshaler interface for CreditCardAttributes. // It customizes the JSON marshaling process for CreditCardAttributes objects. func (c *CreditCardAttributes) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditCardAttributes object to a map representation for JSON marshaling. func (c *CreditCardAttributes) toMap() map[string]any { - structMap := make(map[string]any) - if c.FullNumber != nil { - structMap["full_number"] = c.FullNumber - } - if c.ExpirationMonth != nil { - structMap["expiration_month"] = c.ExpirationMonth - } - if c.ExpirationYear != nil { - structMap["expiration_year"] = c.ExpirationYear - } - return structMap + structMap := make(map[string]any) + if c.FullNumber != nil { + structMap["full_number"] = c.FullNumber + } + if c.ExpirationMonth != nil { + structMap["expiration_month"] = c.ExpirationMonth + } + if c.ExpirationYear != nil { + structMap["expiration_year"] = c.ExpirationYear + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditCardAttributes. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditCardAttributes. // It customizes the JSON unmarshaling process for CreditCardAttributes objects. func (c *CreditCardAttributes) UnmarshalJSON(input []byte) error { - temp := &struct { - FullNumber *string `json:"full_number,omitempty"` - ExpirationMonth *string `json:"expiration_month,omitempty"` - ExpirationYear *string `json:"expiration_year,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.FullNumber = temp.FullNumber - c.ExpirationMonth = temp.ExpirationMonth - c.ExpirationYear = temp.ExpirationYear - return nil + temp := &struct { + FullNumber *string `json:"full_number,omitempty"` + ExpirationMonth *string `json:"expiration_month,omitempty"` + ExpirationYear *string `json:"expiration_year,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.FullNumber = temp.FullNumber + c.ExpirationMonth = temp.ExpirationMonth + c.ExpirationYear = temp.ExpirationYear + return nil } diff --git a/models/credit_card_payment_profile.go b/models/credit_card_payment_profile.go index b6184186..a3698f17 100644 --- a/models/credit_card_payment_profile.go +++ b/models/credit_card_payment_profile.go @@ -1,185 +1,185 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreditCardPaymentProfile represents a CreditCardPaymentProfile struct. type CreditCardPaymentProfile struct { - // 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. - Id *int `json:"id,omitempty"` - // The first name of the card holder. - FirstName *string `json:"first_name,omitempty"` - // The last name of the card holder. - LastName *string `json:"last_name,omitempty"` - // 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’). - MaskedCardNumber string `json:"masked_card_number"` - // The type of card used. - CardType *CardType `json:"card_type,omitempty"` - // An integer representing the expiration month of the card(1 – 12). - ExpirationMonth *int `json:"expiration_month,omitempty"` - // An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). - ExpirationYear *int `json:"expiration_year,omitempty"` - // The Chargify-assigned id for the customer record to which the card belongs. - CustomerId *int `json:"customer_id,omitempty"` - // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - // The “token” provided by your vault storage for an already stored payment profile. - VaultToken Optional[string] `json:"vault_token"` - // The current billing street address for the card. - BillingAddress Optional[string] `json:"billing_address"` - // The current billing address city for the card. - BillingCity Optional[string] `json:"billing_city"` - // The current billing address state for the card. - BillingState Optional[string] `json:"billing_state"` - // The current billing address zip code for the card. - BillingZip Optional[string] `json:"billing_zip"` - // The current billing address country for the card. - BillingCountry Optional[string] `json:"billing_country"` - // (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. - CustomerVaultToken Optional[string] `json:"customer_vault_token"` - // The current billing street address, second line, for the card. - BillingAddress2 Optional[string] `json:"billing_address_2"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - // Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) - ChargifyToken *string `json:"chargify_token,omitempty"` - SiteGatewaySettingId Optional[int] `json:"site_gateway_setting_id"` - // An identifier of connected gateway. - GatewayHandle Optional[string] `json:"gateway_handle"` + // 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. + Id *int `json:"id,omitempty"` + // The first name of the card holder. + FirstName *string `json:"first_name,omitempty"` + // The last name of the card holder. + LastName *string `json:"last_name,omitempty"` + // 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’). + MaskedCardNumber string `json:"masked_card_number"` + // The type of card used. + CardType *CardType `json:"card_type,omitempty"` + // An integer representing the expiration month of the card(1 – 12). + ExpirationMonth *int `json:"expiration_month,omitempty"` + // An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). + ExpirationYear *int `json:"expiration_year,omitempty"` + // The Chargify-assigned id for the customer record to which the card belongs. + CustomerId *int `json:"customer_id,omitempty"` + // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + // The “token” provided by your vault storage for an already stored payment profile. + VaultToken Optional[string] `json:"vault_token"` + // The current billing street address for the card. + BillingAddress Optional[string] `json:"billing_address"` + // The current billing address city for the card. + BillingCity Optional[string] `json:"billing_city"` + // The current billing address state for the card. + BillingState Optional[string] `json:"billing_state"` + // The current billing address zip code for the card. + BillingZip Optional[string] `json:"billing_zip"` + // The current billing address country for the card. + BillingCountry Optional[string] `json:"billing_country"` + // (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. + CustomerVaultToken Optional[string] `json:"customer_vault_token"` + // The current billing street address, second line, for the card. + BillingAddress2 Optional[string] `json:"billing_address_2"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + // Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + ChargifyToken *string `json:"chargify_token,omitempty"` + SiteGatewaySettingId Optional[int] `json:"site_gateway_setting_id"` + // An identifier of connected gateway. + GatewayHandle Optional[string] `json:"gateway_handle"` } -// MarshalJSON implements the json.Marshaler interface for CreditCardPaymentProfile. +// MarshalJSON implements the json.Marshaler interface for CreditCardPaymentProfile. // It customizes the JSON marshaling process for CreditCardPaymentProfile objects. func (c *CreditCardPaymentProfile) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditCardPaymentProfile object to a map representation for JSON marshaling. func (c *CreditCardPaymentProfile) toMap() map[string]any { - structMap := make(map[string]any) - if c.Id != nil { - structMap["id"] = c.Id - } - if c.FirstName != nil { - structMap["first_name"] = c.FirstName - } - if c.LastName != nil { - structMap["last_name"] = c.LastName - } - structMap["masked_card_number"] = c.MaskedCardNumber - if c.CardType != nil { - structMap["card_type"] = c.CardType - } - if c.ExpirationMonth != nil { - structMap["expiration_month"] = c.ExpirationMonth - } - if c.ExpirationYear != nil { - structMap["expiration_year"] = c.ExpirationYear - } - if c.CustomerId != nil { - structMap["customer_id"] = c.CustomerId - } - if c.CurrentVault != nil { - structMap["current_vault"] = c.CurrentVault - } - if c.VaultToken.IsValueSet() { - structMap["vault_token"] = c.VaultToken.Value() - } - if c.BillingAddress.IsValueSet() { - structMap["billing_address"] = c.BillingAddress.Value() - } - if c.BillingCity.IsValueSet() { - structMap["billing_city"] = c.BillingCity.Value() - } - if c.BillingState.IsValueSet() { - structMap["billing_state"] = c.BillingState.Value() - } - if c.BillingZip.IsValueSet() { - structMap["billing_zip"] = c.BillingZip.Value() - } - if c.BillingCountry.IsValueSet() { - structMap["billing_country"] = c.BillingCountry.Value() - } - if c.CustomerVaultToken.IsValueSet() { - structMap["customer_vault_token"] = c.CustomerVaultToken.Value() - } - if c.BillingAddress2.IsValueSet() { - structMap["billing_address_2"] = c.BillingAddress2.Value() - } - if c.PaymentType != nil { - structMap["payment_type"] = c.PaymentType - } - if c.Disabled != nil { - structMap["disabled"] = c.Disabled - } - if c.ChargifyToken != nil { - structMap["chargify_token"] = c.ChargifyToken - } - if c.SiteGatewaySettingId.IsValueSet() { - structMap["site_gateway_setting_id"] = c.SiteGatewaySettingId.Value() - } - if c.GatewayHandle.IsValueSet() { - structMap["gateway_handle"] = c.GatewayHandle.Value() - } - return structMap + structMap := make(map[string]any) + if c.Id != nil { + structMap["id"] = c.Id + } + if c.FirstName != nil { + structMap["first_name"] = c.FirstName + } + if c.LastName != nil { + structMap["last_name"] = c.LastName + } + structMap["masked_card_number"] = c.MaskedCardNumber + if c.CardType != nil { + structMap["card_type"] = c.CardType + } + if c.ExpirationMonth != nil { + structMap["expiration_month"] = c.ExpirationMonth + } + if c.ExpirationYear != nil { + structMap["expiration_year"] = c.ExpirationYear + } + if c.CustomerId != nil { + structMap["customer_id"] = c.CustomerId + } + if c.CurrentVault != nil { + structMap["current_vault"] = c.CurrentVault + } + if c.VaultToken.IsValueSet() { + structMap["vault_token"] = c.VaultToken.Value() + } + if c.BillingAddress.IsValueSet() { + structMap["billing_address"] = c.BillingAddress.Value() + } + if c.BillingCity.IsValueSet() { + structMap["billing_city"] = c.BillingCity.Value() + } + if c.BillingState.IsValueSet() { + structMap["billing_state"] = c.BillingState.Value() + } + if c.BillingZip.IsValueSet() { + structMap["billing_zip"] = c.BillingZip.Value() + } + if c.BillingCountry.IsValueSet() { + structMap["billing_country"] = c.BillingCountry.Value() + } + if c.CustomerVaultToken.IsValueSet() { + structMap["customer_vault_token"] = c.CustomerVaultToken.Value() + } + if c.BillingAddress2.IsValueSet() { + structMap["billing_address_2"] = c.BillingAddress2.Value() + } + if c.PaymentType != nil { + structMap["payment_type"] = c.PaymentType + } + if c.Disabled != nil { + structMap["disabled"] = c.Disabled + } + if c.ChargifyToken != nil { + structMap["chargify_token"] = c.ChargifyToken + } + if c.SiteGatewaySettingId.IsValueSet() { + structMap["site_gateway_setting_id"] = c.SiteGatewaySettingId.Value() + } + if c.GatewayHandle.IsValueSet() { + structMap["gateway_handle"] = c.GatewayHandle.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditCardPaymentProfile. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditCardPaymentProfile. // It customizes the JSON unmarshaling process for CreditCardPaymentProfile objects. func (c *CreditCardPaymentProfile) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber string `json:"masked_card_number"` - CardType *CardType `json:"card_type,omitempty"` - ExpirationMonth *int `json:"expiration_month,omitempty"` - ExpirationYear *int `json:"expiration_year,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - VaultToken Optional[string] `json:"vault_token"` - BillingAddress Optional[string] `json:"billing_address"` - BillingCity Optional[string] `json:"billing_city"` - BillingState Optional[string] `json:"billing_state"` - BillingZip Optional[string] `json:"billing_zip"` - BillingCountry Optional[string] `json:"billing_country"` - CustomerVaultToken Optional[string] `json:"customer_vault_token"` - BillingAddress2 Optional[string] `json:"billing_address_2"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - ChargifyToken *string `json:"chargify_token,omitempty"` - SiteGatewaySettingId Optional[int] `json:"site_gateway_setting_id"` - GatewayHandle Optional[string] `json:"gateway_handle"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Id = temp.Id - c.FirstName = temp.FirstName - c.LastName = temp.LastName - c.MaskedCardNumber = temp.MaskedCardNumber - c.CardType = temp.CardType - c.ExpirationMonth = temp.ExpirationMonth - c.ExpirationYear = temp.ExpirationYear - c.CustomerId = temp.CustomerId - c.CurrentVault = temp.CurrentVault - c.VaultToken = temp.VaultToken - c.BillingAddress = temp.BillingAddress - c.BillingCity = temp.BillingCity - c.BillingState = temp.BillingState - c.BillingZip = temp.BillingZip - c.BillingCountry = temp.BillingCountry - c.CustomerVaultToken = temp.CustomerVaultToken - c.BillingAddress2 = temp.BillingAddress2 - c.PaymentType = temp.PaymentType - c.Disabled = temp.Disabled - c.ChargifyToken = temp.ChargifyToken - c.SiteGatewaySettingId = temp.SiteGatewaySettingId - c.GatewayHandle = temp.GatewayHandle - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber string `json:"masked_card_number"` + CardType *CardType `json:"card_type,omitempty"` + ExpirationMonth *int `json:"expiration_month,omitempty"` + ExpirationYear *int `json:"expiration_year,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + VaultToken Optional[string] `json:"vault_token"` + BillingAddress Optional[string] `json:"billing_address"` + BillingCity Optional[string] `json:"billing_city"` + BillingState Optional[string] `json:"billing_state"` + BillingZip Optional[string] `json:"billing_zip"` + BillingCountry Optional[string] `json:"billing_country"` + CustomerVaultToken Optional[string] `json:"customer_vault_token"` + BillingAddress2 Optional[string] `json:"billing_address_2"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + ChargifyToken *string `json:"chargify_token,omitempty"` + SiteGatewaySettingId Optional[int] `json:"site_gateway_setting_id"` + GatewayHandle Optional[string] `json:"gateway_handle"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Id = temp.Id + c.FirstName = temp.FirstName + c.LastName = temp.LastName + c.MaskedCardNumber = temp.MaskedCardNumber + c.CardType = temp.CardType + c.ExpirationMonth = temp.ExpirationMonth + c.ExpirationYear = temp.ExpirationYear + c.CustomerId = temp.CustomerId + c.CurrentVault = temp.CurrentVault + c.VaultToken = temp.VaultToken + c.BillingAddress = temp.BillingAddress + c.BillingCity = temp.BillingCity + c.BillingState = temp.BillingState + c.BillingZip = temp.BillingZip + c.BillingCountry = temp.BillingCountry + c.CustomerVaultToken = temp.CustomerVaultToken + c.BillingAddress2 = temp.BillingAddress2 + c.PaymentType = temp.PaymentType + c.Disabled = temp.Disabled + c.ChargifyToken = temp.ChargifyToken + c.SiteGatewaySettingId = temp.SiteGatewaySettingId + c.GatewayHandle = temp.GatewayHandle + return nil } diff --git a/models/credit_note.go b/models/credit_note.go index 390ba908..2619d636 100644 --- a/models/credit_note.go +++ b/models/credit_note.go @@ -1,227 +1,239 @@ package models import ( - "encoding/json" + "encoding/json" + "log" + "time" ) // CreditNote represents a CreditNote struct. type CreditNote struct { - // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. - Uid *string `json:"uid,omitempty"` - // ID of the site to which the credit note belongs. - SiteId *int `json:"site_id,omitempty"` - // ID of the customer to which the credit note belongs. - CustomerId *int `json:"customer_id,omitempty"` - // ID of the subscription that generated the credit note. - SubscriptionId *int `json:"subscription_id,omitempty"` - // A unique, identifying string that appears on the credit note and in places it 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. - Number *string `json:"number,omitempty"` - // A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. - SequenceNumber *int `json:"sequence_number,omitempty"` - // Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied. - // The format is `"YYYY-MM-DD"`. - IssueDate *string `json:"issue_date,omitempty"` - // Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices. - // If the credit note has been partially applied, this field will not have a value until it has been fully applied. - // The format is `"YYYY-MM-DD"`. - AppliedDate *string `json:"applied_date,omitempty"` - // Current status of the credit note. Valid values: - // * open - // * applied - Status *string `json:"status,omitempty"` - // The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. - Currency *string `json:"currency,omitempty"` - // The memo printed on credit note, which is a description of the reason for the credit. - Memo *string `json:"memo,omitempty"` - // Information about the seller (merchant) listed on the masthead of the credit note. - Seller *InvoiceSeller `json:"seller,omitempty"` - // Information about the customer who is owner or recipient the credited subscription. - Customer *InvoiceCustomer `json:"customer,omitempty"` - // The billing address of the credit subscription. - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - // The shipping address of the credited subscription. - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - // 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. - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - // 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). - DiscountAmount *string `json:"discount_amount,omitempty"` - // 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). - TaxAmount *string `json:"tax_amount,omitempty"` - // The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' - TotalAmount *string `json:"total_amount,omitempty"` - // The amount of the credit note that has already been applied to invoices. - AppliedAmount *string `json:"applied_amount,omitempty"` - // The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. - RemainingAmount *string `json:"remaining_amount,omitempty"` - // Line items on the credit note. - LineItems []CreditNoteLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Applications []CreditNoteApplication `json:"applications,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - // An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) - OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` + // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. + Uid *string `json:"uid,omitempty"` + // ID of the site to which the credit note belongs. + SiteId *int `json:"site_id,omitempty"` + // ID of the customer to which the credit note belongs. + CustomerId *int `json:"customer_id,omitempty"` + // ID of the subscription that generated the credit note. + SubscriptionId *int `json:"subscription_id,omitempty"` + // A unique, identifying string that appears on the credit note and in places it 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. + Number *string `json:"number,omitempty"` + // A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. + SequenceNumber *int `json:"sequence_number,omitempty"` + // Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied. + // The format is `"YYYY-MM-DD"`. + IssueDate *time.Time `json:"issue_date,omitempty"` + // Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices. + // If the credit note has been partially applied, this field will not have a value until it has been fully applied. + // The format is `"YYYY-MM-DD"`. + AppliedDate *time.Time `json:"applied_date,omitempty"` + // Current status of the credit note. + Status *CreditNoteStatus `json:"status,omitempty"` + // The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. + Currency *string `json:"currency,omitempty"` + // The memo printed on credit note, which is a description of the reason for the credit. + Memo *string `json:"memo,omitempty"` + // Information about the seller (merchant) listed on the masthead of the credit note. + Seller *InvoiceSeller `json:"seller,omitempty"` + // Information about the customer who is owner or recipient the credited subscription. + Customer *InvoiceCustomer `json:"customer,omitempty"` + // The billing address of the credit subscription. + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + // The shipping address of the credited subscription. + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + // 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. + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + // 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). + DiscountAmount *string `json:"discount_amount,omitempty"` + // 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). + TaxAmount *string `json:"tax_amount,omitempty"` + // The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' + TotalAmount *string `json:"total_amount,omitempty"` + // The amount of the credit note that has already been applied to invoices. + AppliedAmount *string `json:"applied_amount,omitempty"` + // The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. + RemainingAmount *string `json:"remaining_amount,omitempty"` + // Line items on the credit note. + LineItems []CreditNoteLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Applications []CreditNoteApplication `json:"applications,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + // An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) + OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreditNote. +// MarshalJSON implements the json.Marshaler interface for CreditNote. // It customizes the JSON marshaling process for CreditNote objects. func (c *CreditNote) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditNote object to a map representation for JSON marshaling. func (c *CreditNote) toMap() map[string]any { - structMap := make(map[string]any) - if c.Uid != nil { - structMap["uid"] = c.Uid - } - if c.SiteId != nil { - structMap["site_id"] = c.SiteId - } - if c.CustomerId != nil { - structMap["customer_id"] = c.CustomerId - } - if c.SubscriptionId != nil { - structMap["subscription_id"] = c.SubscriptionId - } - if c.Number != nil { - structMap["number"] = c.Number - } - if c.SequenceNumber != nil { - structMap["sequence_number"] = c.SequenceNumber - } - if c.IssueDate != nil { - structMap["issue_date"] = c.IssueDate - } - if c.AppliedDate != nil { - structMap["applied_date"] = c.AppliedDate - } - if c.Status != nil { - structMap["status"] = c.Status - } - if c.Currency != nil { - structMap["currency"] = c.Currency - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.Seller != nil { - structMap["seller"] = c.Seller - } - if c.Customer != nil { - structMap["customer"] = c.Customer - } - if c.BillingAddress != nil { - structMap["billing_address"] = c.BillingAddress - } - if c.ShippingAddress != nil { - structMap["shipping_address"] = c.ShippingAddress - } - if c.SubtotalAmount != nil { - structMap["subtotal_amount"] = c.SubtotalAmount - } - if c.DiscountAmount != nil { - structMap["discount_amount"] = c.DiscountAmount - } - if c.TaxAmount != nil { - structMap["tax_amount"] = c.TaxAmount - } - if c.TotalAmount != nil { - structMap["total_amount"] = c.TotalAmount - } - if c.AppliedAmount != nil { - structMap["applied_amount"] = c.AppliedAmount - } - if c.RemainingAmount != nil { - structMap["remaining_amount"] = c.RemainingAmount - } - if c.LineItems != nil { - structMap["line_items"] = c.LineItems - } - if c.Discounts != nil { - structMap["discounts"] = c.Discounts - } - if c.Taxes != nil { - structMap["taxes"] = c.Taxes - } - if c.Applications != nil { - structMap["applications"] = c.Applications - } - if c.Refunds != nil { - structMap["refunds"] = c.Refunds - } - if c.OriginInvoices != nil { - structMap["origin_invoices"] = c.OriginInvoices - } - return structMap + structMap := make(map[string]any) + if c.Uid != nil { + structMap["uid"] = c.Uid + } + if c.SiteId != nil { + structMap["site_id"] = c.SiteId + } + if c.CustomerId != nil { + structMap["customer_id"] = c.CustomerId + } + if c.SubscriptionId != nil { + structMap["subscription_id"] = c.SubscriptionId + } + if c.Number != nil { + structMap["number"] = c.Number + } + if c.SequenceNumber != nil { + structMap["sequence_number"] = c.SequenceNumber + } + if c.IssueDate != nil { + structMap["issue_date"] = c.IssueDate.Format(DEFAULT_DATE) + } + if c.AppliedDate != nil { + structMap["applied_date"] = c.AppliedDate.Format(DEFAULT_DATE) + } + if c.Status != nil { + structMap["status"] = c.Status + } + if c.Currency != nil { + structMap["currency"] = c.Currency + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.Seller != nil { + structMap["seller"] = c.Seller.toMap() + } + if c.Customer != nil { + structMap["customer"] = c.Customer.toMap() + } + if c.BillingAddress != nil { + structMap["billing_address"] = c.BillingAddress.toMap() + } + if c.ShippingAddress != nil { + structMap["shipping_address"] = c.ShippingAddress.toMap() + } + if c.SubtotalAmount != nil { + structMap["subtotal_amount"] = c.SubtotalAmount + } + if c.DiscountAmount != nil { + structMap["discount_amount"] = c.DiscountAmount + } + if c.TaxAmount != nil { + structMap["tax_amount"] = c.TaxAmount + } + if c.TotalAmount != nil { + structMap["total_amount"] = c.TotalAmount + } + if c.AppliedAmount != nil { + structMap["applied_amount"] = c.AppliedAmount + } + if c.RemainingAmount != nil { + structMap["remaining_amount"] = c.RemainingAmount + } + if c.LineItems != nil { + structMap["line_items"] = c.LineItems + } + if c.Discounts != nil { + structMap["discounts"] = c.Discounts + } + if c.Taxes != nil { + structMap["taxes"] = c.Taxes + } + if c.Applications != nil { + structMap["applications"] = c.Applications + } + if c.Refunds != nil { + structMap["refunds"] = c.Refunds + } + if c.OriginInvoices != nil { + structMap["origin_invoices"] = c.OriginInvoices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditNote. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditNote. // It customizes the JSON unmarshaling process for CreditNote objects. func (c *CreditNote) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *string `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - IssueDate *string `json:"issue_date,omitempty"` - AppliedDate *string `json:"applied_date,omitempty"` - Status *string `json:"status,omitempty"` - Currency *string `json:"currency,omitempty"` - Memo *string `json:"memo,omitempty"` - Seller *InvoiceSeller `json:"seller,omitempty"` - Customer *InvoiceCustomer `json:"customer,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - RemainingAmount *string `json:"remaining_amount,omitempty"` - LineItems []CreditNoteLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Applications []CreditNoteApplication `json:"applications,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Uid = temp.Uid - c.SiteId = temp.SiteId - c.CustomerId = temp.CustomerId - c.SubscriptionId = temp.SubscriptionId - c.Number = temp.Number - c.SequenceNumber = temp.SequenceNumber - c.IssueDate = temp.IssueDate - c.AppliedDate = temp.AppliedDate - c.Status = temp.Status - c.Currency = temp.Currency - c.Memo = temp.Memo - c.Seller = temp.Seller - c.Customer = temp.Customer - c.BillingAddress = temp.BillingAddress - c.ShippingAddress = temp.ShippingAddress - c.SubtotalAmount = temp.SubtotalAmount - c.DiscountAmount = temp.DiscountAmount - c.TaxAmount = temp.TaxAmount - c.TotalAmount = temp.TotalAmount - c.AppliedAmount = temp.AppliedAmount - c.RemainingAmount = temp.RemainingAmount - c.LineItems = temp.LineItems - c.Discounts = temp.Discounts - c.Taxes = temp.Taxes - c.Applications = temp.Applications - c.Refunds = temp.Refunds - c.OriginInvoices = temp.OriginInvoices - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *string `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + IssueDate *string `json:"issue_date,omitempty"` + AppliedDate *string `json:"applied_date,omitempty"` + Status *CreditNoteStatus `json:"status,omitempty"` + Currency *string `json:"currency,omitempty"` + Memo *string `json:"memo,omitempty"` + Seller *InvoiceSeller `json:"seller,omitempty"` + Customer *InvoiceCustomer `json:"customer,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + RemainingAmount *string `json:"remaining_amount,omitempty"` + LineItems []CreditNoteLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Applications []CreditNoteApplication `json:"applications,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Uid = temp.Uid + c.SiteId = temp.SiteId + c.CustomerId = temp.CustomerId + c.SubscriptionId = temp.SubscriptionId + c.Number = temp.Number + c.SequenceNumber = temp.SequenceNumber + if temp.IssueDate != nil { + IssueDateVal, err := time.Parse(DEFAULT_DATE, *temp.IssueDate) + if err != nil { + log.Fatalf("Cannot Parse issue_date as % s format.", DEFAULT_DATE) + } + c.IssueDate = &IssueDateVal + } + if temp.AppliedDate != nil { + AppliedDateVal, err := time.Parse(DEFAULT_DATE, *temp.AppliedDate) + if err != nil { + log.Fatalf("Cannot Parse applied_date as % s format.", DEFAULT_DATE) + } + c.AppliedDate = &AppliedDateVal + } + c.Status = temp.Status + c.Currency = temp.Currency + c.Memo = temp.Memo + c.Seller = temp.Seller + c.Customer = temp.Customer + c.BillingAddress = temp.BillingAddress + c.ShippingAddress = temp.ShippingAddress + c.SubtotalAmount = temp.SubtotalAmount + c.DiscountAmount = temp.DiscountAmount + c.TaxAmount = temp.TaxAmount + c.TotalAmount = temp.TotalAmount + c.AppliedAmount = temp.AppliedAmount + c.RemainingAmount = temp.RemainingAmount + c.LineItems = temp.LineItems + c.Discounts = temp.Discounts + c.Taxes = temp.Taxes + c.Applications = temp.Applications + c.Refunds = temp.Refunds + c.OriginInvoices = temp.OriginInvoices + return nil } diff --git a/models/credit_note_1.go b/models/credit_note_1.go index 7c906773..5a9be55a 100644 --- a/models/credit_note_1.go +++ b/models/credit_note_1.go @@ -1,223 +1,235 @@ package models import ( - "encoding/json" + "encoding/json" + "log" + "time" ) // CreditNote1 represents a CreditNote1 struct. type CreditNote1 struct { - // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. - Uid *string `json:"uid,omitempty"` - // ID of the site to which the credit note belongs. - SiteId *int `json:"site_id,omitempty"` - // ID of the customer to which the credit note belongs. - CustomerId *int `json:"customer_id,omitempty"` - // ID of the subscription that generated the credit note. - SubscriptionId *int `json:"subscription_id,omitempty"` - // A unique, identifying string that appears on the credit note and in places it 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. - Number *string `json:"number,omitempty"` - // A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. - SequenceNumber *int `json:"sequence_number,omitempty"` - // Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied. - // The format is `"YYYY-MM-DD"`. - IssueDate *string `json:"issue_date,omitempty"` - // Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices. - // If the credit note has been partially applied, this field will not have a value until it has been fully applied. - // The format is `"YYYY-MM-DD"`. - AppliedDate *string `json:"applied_date,omitempty"` - // Current status of the credit note. Valid values: - // * open - // * applied - Status *string `json:"status,omitempty"` - // The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. - Currency *string `json:"currency,omitempty"` - // The memo printed on credit note, which is a description of the reason for the credit. - Memo *string `json:"memo,omitempty"` - Seller *Seller `json:"seller,omitempty"` - Customer *Customer1 `json:"customer,omitempty"` - BillingAddress *BillingAddress `json:"billing_address,omitempty"` - ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` - // 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. - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - // 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). - DiscountAmount *string `json:"discount_amount,omitempty"` - // 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). - TaxAmount *string `json:"tax_amount,omitempty"` - // The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' - TotalAmount *string `json:"total_amount,omitempty"` - // The amount of the credit note that has already been applied to invoices. - AppliedAmount *string `json:"applied_amount,omitempty"` - // The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. - RemainingAmount *string `json:"remaining_amount,omitempty"` - // Line items on the credit note. - LineItems []CreditNoteLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Applications []CreditNoteApplication `json:"applications,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - // An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) - OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` + // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. + Uid *string `json:"uid,omitempty"` + // ID of the site to which the credit note belongs. + SiteId *int `json:"site_id,omitempty"` + // ID of the customer to which the credit note belongs. + CustomerId *int `json:"customer_id,omitempty"` + // ID of the subscription that generated the credit note. + SubscriptionId *int `json:"subscription_id,omitempty"` + // A unique, identifying string that appears on the credit note and in places it 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. + Number *string `json:"number,omitempty"` + // A monotonically increasing number assigned to credit notes as they are created. This number is unique within a site and can be used to sort and order credit notes. + SequenceNumber *int `json:"sequence_number,omitempty"` + // Date the credit note was issued to the customer. This is the date that the credit was made available for application, and may come before it is fully applied. + // The format is `"YYYY-MM-DD"`. + IssueDate *time.Time `json:"issue_date,omitempty"` + // Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices. + // If the credit note has been partially applied, this field will not have a value until it has been fully applied. + // The format is `"YYYY-MM-DD"`. + AppliedDate *time.Time `json:"applied_date,omitempty"` + // Current status of the credit note. + Status *CreditNoteStatus `json:"status,omitempty"` + // The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. + Currency *string `json:"currency,omitempty"` + // The memo printed on credit note, which is a description of the reason for the credit. + Memo *string `json:"memo,omitempty"` + Seller *Seller `json:"seller,omitempty"` + Customer *Customer1 `json:"customer,omitempty"` + BillingAddress *BillingAddress `json:"billing_address,omitempty"` + ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` + // 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. + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + // 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). + DiscountAmount *string `json:"discount_amount,omitempty"` + // 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). + TaxAmount *string `json:"tax_amount,omitempty"` + // The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' + TotalAmount *string `json:"total_amount,omitempty"` + // The amount of the credit note that has already been applied to invoices. + AppliedAmount *string `json:"applied_amount,omitempty"` + // The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. + RemainingAmount *string `json:"remaining_amount,omitempty"` + // Line items on the credit note. + LineItems []CreditNoteLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Applications []CreditNoteApplication `json:"applications,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + // An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) + OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreditNote1. +// MarshalJSON implements the json.Marshaler interface for CreditNote1. // It customizes the JSON marshaling process for CreditNote1 objects. func (c *CreditNote1) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditNote1 object to a map representation for JSON marshaling. func (c *CreditNote1) toMap() map[string]any { - structMap := make(map[string]any) - if c.Uid != nil { - structMap["uid"] = c.Uid - } - if c.SiteId != nil { - structMap["site_id"] = c.SiteId - } - if c.CustomerId != nil { - structMap["customer_id"] = c.CustomerId - } - if c.SubscriptionId != nil { - structMap["subscription_id"] = c.SubscriptionId - } - if c.Number != nil { - structMap["number"] = c.Number - } - if c.SequenceNumber != nil { - structMap["sequence_number"] = c.SequenceNumber - } - if c.IssueDate != nil { - structMap["issue_date"] = c.IssueDate - } - if c.AppliedDate != nil { - structMap["applied_date"] = c.AppliedDate - } - if c.Status != nil { - structMap["status"] = c.Status - } - if c.Currency != nil { - structMap["currency"] = c.Currency - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.Seller != nil { - structMap["seller"] = c.Seller - } - if c.Customer != nil { - structMap["customer"] = c.Customer - } - if c.BillingAddress != nil { - structMap["billing_address"] = c.BillingAddress - } - if c.ShippingAddress != nil { - structMap["shipping_address"] = c.ShippingAddress - } - if c.SubtotalAmount != nil { - structMap["subtotal_amount"] = c.SubtotalAmount - } - if c.DiscountAmount != nil { - structMap["discount_amount"] = c.DiscountAmount - } - if c.TaxAmount != nil { - structMap["tax_amount"] = c.TaxAmount - } - if c.TotalAmount != nil { - structMap["total_amount"] = c.TotalAmount - } - if c.AppliedAmount != nil { - structMap["applied_amount"] = c.AppliedAmount - } - if c.RemainingAmount != nil { - structMap["remaining_amount"] = c.RemainingAmount - } - if c.LineItems != nil { - structMap["line_items"] = c.LineItems - } - if c.Discounts != nil { - structMap["discounts"] = c.Discounts - } - if c.Taxes != nil { - structMap["taxes"] = c.Taxes - } - if c.Applications != nil { - structMap["applications"] = c.Applications - } - if c.Refunds != nil { - structMap["refunds"] = c.Refunds - } - if c.OriginInvoices != nil { - structMap["origin_invoices"] = c.OriginInvoices - } - return structMap + structMap := make(map[string]any) + if c.Uid != nil { + structMap["uid"] = c.Uid + } + if c.SiteId != nil { + structMap["site_id"] = c.SiteId + } + if c.CustomerId != nil { + structMap["customer_id"] = c.CustomerId + } + if c.SubscriptionId != nil { + structMap["subscription_id"] = c.SubscriptionId + } + if c.Number != nil { + structMap["number"] = c.Number + } + if c.SequenceNumber != nil { + structMap["sequence_number"] = c.SequenceNumber + } + if c.IssueDate != nil { + structMap["issue_date"] = c.IssueDate.Format(DEFAULT_DATE) + } + if c.AppliedDate != nil { + structMap["applied_date"] = c.AppliedDate.Format(DEFAULT_DATE) + } + if c.Status != nil { + structMap["status"] = c.Status + } + if c.Currency != nil { + structMap["currency"] = c.Currency + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.Seller != nil { + structMap["seller"] = c.Seller.toMap() + } + if c.Customer != nil { + structMap["customer"] = c.Customer.toMap() + } + if c.BillingAddress != nil { + structMap["billing_address"] = c.BillingAddress.toMap() + } + if c.ShippingAddress != nil { + structMap["shipping_address"] = c.ShippingAddress.toMap() + } + if c.SubtotalAmount != nil { + structMap["subtotal_amount"] = c.SubtotalAmount + } + if c.DiscountAmount != nil { + structMap["discount_amount"] = c.DiscountAmount + } + if c.TaxAmount != nil { + structMap["tax_amount"] = c.TaxAmount + } + if c.TotalAmount != nil { + structMap["total_amount"] = c.TotalAmount + } + if c.AppliedAmount != nil { + structMap["applied_amount"] = c.AppliedAmount + } + if c.RemainingAmount != nil { + structMap["remaining_amount"] = c.RemainingAmount + } + if c.LineItems != nil { + structMap["line_items"] = c.LineItems + } + if c.Discounts != nil { + structMap["discounts"] = c.Discounts + } + if c.Taxes != nil { + structMap["taxes"] = c.Taxes + } + if c.Applications != nil { + structMap["applications"] = c.Applications + } + if c.Refunds != nil { + structMap["refunds"] = c.Refunds + } + if c.OriginInvoices != nil { + structMap["origin_invoices"] = c.OriginInvoices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditNote1. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditNote1. // It customizes the JSON unmarshaling process for CreditNote1 objects. func (c *CreditNote1) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *string `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - IssueDate *string `json:"issue_date,omitempty"` - AppliedDate *string `json:"applied_date,omitempty"` - Status *string `json:"status,omitempty"` - Currency *string `json:"currency,omitempty"` - Memo *string `json:"memo,omitempty"` - Seller *Seller `json:"seller,omitempty"` - Customer *Customer1 `json:"customer,omitempty"` - BillingAddress *BillingAddress `json:"billing_address,omitempty"` - ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - RemainingAmount *string `json:"remaining_amount,omitempty"` - LineItems []CreditNoteLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Applications []CreditNoteApplication `json:"applications,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Uid = temp.Uid - c.SiteId = temp.SiteId - c.CustomerId = temp.CustomerId - c.SubscriptionId = temp.SubscriptionId - c.Number = temp.Number - c.SequenceNumber = temp.SequenceNumber - c.IssueDate = temp.IssueDate - c.AppliedDate = temp.AppliedDate - c.Status = temp.Status - c.Currency = temp.Currency - c.Memo = temp.Memo - c.Seller = temp.Seller - c.Customer = temp.Customer - c.BillingAddress = temp.BillingAddress - c.ShippingAddress = temp.ShippingAddress - c.SubtotalAmount = temp.SubtotalAmount - c.DiscountAmount = temp.DiscountAmount - c.TaxAmount = temp.TaxAmount - c.TotalAmount = temp.TotalAmount - c.AppliedAmount = temp.AppliedAmount - c.RemainingAmount = temp.RemainingAmount - c.LineItems = temp.LineItems - c.Discounts = temp.Discounts - c.Taxes = temp.Taxes - c.Applications = temp.Applications - c.Refunds = temp.Refunds - c.OriginInvoices = temp.OriginInvoices - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *string `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + IssueDate *string `json:"issue_date,omitempty"` + AppliedDate *string `json:"applied_date,omitempty"` + Status *CreditNoteStatus `json:"status,omitempty"` + Currency *string `json:"currency,omitempty"` + Memo *string `json:"memo,omitempty"` + Seller *Seller `json:"seller,omitempty"` + Customer *Customer1 `json:"customer,omitempty"` + BillingAddress *BillingAddress `json:"billing_address,omitempty"` + ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + RemainingAmount *string `json:"remaining_amount,omitempty"` + LineItems []CreditNoteLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Applications []CreditNoteApplication `json:"applications,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Uid = temp.Uid + c.SiteId = temp.SiteId + c.CustomerId = temp.CustomerId + c.SubscriptionId = temp.SubscriptionId + c.Number = temp.Number + c.SequenceNumber = temp.SequenceNumber + if temp.IssueDate != nil { + IssueDateVal, err := time.Parse(DEFAULT_DATE, *temp.IssueDate) + if err != nil { + log.Fatalf("Cannot Parse issue_date as % s format.", DEFAULT_DATE) + } + c.IssueDate = &IssueDateVal + } + if temp.AppliedDate != nil { + AppliedDateVal, err := time.Parse(DEFAULT_DATE, *temp.AppliedDate) + if err != nil { + log.Fatalf("Cannot Parse applied_date as % s format.", DEFAULT_DATE) + } + c.AppliedDate = &AppliedDateVal + } + c.Status = temp.Status + c.Currency = temp.Currency + c.Memo = temp.Memo + c.Seller = temp.Seller + c.Customer = temp.Customer + c.BillingAddress = temp.BillingAddress + c.ShippingAddress = temp.ShippingAddress + c.SubtotalAmount = temp.SubtotalAmount + c.DiscountAmount = temp.DiscountAmount + c.TaxAmount = temp.TaxAmount + c.TotalAmount = temp.TotalAmount + c.AppliedAmount = temp.AppliedAmount + c.RemainingAmount = temp.RemainingAmount + c.LineItems = temp.LineItems + c.Discounts = temp.Discounts + c.Taxes = temp.Taxes + c.Applications = temp.Applications + c.Refunds = temp.Refunds + c.OriginInvoices = temp.OriginInvoices + return nil } diff --git a/models/credit_note_application.go b/models/credit_note_application.go index 29299fd7..89825759 100644 --- a/models/credit_note_application.go +++ b/models/credit_note_application.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreditNoteApplication represents a CreditNoteApplication struct. type CreditNoteApplication struct { - Uid *string `json:"uid,omitempty"` - TransactionTime *string `json:"transaction_time,omitempty"` - InvoiceUid *string `json:"invoice_uid,omitempty"` - Memo *string `json:"memo,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + TransactionTime *string `json:"transaction_time,omitempty"` + InvoiceUid *string `json:"invoice_uid,omitempty"` + Memo *string `json:"memo,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CreditNoteApplication. +// MarshalJSON implements the json.Marshaler interface for CreditNoteApplication. // It customizes the JSON marshaling process for CreditNoteApplication objects. func (c *CreditNoteApplication) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditNoteApplication object to a map representation for JSON marshaling. func (c *CreditNoteApplication) toMap() map[string]any { - structMap := make(map[string]any) - if c.Uid != nil { - structMap["uid"] = c.Uid - } - if c.TransactionTime != nil { - structMap["transaction_time"] = c.TransactionTime - } - if c.InvoiceUid != nil { - structMap["invoice_uid"] = c.InvoiceUid - } - if c.Memo != nil { - structMap["memo"] = c.Memo - } - if c.AppliedAmount != nil { - structMap["applied_amount"] = c.AppliedAmount - } - return structMap + structMap := make(map[string]any) + if c.Uid != nil { + structMap["uid"] = c.Uid + } + if c.TransactionTime != nil { + structMap["transaction_time"] = c.TransactionTime + } + if c.InvoiceUid != nil { + structMap["invoice_uid"] = c.InvoiceUid + } + if c.Memo != nil { + structMap["memo"] = c.Memo + } + if c.AppliedAmount != nil { + structMap["applied_amount"] = c.AppliedAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteApplication. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteApplication. // It customizes the JSON unmarshaling process for CreditNoteApplication objects. func (c *CreditNoteApplication) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - TransactionTime *string `json:"transaction_time,omitempty"` - InvoiceUid *string `json:"invoice_uid,omitempty"` - Memo *string `json:"memo,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Uid = temp.Uid - c.TransactionTime = temp.TransactionTime - c.InvoiceUid = temp.InvoiceUid - c.Memo = temp.Memo - c.AppliedAmount = temp.AppliedAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + TransactionTime *string `json:"transaction_time,omitempty"` + InvoiceUid *string `json:"invoice_uid,omitempty"` + Memo *string `json:"memo,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Uid = temp.Uid + c.TransactionTime = temp.TransactionTime + c.InvoiceUid = temp.InvoiceUid + c.Memo = temp.Memo + c.AppliedAmount = temp.AppliedAmount + return nil } diff --git a/models/credit_note_line_item.go b/models/credit_note_line_item.go index d08c82f7..ed7301ba 100644 --- a/models/credit_note_line_item.go +++ b/models/credit_note_line_item.go @@ -1,155 +1,155 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreditNoteLineItem represents a CreditNoteLineItem struct. type CreditNoteLineItem struct { - // Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. - Uid *string `json:"uid,omitempty"` - // A short descriptor for the credit given by this line. - Title *string `json:"title,omitempty"` - // 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. - Description *string `json:"description,omitempty"` - // The quantity or count of units credited by the line item. - // This is a decimal number represented as a string. (See "About Decimal Numbers".) - Quantity *string `json:"quantity,omitempty"` - // 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`. - UnitPrice *string `json:"unit_price,omitempty"` - // 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). - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - // 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. - DiscountAmount *string `json:"discount_amount,omitempty"` - // 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. - TaxAmount *string `json:"tax_amount,omitempty"` - // 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`. - TotalAmount *string `json:"total_amount,omitempty"` - // 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. - TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` - // Start date for the period credited by this line. The format is `"YYYY-MM-DD"`. - PeriodRangeStart *string `json:"period_range_start,omitempty"` - // End date for the period credited by this line. The format is `"YYYY-MM-DD"`. - PeriodRangeEnd *string `json:"period_range_end,omitempty"` - // The ID of the product being credited. - // This may be set even for component credits, so true product-only (non-component) credits will also have a nil `component_id`. - ProductId *int `json:"product_id,omitempty"` - // The version of the product being credited. - ProductVersion *int `json:"product_version,omitempty"` - // The ID of the component being credited. Will be `nil` for non-component credits. - ComponentId Optional[int] `json:"component_id"` - // The price point ID of the component being credited. Will be `nil` for non-component credits. - PricePointId Optional[int] `json:"price_point_id"` + // Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. + Uid *string `json:"uid,omitempty"` + // A short descriptor for the credit given by this line. + Title *string `json:"title,omitempty"` + // 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. + Description *string `json:"description,omitempty"` + // The quantity or count of units credited by the line item. + // This is a decimal number represented as a string. (See "About Decimal Numbers".) + Quantity *string `json:"quantity,omitempty"` + // 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`. + UnitPrice *string `json:"unit_price,omitempty"` + // 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). + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + // 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. + DiscountAmount *string `json:"discount_amount,omitempty"` + // 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. + TaxAmount *string `json:"tax_amount,omitempty"` + // 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`. + TotalAmount *string `json:"total_amount,omitempty"` + // 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. + TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` + // Start date for the period credited by this line. The format is `"YYYY-MM-DD"`. + PeriodRangeStart *string `json:"period_range_start,omitempty"` + // End date for the period credited by this line. The format is `"YYYY-MM-DD"`. + PeriodRangeEnd *string `json:"period_range_end,omitempty"` + // The ID of the product being credited. + // This may be set even for component credits, so true product-only (non-component) credits will also have a nil `component_id`. + ProductId *int `json:"product_id,omitempty"` + // The version of the product being credited. + ProductVersion *int `json:"product_version,omitempty"` + // The ID of the component being credited. Will be `nil` for non-component credits. + ComponentId Optional[int] `json:"component_id"` + // The price point ID of the component being credited. Will be `nil` for non-component credits. + PricePointId Optional[int] `json:"price_point_id"` } -// MarshalJSON implements the json.Marshaler interface for CreditNoteLineItem. +// MarshalJSON implements the json.Marshaler interface for CreditNoteLineItem. // It customizes the JSON marshaling process for CreditNoteLineItem objects. func (c *CreditNoteLineItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditNoteLineItem object to a map representation for JSON marshaling. func (c *CreditNoteLineItem) toMap() map[string]any { - structMap := make(map[string]any) - if c.Uid != nil { - structMap["uid"] = c.Uid - } - if c.Title != nil { - structMap["title"] = c.Title - } - if c.Description != nil { - structMap["description"] = c.Description - } - if c.Quantity != nil { - structMap["quantity"] = c.Quantity - } - if c.UnitPrice != nil { - structMap["unit_price"] = c.UnitPrice - } - if c.SubtotalAmount != nil { - structMap["subtotal_amount"] = c.SubtotalAmount - } - if c.DiscountAmount != nil { - structMap["discount_amount"] = c.DiscountAmount - } - if c.TaxAmount != nil { - structMap["tax_amount"] = c.TaxAmount - } - if c.TotalAmount != nil { - structMap["total_amount"] = c.TotalAmount - } - if c.TieredUnitPrice != nil { - structMap["tiered_unit_price"] = c.TieredUnitPrice - } - if c.PeriodRangeStart != nil { - structMap["period_range_start"] = c.PeriodRangeStart - } - if c.PeriodRangeEnd != nil { - structMap["period_range_end"] = c.PeriodRangeEnd - } - if c.ProductId != nil { - structMap["product_id"] = c.ProductId - } - if c.ProductVersion != nil { - structMap["product_version"] = c.ProductVersion - } - if c.ComponentId.IsValueSet() { - structMap["component_id"] = c.ComponentId.Value() - } - if c.PricePointId.IsValueSet() { - structMap["price_point_id"] = c.PricePointId.Value() - } - return structMap + structMap := make(map[string]any) + if c.Uid != nil { + structMap["uid"] = c.Uid + } + if c.Title != nil { + structMap["title"] = c.Title + } + if c.Description != nil { + structMap["description"] = c.Description + } + if c.Quantity != nil { + structMap["quantity"] = c.Quantity + } + if c.UnitPrice != nil { + structMap["unit_price"] = c.UnitPrice + } + if c.SubtotalAmount != nil { + structMap["subtotal_amount"] = c.SubtotalAmount + } + if c.DiscountAmount != nil { + structMap["discount_amount"] = c.DiscountAmount + } + if c.TaxAmount != nil { + structMap["tax_amount"] = c.TaxAmount + } + if c.TotalAmount != nil { + structMap["total_amount"] = c.TotalAmount + } + if c.TieredUnitPrice != nil { + structMap["tiered_unit_price"] = c.TieredUnitPrice + } + if c.PeriodRangeStart != nil { + structMap["period_range_start"] = c.PeriodRangeStart + } + if c.PeriodRangeEnd != nil { + structMap["period_range_end"] = c.PeriodRangeEnd + } + if c.ProductId != nil { + structMap["product_id"] = c.ProductId + } + if c.ProductVersion != nil { + structMap["product_version"] = c.ProductVersion + } + if c.ComponentId.IsValueSet() { + structMap["component_id"] = c.ComponentId.Value() + } + if c.PricePointId.IsValueSet() { + structMap["price_point_id"] = c.PricePointId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteLineItem. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteLineItem. // It customizes the JSON unmarshaling process for CreditNoteLineItem objects. func (c *CreditNoteLineItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description *string `json:"description,omitempty"` - Quantity *string `json:"quantity,omitempty"` - UnitPrice *string `json:"unit_price,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` - PeriodRangeStart *string `json:"period_range_start,omitempty"` - PeriodRangeEnd *string `json:"period_range_end,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductVersion *int `json:"product_version,omitempty"` - ComponentId Optional[int] `json:"component_id"` - PricePointId Optional[int] `json:"price_point_id"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Uid = temp.Uid - c.Title = temp.Title - c.Description = temp.Description - c.Quantity = temp.Quantity - c.UnitPrice = temp.UnitPrice - c.SubtotalAmount = temp.SubtotalAmount - c.DiscountAmount = temp.DiscountAmount - c.TaxAmount = temp.TaxAmount - c.TotalAmount = temp.TotalAmount - c.TieredUnitPrice = temp.TieredUnitPrice - c.PeriodRangeStart = temp.PeriodRangeStart - c.PeriodRangeEnd = temp.PeriodRangeEnd - c.ProductId = temp.ProductId - c.ProductVersion = temp.ProductVersion - c.ComponentId = temp.ComponentId - c.PricePointId = temp.PricePointId - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Quantity *string `json:"quantity,omitempty"` + UnitPrice *string `json:"unit_price,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` + PeriodRangeStart *string `json:"period_range_start,omitempty"` + PeriodRangeEnd *string `json:"period_range_end,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductVersion *int `json:"product_version,omitempty"` + ComponentId Optional[int] `json:"component_id"` + PricePointId Optional[int] `json:"price_point_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Uid = temp.Uid + c.Title = temp.Title + c.Description = temp.Description + c.Quantity = temp.Quantity + c.UnitPrice = temp.UnitPrice + c.SubtotalAmount = temp.SubtotalAmount + c.DiscountAmount = temp.DiscountAmount + c.TaxAmount = temp.TaxAmount + c.TotalAmount = temp.TotalAmount + c.TieredUnitPrice = temp.TieredUnitPrice + c.PeriodRangeStart = temp.PeriodRangeStart + c.PeriodRangeEnd = temp.PeriodRangeEnd + c.ProductId = temp.ProductId + c.ProductVersion = temp.ProductVersion + c.ComponentId = temp.ComponentId + c.PricePointId = temp.PricePointId + return nil } diff --git a/models/credit_scheme_request.go b/models/credit_scheme_request.go index c43ff6cc..5484f2a4 100644 --- a/models/credit_scheme_request.go +++ b/models/credit_scheme_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CreditSchemeRequest represents a CreditSchemeRequest struct. type CreditSchemeRequest struct { - CreditScheme CreditScheme `json:"credit_scheme"` + CreditScheme CreditScheme `json:"credit_scheme"` } -// MarshalJSON implements the json.Marshaler interface for CreditSchemeRequest. +// MarshalJSON implements the json.Marshaler interface for CreditSchemeRequest. // It customizes the JSON marshaling process for CreditSchemeRequest objects. func (c *CreditSchemeRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CreditSchemeRequest object to a map representation for JSON marshaling. func (c *CreditSchemeRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["credit_scheme"] = c.CreditScheme - return structMap + structMap := make(map[string]any) + structMap["credit_scheme"] = c.CreditScheme + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CreditSchemeRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for CreditSchemeRequest. // It customizes the JSON unmarshaling process for CreditSchemeRequest objects. func (c *CreditSchemeRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - CreditScheme CreditScheme `json:"credit_scheme"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.CreditScheme = temp.CreditScheme - return nil + temp := &struct { + CreditScheme CreditScheme `json:"credit_scheme"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.CreditScheme = temp.CreditScheme + return nil } diff --git a/models/currency_price.go b/models/currency_price.go index 460e1ca1..89b4305d 100644 --- a/models/currency_price.go +++ b/models/currency_price.go @@ -1,73 +1,73 @@ package models import ( - "encoding/json" + "encoding/json" ) // CurrencyPrice represents a CurrencyPrice struct. type CurrencyPrice struct { - Id *int `json:"id,omitempty"` - Currency *string `json:"currency,omitempty"` - Price *float64 `json:"price,omitempty"` - FormattedPrice *string `json:"formatted_price,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // Role for the price. - Role *CurrencyPriceRole `json:"role,omitempty"` + Id *int `json:"id,omitempty"` + Currency *string `json:"currency,omitempty"` + Price *float64 `json:"price,omitempty"` + FormattedPrice *string `json:"formatted_price,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // Role for the price. + Role *CurrencyPriceRole `json:"role,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for CurrencyPrice. +// MarshalJSON implements the json.Marshaler interface for CurrencyPrice. // It customizes the JSON marshaling process for CurrencyPrice objects. func (c *CurrencyPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CurrencyPrice object to a map representation for JSON marshaling. func (c *CurrencyPrice) toMap() map[string]any { - structMap := make(map[string]any) - if c.Id != nil { - structMap["id"] = c.Id - } - if c.Currency != nil { - structMap["currency"] = c.Currency - } - if c.Price != nil { - structMap["price"] = c.Price - } - if c.FormattedPrice != nil { - structMap["formatted_price"] = c.FormattedPrice - } - if c.ProductPricePointId != nil { - structMap["product_price_point_id"] = c.ProductPricePointId - } - if c.Role != nil { - structMap["role"] = c.Role - } - return structMap + structMap := make(map[string]any) + if c.Id != nil { + structMap["id"] = c.Id + } + if c.Currency != nil { + structMap["currency"] = c.Currency + } + if c.Price != nil { + structMap["price"] = c.Price + } + if c.FormattedPrice != nil { + structMap["formatted_price"] = c.FormattedPrice + } + if c.ProductPricePointId != nil { + structMap["product_price_point_id"] = c.ProductPricePointId + } + if c.Role != nil { + structMap["role"] = c.Role + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPrice. // It customizes the JSON unmarshaling process for CurrencyPrice objects. func (c *CurrencyPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Currency *string `json:"currency,omitempty"` - Price *float64 `json:"price,omitempty"` - FormattedPrice *string `json:"formatted_price,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - Role *CurrencyPriceRole `json:"role,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Id = temp.Id - c.Currency = temp.Currency - c.Price = temp.Price - c.FormattedPrice = temp.FormattedPrice - c.ProductPricePointId = temp.ProductPricePointId - c.Role = temp.Role - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Currency *string `json:"currency,omitempty"` + Price *float64 `json:"price,omitempty"` + FormattedPrice *string `json:"formatted_price,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + Role *CurrencyPriceRole `json:"role,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Id = temp.Id + c.Currency = temp.Currency + c.Price = temp.Price + c.FormattedPrice = temp.FormattedPrice + c.ProductPricePointId = temp.ProductPricePointId + c.Role = temp.Role + return nil } diff --git a/models/currency_prices_response.go b/models/currency_prices_response.go index caceebab..147fccb3 100644 --- a/models/currency_prices_response.go +++ b/models/currency_prices_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CurrencyPricesResponse represents a CurrencyPricesResponse struct. type CurrencyPricesResponse struct { - CurrencyPrices []CurrencyPrice `json:"currency_prices"` + CurrencyPrices []CurrencyPrice `json:"currency_prices"` } -// MarshalJSON implements the json.Marshaler interface for CurrencyPricesResponse. +// MarshalJSON implements the json.Marshaler interface for CurrencyPricesResponse. // It customizes the JSON marshaling process for CurrencyPricesResponse objects. func (c *CurrencyPricesResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CurrencyPricesResponse object to a map representation for JSON marshaling. func (c *CurrencyPricesResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["currency_prices"] = c.CurrencyPrices - return structMap + structMap := make(map[string]any) + structMap["currency_prices"] = c.CurrencyPrices + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPricesResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPricesResponse. // It customizes the JSON unmarshaling process for CurrencyPricesResponse objects. func (c *CurrencyPricesResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrencyPrices []CurrencyPrice `json:"currency_prices"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.CurrencyPrices = temp.CurrencyPrices - return nil + temp := &struct { + CurrencyPrices []CurrencyPrice `json:"currency_prices"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.CurrencyPrices = temp.CurrencyPrices + return nil } diff --git a/models/customer.go b/models/customer.go index da70fe9f..da438cc0 100644 --- a/models/customer.go +++ b/models/customer.go @@ -1,224 +1,224 @@ package models import ( - "encoding/json" + "encoding/json" ) // Customer represents a Customer struct. type Customer struct { - // The first name of the customer - FirstName *string `json:"first_name,omitempty"` - // The last name of the customer - LastName *string `json:"last_name,omitempty"` - // The email address of the customer - Email *string `json:"email,omitempty"` - // A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) - CcEmails Optional[string] `json:"cc_emails"` - // The organization of the customer - Organization Optional[string] `json:"organization"` - // The unique identifier used within your own application for this customer - Reference Optional[string] `json:"reference"` - // The customer ID in Chargify - Id *int `json:"id,omitempty"` - // The timestamp in which the customer object was created in Chargify - CreatedAt *string `json:"created_at,omitempty"` - // The timestamp in which the customer object was last edited - UpdatedAt *string `json:"updated_at,omitempty"` - // The customer’s shipping street address (i.e. “123 Main St.”) - Address Optional[string] `json:"address"` - // Second line of the customer’s shipping address i.e. “Apt. 100” - Address2 Optional[string] `json:"address_2"` - // The customer’s shipping address city (i.e. “Boston”) - City Optional[string] `json:"city"` - // The customer’s shipping address state (i.e. “MA”) - State Optional[string] `json:"state"` - // The customer's full name of state - StateName Optional[string] `json:"state_name"` - // The customer’s shipping address zip code (i.e. “12345”) - Zip Optional[string] `json:"zip"` - // The customer shipping address country - Country Optional[string] `json:"country"` - // The customer's full name of country - CountryName Optional[string] `json:"country_name"` - // The phone number of the customer - Phone Optional[string] `json:"phone"` - // Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway - Verified Optional[bool] `json:"verified"` - // The timestamp of when the Billing Portal entry was created at for the customer - PortalCustomerCreatedAt Optional[string] `json:"portal_customer_created_at"` - // The timestamp of when the Billing Portal invite was last sent at - PortalInviteLastSentAt Optional[string] `json:"portal_invite_last_sent_at"` - // The timestamp of when the Billing Portal invite was last accepted - PortalInviteLastAcceptedAt Optional[string] `json:"portal_invite_last_accepted_at"` - // The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. - TaxExempt *bool `json:"tax_exempt,omitempty"` - // 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. - VatNumber Optional[string] `json:"vat_number"` - // The parent ID in Chargify if applicable. Parent is another Customer object. - ParentId Optional[int] `json:"parent_id"` - // The locale for the customer to identify language-region - Locale Optional[string] `json:"locale"` - DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"` + // The first name of the customer + FirstName *string `json:"first_name,omitempty"` + // The last name of the customer + LastName *string `json:"last_name,omitempty"` + // The email address of the customer + Email *string `json:"email,omitempty"` + // A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) + CcEmails Optional[string] `json:"cc_emails"` + // The organization of the customer + Organization Optional[string] `json:"organization"` + // The unique identifier used within your own application for this customer + Reference Optional[string] `json:"reference"` + // The customer ID in Chargify + Id *int `json:"id,omitempty"` + // The timestamp in which the customer object was created in Chargify + CreatedAt *string `json:"created_at,omitempty"` + // The timestamp in which the customer object was last edited + UpdatedAt *string `json:"updated_at,omitempty"` + // The customer’s shipping street address (i.e. “123 Main St.”) + Address Optional[string] `json:"address"` + // Second line of the customer’s shipping address i.e. “Apt. 100” + Address2 Optional[string] `json:"address_2"` + // The customer’s shipping address city (i.e. “Boston”) + City Optional[string] `json:"city"` + // The customer’s shipping address state (i.e. “MA”) + State Optional[string] `json:"state"` + // The customer's full name of state + StateName Optional[string] `json:"state_name"` + // The customer’s shipping address zip code (i.e. “12345”) + Zip Optional[string] `json:"zip"` + // The customer shipping address country + Country Optional[string] `json:"country"` + // The customer's full name of country + CountryName Optional[string] `json:"country_name"` + // The phone number of the customer + Phone Optional[string] `json:"phone"` + // Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway + Verified Optional[bool] `json:"verified"` + // The timestamp of when the Billing Portal entry was created at for the customer + PortalCustomerCreatedAt Optional[string] `json:"portal_customer_created_at"` + // The timestamp of when the Billing Portal invite was last sent at + PortalInviteLastSentAt Optional[string] `json:"portal_invite_last_sent_at"` + // The timestamp of when the Billing Portal invite was last accepted + PortalInviteLastAcceptedAt Optional[string] `json:"portal_invite_last_accepted_at"` + // The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. + TaxExempt *bool `json:"tax_exempt,omitempty"` + // 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. + VatNumber Optional[string] `json:"vat_number"` + // The parent ID in Chargify if applicable. Parent is another Customer object. + ParentId Optional[int] `json:"parent_id"` + // The locale for the customer to identify language-region + Locale Optional[string] `json:"locale"` + DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"` } -// MarshalJSON implements the json.Marshaler interface for Customer. +// MarshalJSON implements the json.Marshaler interface for Customer. // It customizes the JSON marshaling process for Customer objects. func (c *Customer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the Customer object to a map representation for JSON marshaling. func (c *Customer) toMap() map[string]any { - structMap := make(map[string]any) - if c.FirstName != nil { - structMap["first_name"] = c.FirstName - } - if c.LastName != nil { - structMap["last_name"] = c.LastName - } - if c.Email != nil { - structMap["email"] = c.Email - } - if c.CcEmails.IsValueSet() { - structMap["cc_emails"] = c.CcEmails.Value() - } - if c.Organization.IsValueSet() { - structMap["organization"] = c.Organization.Value() - } - if c.Reference.IsValueSet() { - structMap["reference"] = c.Reference.Value() - } - if c.Id != nil { - structMap["id"] = c.Id - } - if c.CreatedAt != nil { - structMap["created_at"] = c.CreatedAt - } - if c.UpdatedAt != nil { - structMap["updated_at"] = c.UpdatedAt - } - if c.Address.IsValueSet() { - structMap["address"] = c.Address.Value() - } - if c.Address2.IsValueSet() { - structMap["address_2"] = c.Address2.Value() - } - if c.City.IsValueSet() { - structMap["city"] = c.City.Value() - } - if c.State.IsValueSet() { - structMap["state"] = c.State.Value() - } - if c.StateName.IsValueSet() { - structMap["state_name"] = c.StateName.Value() - } - if c.Zip.IsValueSet() { - structMap["zip"] = c.Zip.Value() - } - if c.Country.IsValueSet() { - structMap["country"] = c.Country.Value() - } - if c.CountryName.IsValueSet() { - structMap["country_name"] = c.CountryName.Value() - } - if c.Phone.IsValueSet() { - structMap["phone"] = c.Phone.Value() - } - if c.Verified.IsValueSet() { - structMap["verified"] = c.Verified.Value() - } - if c.PortalCustomerCreatedAt.IsValueSet() { - structMap["portal_customer_created_at"] = c.PortalCustomerCreatedAt.Value() - } - if c.PortalInviteLastSentAt.IsValueSet() { - structMap["portal_invite_last_sent_at"] = c.PortalInviteLastSentAt.Value() - } - if c.PortalInviteLastAcceptedAt.IsValueSet() { - structMap["portal_invite_last_accepted_at"] = c.PortalInviteLastAcceptedAt.Value() - } - if c.TaxExempt != nil { - structMap["tax_exempt"] = c.TaxExempt - } - if c.VatNumber.IsValueSet() { - structMap["vat_number"] = c.VatNumber.Value() - } - if c.ParentId.IsValueSet() { - structMap["parent_id"] = c.ParentId.Value() - } - if c.Locale.IsValueSet() { - structMap["locale"] = c.Locale.Value() - } - if c.DefaultSubscriptionGroupUid.IsValueSet() { - structMap["default_subscription_group_uid"] = c.DefaultSubscriptionGroupUid.Value() - } - return structMap + structMap := make(map[string]any) + if c.FirstName != nil { + structMap["first_name"] = c.FirstName + } + if c.LastName != nil { + structMap["last_name"] = c.LastName + } + if c.Email != nil { + structMap["email"] = c.Email + } + if c.CcEmails.IsValueSet() { + structMap["cc_emails"] = c.CcEmails.Value() + } + if c.Organization.IsValueSet() { + structMap["organization"] = c.Organization.Value() + } + if c.Reference.IsValueSet() { + structMap["reference"] = c.Reference.Value() + } + if c.Id != nil { + structMap["id"] = c.Id + } + if c.CreatedAt != nil { + structMap["created_at"] = c.CreatedAt + } + if c.UpdatedAt != nil { + structMap["updated_at"] = c.UpdatedAt + } + if c.Address.IsValueSet() { + structMap["address"] = c.Address.Value() + } + if c.Address2.IsValueSet() { + structMap["address_2"] = c.Address2.Value() + } + if c.City.IsValueSet() { + structMap["city"] = c.City.Value() + } + if c.State.IsValueSet() { + structMap["state"] = c.State.Value() + } + if c.StateName.IsValueSet() { + structMap["state_name"] = c.StateName.Value() + } + if c.Zip.IsValueSet() { + structMap["zip"] = c.Zip.Value() + } + if c.Country.IsValueSet() { + structMap["country"] = c.Country.Value() + } + if c.CountryName.IsValueSet() { + structMap["country_name"] = c.CountryName.Value() + } + if c.Phone.IsValueSet() { + structMap["phone"] = c.Phone.Value() + } + if c.Verified.IsValueSet() { + structMap["verified"] = c.Verified.Value() + } + if c.PortalCustomerCreatedAt.IsValueSet() { + structMap["portal_customer_created_at"] = c.PortalCustomerCreatedAt.Value() + } + if c.PortalInviteLastSentAt.IsValueSet() { + structMap["portal_invite_last_sent_at"] = c.PortalInviteLastSentAt.Value() + } + if c.PortalInviteLastAcceptedAt.IsValueSet() { + structMap["portal_invite_last_accepted_at"] = c.PortalInviteLastAcceptedAt.Value() + } + if c.TaxExempt != nil { + structMap["tax_exempt"] = c.TaxExempt + } + if c.VatNumber.IsValueSet() { + structMap["vat_number"] = c.VatNumber.Value() + } + if c.ParentId.IsValueSet() { + structMap["parent_id"] = c.ParentId.Value() + } + if c.Locale.IsValueSet() { + structMap["locale"] = c.Locale.Value() + } + if c.DefaultSubscriptionGroupUid.IsValueSet() { + structMap["default_subscription_group_uid"] = c.DefaultSubscriptionGroupUid.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Customer. +// UnmarshalJSON implements the json.Unmarshaler interface for Customer. // It customizes the JSON unmarshaling process for Customer objects. func (c *Customer) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails Optional[string] `json:"cc_emails"` - Organization Optional[string] `json:"organization"` - Reference Optional[string] `json:"reference"` - Id *int `json:"id,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - Address Optional[string] `json:"address"` - Address2 Optional[string] `json:"address_2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - StateName Optional[string] `json:"state_name"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` - CountryName Optional[string] `json:"country_name"` - Phone Optional[string] `json:"phone"` - Verified Optional[bool] `json:"verified"` - PortalCustomerCreatedAt Optional[string] `json:"portal_customer_created_at"` - PortalInviteLastSentAt Optional[string] `json:"portal_invite_last_sent_at"` - PortalInviteLastAcceptedAt Optional[string] `json:"portal_invite_last_accepted_at"` - TaxExempt *bool `json:"tax_exempt,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - ParentId Optional[int] `json:"parent_id"` - Locale Optional[string] `json:"locale"` - DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.FirstName = temp.FirstName - c.LastName = temp.LastName - c.Email = temp.Email - c.CcEmails = temp.CcEmails - c.Organization = temp.Organization - c.Reference = temp.Reference - c.Id = temp.Id - c.CreatedAt = temp.CreatedAt - c.UpdatedAt = temp.UpdatedAt - c.Address = temp.Address - c.Address2 = temp.Address2 - c.City = temp.City - c.State = temp.State - c.StateName = temp.StateName - c.Zip = temp.Zip - c.Country = temp.Country - c.CountryName = temp.CountryName - c.Phone = temp.Phone - c.Verified = temp.Verified - c.PortalCustomerCreatedAt = temp.PortalCustomerCreatedAt - c.PortalInviteLastSentAt = temp.PortalInviteLastSentAt - c.PortalInviteLastAcceptedAt = temp.PortalInviteLastAcceptedAt - c.TaxExempt = temp.TaxExempt - c.VatNumber = temp.VatNumber - c.ParentId = temp.ParentId - c.Locale = temp.Locale - c.DefaultSubscriptionGroupUid = temp.DefaultSubscriptionGroupUid - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails Optional[string] `json:"cc_emails"` + Organization Optional[string] `json:"organization"` + Reference Optional[string] `json:"reference"` + Id *int `json:"id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Address Optional[string] `json:"address"` + Address2 Optional[string] `json:"address_2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + StateName Optional[string] `json:"state_name"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` + CountryName Optional[string] `json:"country_name"` + Phone Optional[string] `json:"phone"` + Verified Optional[bool] `json:"verified"` + PortalCustomerCreatedAt Optional[string] `json:"portal_customer_created_at"` + PortalInviteLastSentAt Optional[string] `json:"portal_invite_last_sent_at"` + PortalInviteLastAcceptedAt Optional[string] `json:"portal_invite_last_accepted_at"` + TaxExempt *bool `json:"tax_exempt,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + ParentId Optional[int] `json:"parent_id"` + Locale Optional[string] `json:"locale"` + DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.FirstName = temp.FirstName + c.LastName = temp.LastName + c.Email = temp.Email + c.CcEmails = temp.CcEmails + c.Organization = temp.Organization + c.Reference = temp.Reference + c.Id = temp.Id + c.CreatedAt = temp.CreatedAt + c.UpdatedAt = temp.UpdatedAt + c.Address = temp.Address + c.Address2 = temp.Address2 + c.City = temp.City + c.State = temp.State + c.StateName = temp.StateName + c.Zip = temp.Zip + c.Country = temp.Country + c.CountryName = temp.CountryName + c.Phone = temp.Phone + c.Verified = temp.Verified + c.PortalCustomerCreatedAt = temp.PortalCustomerCreatedAt + c.PortalInviteLastSentAt = temp.PortalInviteLastSentAt + c.PortalInviteLastAcceptedAt = temp.PortalInviteLastAcceptedAt + c.TaxExempt = temp.TaxExempt + c.VatNumber = temp.VatNumber + c.ParentId = temp.ParentId + c.Locale = temp.Locale + c.DefaultSubscriptionGroupUid = temp.DefaultSubscriptionGroupUid + return nil } diff --git a/models/customer_1.go b/models/customer_1.go index a847a2c0..b5676405 100644 --- a/models/customer_1.go +++ b/models/customer_1.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // Customer1 represents a Customer1 struct. type Customer1 struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - Reference Optional[string] `json:"reference"` + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + Reference Optional[string] `json:"reference"` } -// MarshalJSON implements the json.Marshaler interface for Customer1. +// MarshalJSON implements the json.Marshaler interface for Customer1. // It customizes the JSON marshaling process for Customer1 objects. func (c *Customer1) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the Customer1 object to a map representation for JSON marshaling. func (c *Customer1) toMap() map[string]any { - structMap := make(map[string]any) - if c.ChargifyId != nil { - structMap["chargify_id"] = c.ChargifyId - } - if c.FirstName != nil { - structMap["first_name"] = c.FirstName - } - if c.LastName != nil { - structMap["last_name"] = c.LastName - } - if c.Organization.IsValueSet() { - structMap["organization"] = c.Organization.Value() - } - if c.Email != nil { - structMap["email"] = c.Email - } - if c.VatNumber.IsValueSet() { - structMap["vat_number"] = c.VatNumber.Value() - } - if c.Reference.IsValueSet() { - structMap["reference"] = c.Reference.Value() - } - return structMap + structMap := make(map[string]any) + if c.ChargifyId != nil { + structMap["chargify_id"] = c.ChargifyId + } + if c.FirstName != nil { + structMap["first_name"] = c.FirstName + } + if c.LastName != nil { + structMap["last_name"] = c.LastName + } + if c.Organization.IsValueSet() { + structMap["organization"] = c.Organization.Value() + } + if c.Email != nil { + structMap["email"] = c.Email + } + if c.VatNumber.IsValueSet() { + structMap["vat_number"] = c.VatNumber.Value() + } + if c.Reference.IsValueSet() { + structMap["reference"] = c.Reference.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Customer1. +// UnmarshalJSON implements the json.Unmarshaler interface for Customer1. // It customizes the JSON unmarshaling process for Customer1 objects. func (c *Customer1) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - Reference Optional[string] `json:"reference"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.ChargifyId = temp.ChargifyId - c.FirstName = temp.FirstName - c.LastName = temp.LastName - c.Organization = temp.Organization - c.Email = temp.Email - c.VatNumber = temp.VatNumber - c.Reference = temp.Reference - return nil + temp := &struct { + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + Reference Optional[string] `json:"reference"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.ChargifyId = temp.ChargifyId + c.FirstName = temp.FirstName + c.LastName = temp.LastName + c.Organization = temp.Organization + c.Email = temp.Email + c.VatNumber = temp.VatNumber + c.Reference = temp.Reference + return nil } diff --git a/models/customer_attributes.go b/models/customer_attributes.go index f78d7935..191dca7b 100644 --- a/models/customer_attributes.go +++ b/models/customer_attributes.go @@ -1,161 +1,161 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerAttributes represents a CustomerAttributes struct. type CustomerAttributes struct { - // The first name of the customer. Required when creating a customer via attributes. - FirstName *string `json:"first_name,omitempty"` - // The last name of the customer. Required when creating a customer via attributes. - LastName *string `json:"last_name,omitempty"` - // The email address of the customer. Required when creating a customer via attributes. - Email *string `json:"email,omitempty"` - // A list of emails that should be cc’d on all customer communications. Optional. - CcEmails *string `json:"cc_emails,omitempty"` - // The organization/company of the customer. Optional. - Organization *string `json:"organization,omitempty"` - // 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. - Reference *string `json:"reference,omitempty"` - // (Optional) The customer’s shipping street address (i.e. “123 Main St.”). - Address *string `json:"address,omitempty"` - // (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” - Address2 Optional[string] `json:"address_2"` - // (Optional) The customer’s shipping address city (i.e. “Boston”). - City *string `json:"city,omitempty"` - // (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. - State *string `json:"state,omitempty"` - // (Optional) The customer’s shipping address zip code (i.e. “12345”). - Zip *string `json:"zip,omitempty"` - // (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”). - Country *string `json:"country,omitempty"` - // (Optional) The phone number of the customer. - Phone *string `json:"phone,omitempty"` - Verified *bool `json:"verified,omitempty"` - // (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. - TaxExempt *bool `json:"tax_exempt,omitempty"` - // (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. - VatNumber *string `json:"vat_number,omitempty"` - // (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. - Metafields map[string]string `json:"metafields,omitempty"` - // The parent ID in Chargify if applicable. Parent is another Customer object. - ParentId Optional[int] `json:"parent_id"` + // The first name of the customer. Required when creating a customer via attributes. + FirstName *string `json:"first_name,omitempty"` + // The last name of the customer. Required when creating a customer via attributes. + LastName *string `json:"last_name,omitempty"` + // The email address of the customer. Required when creating a customer via attributes. + Email *string `json:"email,omitempty"` + // A list of emails that should be cc’d on all customer communications. Optional. + CcEmails *string `json:"cc_emails,omitempty"` + // The organization/company of the customer. Optional. + Organization *string `json:"organization,omitempty"` + // 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. + Reference *string `json:"reference,omitempty"` + // (Optional) The customer’s shipping street address (i.e. “123 Main St.”). + Address *string `json:"address,omitempty"` + // (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + Address2 Optional[string] `json:"address_2"` + // (Optional) The customer’s shipping address city (i.e. “Boston”). + City *string `json:"city,omitempty"` + // (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. + State *string `json:"state,omitempty"` + // (Optional) The customer’s shipping address zip code (i.e. “12345”). + Zip *string `json:"zip,omitempty"` + // (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”). + Country *string `json:"country,omitempty"` + // (Optional) The phone number of the customer. + Phone *string `json:"phone,omitempty"` + Verified *bool `json:"verified,omitempty"` + // (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. + TaxExempt *bool `json:"tax_exempt,omitempty"` + // (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. + VatNumber *string `json:"vat_number,omitempty"` + // (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. + Metafields map[string]string `json:"metafields,omitempty"` + // The parent ID in Chargify if applicable. Parent is another Customer object. + ParentId Optional[int] `json:"parent_id"` } -// MarshalJSON implements the json.Marshaler interface for CustomerAttributes. +// MarshalJSON implements the json.Marshaler interface for CustomerAttributes. // It customizes the JSON marshaling process for CustomerAttributes objects. func (c *CustomerAttributes) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerAttributes object to a map representation for JSON marshaling. func (c *CustomerAttributes) toMap() map[string]any { - structMap := make(map[string]any) - if c.FirstName != nil { - structMap["first_name"] = c.FirstName - } - if c.LastName != nil { - structMap["last_name"] = c.LastName - } - if c.Email != nil { - structMap["email"] = c.Email - } - if c.CcEmails != nil { - structMap["cc_emails"] = c.CcEmails - } - if c.Organization != nil { - structMap["organization"] = c.Organization - } - if c.Reference != nil { - structMap["reference"] = c.Reference - } - if c.Address != nil { - structMap["address"] = c.Address - } - if c.Address2.IsValueSet() { - structMap["address_2"] = c.Address2.Value() - } - if c.City != nil { - structMap["city"] = c.City - } - if c.State != nil { - structMap["state"] = c.State - } - if c.Zip != nil { - structMap["zip"] = c.Zip - } - if c.Country != nil { - structMap["country"] = c.Country - } - if c.Phone != nil { - structMap["phone"] = c.Phone - } - if c.Verified != nil { - structMap["verified"] = c.Verified - } - if c.TaxExempt != nil { - structMap["tax_exempt"] = c.TaxExempt - } - if c.VatNumber != nil { - structMap["vat_number"] = c.VatNumber - } - if c.Metafields != nil { - structMap["metafields"] = c.Metafields - } - if c.ParentId.IsValueSet() { - structMap["parent_id"] = c.ParentId.Value() - } - return structMap + structMap := make(map[string]any) + if c.FirstName != nil { + structMap["first_name"] = c.FirstName + } + if c.LastName != nil { + structMap["last_name"] = c.LastName + } + if c.Email != nil { + structMap["email"] = c.Email + } + if c.CcEmails != nil { + structMap["cc_emails"] = c.CcEmails + } + if c.Organization != nil { + structMap["organization"] = c.Organization + } + if c.Reference != nil { + structMap["reference"] = c.Reference + } + if c.Address != nil { + structMap["address"] = c.Address + } + if c.Address2.IsValueSet() { + structMap["address_2"] = c.Address2.Value() + } + if c.City != nil { + structMap["city"] = c.City + } + if c.State != nil { + structMap["state"] = c.State + } + if c.Zip != nil { + structMap["zip"] = c.Zip + } + if c.Country != nil { + structMap["country"] = c.Country + } + if c.Phone != nil { + structMap["phone"] = c.Phone + } + if c.Verified != nil { + structMap["verified"] = c.Verified + } + if c.TaxExempt != nil { + structMap["tax_exempt"] = c.TaxExempt + } + if c.VatNumber != nil { + structMap["vat_number"] = c.VatNumber + } + if c.Metafields != nil { + structMap["metafields"] = c.Metafields + } + if c.ParentId.IsValueSet() { + structMap["parent_id"] = c.ParentId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerAttributes. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerAttributes. // It customizes the JSON unmarshaling process for CustomerAttributes objects. func (c *CustomerAttributes) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails *string `json:"cc_emails,omitempty"` - Organization *string `json:"organization,omitempty"` - Reference *string `json:"reference,omitempty"` - Address *string `json:"address,omitempty"` - Address2 Optional[string] `json:"address_2"` - City *string `json:"city,omitempty"` - State *string `json:"state,omitempty"` - Zip *string `json:"zip,omitempty"` - Country *string `json:"country,omitempty"` - Phone *string `json:"phone,omitempty"` - Verified *bool `json:"verified,omitempty"` - TaxExempt *bool `json:"tax_exempt,omitempty"` - VatNumber *string `json:"vat_number,omitempty"` - Metafields map[string]string `json:"metafields,omitempty"` - ParentId Optional[int] `json:"parent_id"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.FirstName = temp.FirstName - c.LastName = temp.LastName - c.Email = temp.Email - c.CcEmails = temp.CcEmails - c.Organization = temp.Organization - c.Reference = temp.Reference - c.Address = temp.Address - c.Address2 = temp.Address2 - c.City = temp.City - c.State = temp.State - c.Zip = temp.Zip - c.Country = temp.Country - c.Phone = temp.Phone - c.Verified = temp.Verified - c.TaxExempt = temp.TaxExempt - c.VatNumber = temp.VatNumber - c.Metafields = temp.Metafields - c.ParentId = temp.ParentId - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails *string `json:"cc_emails,omitempty"` + Organization *string `json:"organization,omitempty"` + Reference *string `json:"reference,omitempty"` + Address *string `json:"address,omitempty"` + Address2 Optional[string] `json:"address_2"` + City *string `json:"city,omitempty"` + State *string `json:"state,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Phone *string `json:"phone,omitempty"` + Verified *bool `json:"verified,omitempty"` + TaxExempt *bool `json:"tax_exempt,omitempty"` + VatNumber *string `json:"vat_number,omitempty"` + Metafields map[string]string `json:"metafields,omitempty"` + ParentId Optional[int] `json:"parent_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.FirstName = temp.FirstName + c.LastName = temp.LastName + c.Email = temp.Email + c.CcEmails = temp.CcEmails + c.Organization = temp.Organization + c.Reference = temp.Reference + c.Address = temp.Address + c.Address2 = temp.Address2 + c.City = temp.City + c.State = temp.State + c.Zip = temp.Zip + c.Country = temp.Country + c.Phone = temp.Phone + c.Verified = temp.Verified + c.TaxExempt = temp.TaxExempt + c.VatNumber = temp.VatNumber + c.Metafields = temp.Metafields + c.ParentId = temp.ParentId + return nil } diff --git a/models/customer_billing_address_change.go b/models/customer_billing_address_change.go deleted file mode 100644 index 1d709785..00000000 --- a/models/customer_billing_address_change.go +++ /dev/null @@ -1,48 +0,0 @@ -package models - -import ( - "encoding/json" -) - -// CustomerBillingAddressChange represents a CustomerBillingAddressChange struct. -type CustomerBillingAddressChange struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` -} - -// MarshalJSON implements the json.Marshaler interface for CustomerBillingAddressChange. -// It customizes the JSON marshaling process for CustomerBillingAddressChange objects. -func (c *CustomerBillingAddressChange) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) -} - -// toMap converts the CustomerBillingAddressChange object to a map representation for JSON marshaling. -func (c *CustomerBillingAddressChange) toMap() map[string]any { - structMap := make(map[string]any) - if c.Before != nil { - structMap["before"] = c.Before - } - if c.After != nil { - structMap["after"] = c.After - } - return structMap -} - -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerBillingAddressChange. -// It customizes the JSON unmarshaling process for CustomerBillingAddressChange objects. -func (c *CustomerBillingAddressChange) UnmarshalJSON(input []byte) error { - temp := &struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Before = temp.Before - c.After = temp.After - return nil -} diff --git a/models/customer_change.go b/models/customer_change.go index 1283ae83..42dd627a 100644 --- a/models/customer_change.go +++ b/models/customer_change.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerChange represents a CustomerChange struct. type CustomerChange struct { - Payer *CustomerPayerChange `json:"payer,omitempty"` - ShippingAddress *CustomerShippingAddressChange `json:"shipping_address,omitempty"` - BillingAddress *CustomerBillingAddressChange `json:"billing_address,omitempty"` - CustomFields *CustomerCustomFieldsChange `json:"custom_fields,omitempty"` + Payer Optional[CustomerPayerChange] `json:"payer"` + ShippingAddress Optional[AddressChange] `json:"shipping_address"` + BillingAddress Optional[AddressChange] `json:"billing_address"` + CustomFields Optional[CustomerCustomFieldsChange] `json:"custom_fields"` } -// MarshalJSON implements the json.Marshaler interface for CustomerChange. +// MarshalJSON implements the json.Marshaler interface for CustomerChange. // It customizes the JSON marshaling process for CustomerChange objects. func (c *CustomerChange) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerChange object to a map representation for JSON marshaling. func (c *CustomerChange) toMap() map[string]any { - structMap := make(map[string]any) - if c.Payer != nil { - structMap["payer"] = c.Payer - } - if c.ShippingAddress != nil { - structMap["shipping_address"] = c.ShippingAddress - } - if c.BillingAddress != nil { - structMap["billing_address"] = c.BillingAddress - } - if c.CustomFields != nil { - structMap["custom_fields"] = c.CustomFields - } - return structMap + structMap := make(map[string]any) + if c.Payer.IsValueSet() { + structMap["payer"] = c.Payer.Value() + } + if c.ShippingAddress.IsValueSet() { + structMap["shipping_address"] = c.ShippingAddress.Value() + } + if c.BillingAddress.IsValueSet() { + structMap["billing_address"] = c.BillingAddress.Value() + } + if c.CustomFields.IsValueSet() { + structMap["custom_fields"] = c.CustomFields.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerChange. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerChange. // It customizes the JSON unmarshaling process for CustomerChange objects. func (c *CustomerChange) UnmarshalJSON(input []byte) error { - temp := &struct { - Payer *CustomerPayerChange `json:"payer,omitempty"` - ShippingAddress *CustomerShippingAddressChange `json:"shipping_address,omitempty"` - BillingAddress *CustomerBillingAddressChange `json:"billing_address,omitempty"` - CustomFields *CustomerCustomFieldsChange `json:"custom_fields,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Payer = temp.Payer - c.ShippingAddress = temp.ShippingAddress - c.BillingAddress = temp.BillingAddress - c.CustomFields = temp.CustomFields - return nil + temp := &struct { + Payer Optional[CustomerPayerChange] `json:"payer"` + ShippingAddress Optional[AddressChange] `json:"shipping_address"` + BillingAddress Optional[AddressChange] `json:"billing_address"` + CustomFields Optional[CustomerCustomFieldsChange] `json:"custom_fields"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Payer = temp.Payer + c.ShippingAddress = temp.ShippingAddress + c.BillingAddress = temp.BillingAddress + c.CustomFields = temp.CustomFields + return nil } diff --git a/models/customer_changes_preview_response.go b/models/customer_changes_preview_response.go index 6c5467a0..d3b8035c 100644 --- a/models/customer_changes_preview_response.go +++ b/models/customer_changes_preview_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerChangesPreviewResponse represents a CustomerChangesPreviewResponse struct. type CustomerChangesPreviewResponse struct { - Changes CustomerChange `json:"changes"` + Changes CustomerChange `json:"changes"` } -// MarshalJSON implements the json.Marshaler interface for CustomerChangesPreviewResponse. +// MarshalJSON implements the json.Marshaler interface for CustomerChangesPreviewResponse. // It customizes the JSON marshaling process for CustomerChangesPreviewResponse objects. func (c *CustomerChangesPreviewResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerChangesPreviewResponse object to a map representation for JSON marshaling. func (c *CustomerChangesPreviewResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["changes"] = c.Changes - return structMap + structMap := make(map[string]any) + structMap["changes"] = c.Changes.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerChangesPreviewResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerChangesPreviewResponse. // It customizes the JSON unmarshaling process for CustomerChangesPreviewResponse objects. func (c *CustomerChangesPreviewResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Changes CustomerChange `json:"changes"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Changes = temp.Changes - return nil + temp := &struct { + Changes CustomerChange `json:"changes"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Changes = temp.Changes + return nil } diff --git a/models/customer_custom_fields_change.go b/models/customer_custom_fields_change.go index 96d02b45..1a7550e3 100644 --- a/models/customer_custom_fields_change.go +++ b/models/customer_custom_fields_change.go @@ -1,48 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerCustomFieldsChange represents a CustomerCustomFieldsChange struct. type CustomerCustomFieldsChange struct { - Before []ProformaCustomField `json:"before,omitempty"` - After []ProformaCustomField `json:"after,omitempty"` + Before []InvoiceCustomField `json:"before"` + After []InvoiceCustomField `json:"after"` } -// MarshalJSON implements the json.Marshaler interface for CustomerCustomFieldsChange. +// MarshalJSON implements the json.Marshaler interface for CustomerCustomFieldsChange. // It customizes the JSON marshaling process for CustomerCustomFieldsChange objects. func (c *CustomerCustomFieldsChange) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerCustomFieldsChange object to a map representation for JSON marshaling. func (c *CustomerCustomFieldsChange) toMap() map[string]any { - structMap := make(map[string]any) - if c.Before != nil { - structMap["before"] = c.Before - } - if c.After != nil { - structMap["after"] = c.After - } - return structMap + structMap := make(map[string]any) + structMap["before"] = c.Before + structMap["after"] = c.After + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerCustomFieldsChange. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerCustomFieldsChange. // It customizes the JSON unmarshaling process for CustomerCustomFieldsChange objects. func (c *CustomerCustomFieldsChange) UnmarshalJSON(input []byte) error { - temp := &struct { - Before []ProformaCustomField `json:"before,omitempty"` - After []ProformaCustomField `json:"after,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Before = temp.Before - c.After = temp.After - return nil + temp := &struct { + Before []InvoiceCustomField `json:"before"` + After []InvoiceCustomField `json:"after"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Before = temp.Before + c.After = temp.After + return nil } diff --git a/models/customer_payer_change.go b/models/customer_payer_change.go index a885c29c..e5ec1b3d 100644 --- a/models/customer_payer_change.go +++ b/models/customer_payer_change.go @@ -1,48 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerPayerChange represents a CustomerPayerChange struct. type CustomerPayerChange struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` + Before InvoicePayerChange `json:"before"` + After InvoicePayerChange `json:"after"` } -// MarshalJSON implements the json.Marshaler interface for CustomerPayerChange. +// MarshalJSON implements the json.Marshaler interface for CustomerPayerChange. // It customizes the JSON marshaling process for CustomerPayerChange objects. func (c *CustomerPayerChange) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerPayerChange object to a map representation for JSON marshaling. func (c *CustomerPayerChange) toMap() map[string]any { - structMap := make(map[string]any) - if c.Before != nil { - structMap["before"] = c.Before - } - if c.After != nil { - structMap["after"] = c.After - } - return structMap + structMap := make(map[string]any) + structMap["before"] = c.Before.toMap() + structMap["after"] = c.After.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerPayerChange. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerPayerChange. // It customizes the JSON unmarshaling process for CustomerPayerChange objects. func (c *CustomerPayerChange) UnmarshalJSON(input []byte) error { - temp := &struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Before = temp.Before - c.After = temp.After - return nil + temp := &struct { + Before InvoicePayerChange `json:"before"` + After InvoicePayerChange `json:"after"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Before = temp.Before + c.After = temp.After + return nil } diff --git a/models/customer_response.go b/models/customer_response.go index 1c0c84e2..97be6aa8 100644 --- a/models/customer_response.go +++ b/models/customer_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // CustomerResponse represents a CustomerResponse struct. type CustomerResponse struct { - Customer Customer `json:"customer"` + Customer Customer `json:"customer"` } -// MarshalJSON implements the json.Marshaler interface for CustomerResponse. +// MarshalJSON implements the json.Marshaler interface for CustomerResponse. // It customizes the JSON marshaling process for CustomerResponse objects. func (c *CustomerResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) + []byte, + error) { + return json.Marshal(c.toMap()) } // toMap converts the CustomerResponse object to a map representation for JSON marshaling. func (c *CustomerResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["customer"] = c.Customer - return structMap + structMap := make(map[string]any) + structMap["customer"] = c.Customer.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for CustomerResponse. // It customizes the JSON unmarshaling process for CustomerResponse objects. func (c *CustomerResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Customer Customer `json:"customer"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Customer = temp.Customer - return nil + temp := &struct { + Customer Customer `json:"customer"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + c.Customer = temp.Customer + return nil } diff --git a/models/customer_shipping_address_change.go b/models/customer_shipping_address_change.go deleted file mode 100644 index 9c25be1b..00000000 --- a/models/customer_shipping_address_change.go +++ /dev/null @@ -1,48 +0,0 @@ -package models - -import ( - "encoding/json" -) - -// CustomerShippingAddressChange represents a CustomerShippingAddressChange struct. -type CustomerShippingAddressChange struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` -} - -// MarshalJSON implements the json.Marshaler interface for CustomerShippingAddressChange. -// It customizes the JSON marshaling process for CustomerShippingAddressChange objects. -func (c *CustomerShippingAddressChange) MarshalJSON() ( - []byte, - error) { - return json.Marshal(c.toMap()) -} - -// toMap converts the CustomerShippingAddressChange object to a map representation for JSON marshaling. -func (c *CustomerShippingAddressChange) toMap() map[string]any { - structMap := make(map[string]any) - if c.Before != nil { - structMap["before"] = c.Before - } - if c.After != nil { - structMap["after"] = c.After - } - return structMap -} - -// UnmarshalJSON implements the json.Unmarshaler interface for CustomerShippingAddressChange. -// It customizes the JSON unmarshaling process for CustomerShippingAddressChange objects. -func (c *CustomerShippingAddressChange) UnmarshalJSON(input []byte) error { - temp := &struct { - Before *interface{} `json:"before,omitempty"` - After *interface{} `json:"after,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - c.Before = temp.Before - c.After = temp.After - return nil -} diff --git a/models/deduct_service_credit.go b/models/deduct_service_credit.go index e92a53e9..9a2331d6 100644 --- a/models/deduct_service_credit.go +++ b/models/deduct_service_credit.go @@ -1,44 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) // DeductServiceCredit represents a DeductServiceCredit struct. type DeductServiceCredit struct { - Amount interface{} `json:"amount"` - Memo string `json:"memo"` + Amount interface{} `json:"amount"` + Memo string `json:"memo"` } -// MarshalJSON implements the json.Marshaler interface for DeductServiceCredit. +// MarshalJSON implements the json.Marshaler interface for DeductServiceCredit. // It customizes the JSON marshaling process for DeductServiceCredit objects. func (d *DeductServiceCredit) MarshalJSON() ( - []byte, - error) { - return json.Marshal(d.toMap()) + []byte, + error) { + return json.Marshal(d.toMap()) } // toMap converts the DeductServiceCredit object to a map representation for JSON marshaling. func (d *DeductServiceCredit) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount"] = d.Amount - structMap["memo"] = d.Memo - return structMap + structMap := make(map[string]any) + structMap["amount"] = d.Amount + structMap["memo"] = d.Memo + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCredit. +// UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCredit. // It customizes the JSON unmarshaling process for DeductServiceCredit objects. func (d *DeductServiceCredit) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount interface{} `json:"amount"` - Memo string `json:"memo"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - d.Amount = temp.Amount - d.Memo = temp.Memo - return nil + temp := &struct { + Amount interface{} `json:"amount"` + Memo string `json:"memo"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + d.Amount = temp.Amount + d.Memo = temp.Memo + return nil } diff --git a/models/deduct_service_credit_request.go b/models/deduct_service_credit_request.go index a4cf063d..eed78ac3 100644 --- a/models/deduct_service_credit_request.go +++ b/models/deduct_service_credit_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // DeductServiceCreditRequest represents a DeductServiceCreditRequest struct. type DeductServiceCreditRequest struct { - Deduction DeductServiceCredit `json:"deduction"` + Deduction DeductServiceCredit `json:"deduction"` } -// MarshalJSON implements the json.Marshaler interface for DeductServiceCreditRequest. +// MarshalJSON implements the json.Marshaler interface for DeductServiceCreditRequest. // It customizes the JSON marshaling process for DeductServiceCreditRequest objects. func (d *DeductServiceCreditRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(d.toMap()) + []byte, + error) { + return json.Marshal(d.toMap()) } // toMap converts the DeductServiceCreditRequest object to a map representation for JSON marshaling. func (d *DeductServiceCreditRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["deduction"] = d.Deduction - return structMap + structMap := make(map[string]any) + structMap["deduction"] = d.Deduction.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCreditRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCreditRequest. // It customizes the JSON unmarshaling process for DeductServiceCreditRequest objects. func (d *DeductServiceCreditRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Deduction DeductServiceCredit `json:"deduction"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - d.Deduction = temp.Deduction - return nil + temp := &struct { + Deduction DeductServiceCredit `json:"deduction"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + d.Deduction = temp.Deduction + return nil } diff --git a/models/delayed_cancellation_response.go b/models/delayed_cancellation_response.go index 18bcbc7e..e42af920 100644 --- a/models/delayed_cancellation_response.go +++ b/models/delayed_cancellation_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // DelayedCancellationResponse represents a DelayedCancellationResponse struct. type DelayedCancellationResponse struct { - Message *string `json:"message,omitempty"` + Message *string `json:"message,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for DelayedCancellationResponse. +// MarshalJSON implements the json.Marshaler interface for DelayedCancellationResponse. // It customizes the JSON marshaling process for DelayedCancellationResponse objects. func (d *DelayedCancellationResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(d.toMap()) + []byte, + error) { + return json.Marshal(d.toMap()) } // toMap converts the DelayedCancellationResponse object to a map representation for JSON marshaling. func (d *DelayedCancellationResponse) toMap() map[string]any { - structMap := make(map[string]any) - if d.Message != nil { - structMap["message"] = d.Message - } - return structMap + structMap := make(map[string]any) + if d.Message != nil { + structMap["message"] = d.Message + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for DelayedCancellationResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for DelayedCancellationResponse. // It customizes the JSON unmarshaling process for DelayedCancellationResponse objects. func (d *DelayedCancellationResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Message *string `json:"message,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - d.Message = temp.Message - return nil + temp := &struct { + Message *string `json:"message,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + d.Message = temp.Message + return nil } diff --git a/models/delete_subscription_group_response.go b/models/delete_subscription_group_response.go index 9457e9f0..20e24c2e 100644 --- a/models/delete_subscription_group_response.go +++ b/models/delete_subscription_group_response.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // DeleteSubscriptionGroupResponse represents a DeleteSubscriptionGroupResponse struct. type DeleteSubscriptionGroupResponse struct { - Uid *string `json:"uid,omitempty"` - Deleted *bool `json:"deleted,omitempty"` + Uid *string `json:"uid,omitempty"` + Deleted *bool `json:"deleted,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for DeleteSubscriptionGroupResponse. +// MarshalJSON implements the json.Marshaler interface for DeleteSubscriptionGroupResponse. // It customizes the JSON marshaling process for DeleteSubscriptionGroupResponse objects. func (d *DeleteSubscriptionGroupResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(d.toMap()) + []byte, + error) { + return json.Marshal(d.toMap()) } // toMap converts the DeleteSubscriptionGroupResponse object to a map representation for JSON marshaling. func (d *DeleteSubscriptionGroupResponse) toMap() map[string]any { - structMap := make(map[string]any) - if d.Uid != nil { - structMap["uid"] = d.Uid - } - if d.Deleted != nil { - structMap["deleted"] = d.Deleted - } - return structMap + structMap := make(map[string]any) + if d.Uid != nil { + structMap["uid"] = d.Uid + } + if d.Deleted != nil { + structMap["deleted"] = d.Deleted + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for DeleteSubscriptionGroupResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for DeleteSubscriptionGroupResponse. // It customizes the JSON unmarshaling process for DeleteSubscriptionGroupResponse objects. func (d *DeleteSubscriptionGroupResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Deleted *bool `json:"deleted,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - d.Uid = temp.Uid - d.Deleted = temp.Deleted - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Deleted *bool `json:"deleted,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + d.Uid = temp.Uid + d.Deleted = temp.Deleted + return nil } diff --git a/models/ebb_component.go b/models/ebb_component.go index c2a9bf9d..0c9f7661 100644 --- a/models/ebb_component.go +++ b/models/ebb_component.go @@ -1,148 +1,148 @@ package models import ( - "encoding/json" + "encoding/json" ) // EBBComponent represents a EBBComponent struct. type EBBComponent struct { - // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". - Name string `json:"name"` - // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item - UnitName string `json:"unit_name"` - // A description for the component that will be displayed to the user on the hosted signup page. - Description *string `json:"description,omitempty"` - // 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 '_'. - Handle *string `json:"handle,omitempty"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. - Prices []Price `json:"prices,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - // 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 - UnitPrice *interface{} `json:"unit_price,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` - // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - // deprecated May 2011 - use unit_price instead - PriceInCents *string `json:"price_in_cents,omitempty"` - // The ID of an event based billing metric that will be attached to this component. - EventBasedBillingMetricId int `json:"event_based_billing_metric_id"` - // The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. - Interval *int `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". + Name string `json:"name"` + // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item + UnitName string `json:"unit_name"` + // A description for the component that will be displayed to the user on the hosted signup page. + Description *string `json:"description,omitempty"` + // 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 '_'. + Handle *string `json:"handle,omitempty"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. + Prices []Price `json:"prices,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + // 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 + UnitPrice *interface{} `json:"unit_price,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` + // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + // deprecated May 2011 - use unit_price instead + PriceInCents *string `json:"price_in_cents,omitempty"` + // The ID of an event based billing metric that will be attached to this component. + EventBasedBillingMetricId int `json:"event_based_billing_metric_id"` + // The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. + Interval *int `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for EBBComponent. +// MarshalJSON implements the json.Marshaler interface for EBBComponent. // It customizes the JSON marshaling process for EBBComponent objects. func (e *EBBComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EBBComponent object to a map representation for JSON marshaling. func (e *EBBComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = e.Name - structMap["unit_name"] = e.UnitName - if e.Description != nil { - structMap["description"] = e.Description - } - if e.Handle != nil { - structMap["handle"] = e.Handle - } - if e.Taxable != nil { - structMap["taxable"] = e.Taxable - } - structMap["pricing_scheme"] = e.PricingScheme - if e.Prices != nil { - structMap["prices"] = e.Prices - } - if e.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = e.UpgradeCharge.Value() - } - if e.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = e.DowngradeCredit.Value() - } - if e.PricePoints != nil { - structMap["price_points"] = e.PricePoints - } - if e.UnitPrice != nil { - structMap["unit_price"] = e.UnitPrice - } - if e.TaxCode != nil { - structMap["tax_code"] = e.TaxCode - } - if e.HideDateRangeOnInvoice != nil { - structMap["hide_date_range_on_invoice"] = e.HideDateRangeOnInvoice - } - if e.PriceInCents != nil { - structMap["price_in_cents"] = e.PriceInCents - } - structMap["event_based_billing_metric_id"] = e.EventBasedBillingMetricId - if e.Interval != nil { - structMap["interval"] = e.Interval - } - if e.IntervalUnit != nil { - structMap["interval_unit"] = e.IntervalUnit - } - return structMap + structMap := make(map[string]any) + structMap["name"] = e.Name + structMap["unit_name"] = e.UnitName + if e.Description != nil { + structMap["description"] = e.Description + } + if e.Handle != nil { + structMap["handle"] = e.Handle + } + if e.Taxable != nil { + structMap["taxable"] = e.Taxable + } + structMap["pricing_scheme"] = e.PricingScheme + if e.Prices != nil { + structMap["prices"] = e.Prices + } + if e.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = e.UpgradeCharge.Value() + } + if e.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = e.DowngradeCredit.Value() + } + if e.PricePoints != nil { + structMap["price_points"] = e.PricePoints + } + if e.UnitPrice != nil { + structMap["unit_price"] = e.UnitPrice + } + if e.TaxCode != nil { + structMap["tax_code"] = e.TaxCode + } + if e.HideDateRangeOnInvoice != nil { + structMap["hide_date_range_on_invoice"] = e.HideDateRangeOnInvoice + } + if e.PriceInCents != nil { + structMap["price_in_cents"] = e.PriceInCents + } + structMap["event_based_billing_metric_id"] = e.EventBasedBillingMetricId + if e.Interval != nil { + structMap["interval"] = e.Interval + } + if e.IntervalUnit != nil { + structMap["interval_unit"] = e.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EBBComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for EBBComponent. // It customizes the JSON unmarshaling process for EBBComponent objects. func (e *EBBComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - UnitName string `json:"unit_name"` - Description *string `json:"description,omitempty"` - Handle *string `json:"handle,omitempty"` - Taxable *bool `json:"taxable,omitempty"` - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []Price `json:"prices,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - PriceInCents *string `json:"price_in_cents,omitempty"` - EventBasedBillingMetricId int `json:"event_based_billing_metric_id"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Name = temp.Name - e.UnitName = temp.UnitName - e.Description = temp.Description - e.Handle = temp.Handle - e.Taxable = temp.Taxable - e.PricingScheme = temp.PricingScheme - e.Prices = temp.Prices - e.UpgradeCharge = temp.UpgradeCharge - e.DowngradeCredit = temp.DowngradeCredit - e.PricePoints = temp.PricePoints - e.UnitPrice = temp.UnitPrice - e.TaxCode = temp.TaxCode - e.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice - e.PriceInCents = temp.PriceInCents - e.EventBasedBillingMetricId = temp.EventBasedBillingMetricId - e.Interval = temp.Interval - e.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + Name string `json:"name"` + UnitName string `json:"unit_name"` + Description *string `json:"description,omitempty"` + Handle *string `json:"handle,omitempty"` + Taxable *bool `json:"taxable,omitempty"` + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []Price `json:"prices,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + PriceInCents *string `json:"price_in_cents,omitempty"` + EventBasedBillingMetricId int `json:"event_based_billing_metric_id"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Name = temp.Name + e.UnitName = temp.UnitName + e.Description = temp.Description + e.Handle = temp.Handle + e.Taxable = temp.Taxable + e.PricingScheme = temp.PricingScheme + e.Prices = temp.Prices + e.UpgradeCharge = temp.UpgradeCharge + e.DowngradeCredit = temp.DowngradeCredit + e.PricePoints = temp.PricePoints + e.UnitPrice = temp.UnitPrice + e.TaxCode = temp.TaxCode + e.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice + e.PriceInCents = temp.PriceInCents + e.EventBasedBillingMetricId = temp.EventBasedBillingMetricId + e.Interval = temp.Interval + e.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/ebb_event.go b/models/ebb_event.go index c4d167da..85fce699 100644 --- a/models/ebb_event.go +++ b/models/ebb_event.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // EBBEvent represents a EBBEvent struct. type EBBEvent struct { - Chargify *ChargifyEBB `json:"chargify,omitempty"` + Chargify *ChargifyEBB `json:"chargify,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for EBBEvent. +// MarshalJSON implements the json.Marshaler interface for EBBEvent. // It customizes the JSON marshaling process for EBBEvent objects. func (e *EBBEvent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EBBEvent object to a map representation for JSON marshaling. func (e *EBBEvent) toMap() map[string]any { - structMap := make(map[string]any) - if e.Chargify != nil { - structMap["chargify"] = e.Chargify - } - return structMap + structMap := make(map[string]any) + if e.Chargify != nil { + structMap["chargify"] = e.Chargify.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EBBEvent. +// UnmarshalJSON implements the json.Unmarshaler interface for EBBEvent. // It customizes the JSON unmarshaling process for EBBEvent objects. func (e *EBBEvent) UnmarshalJSON(input []byte) error { - temp := &struct { - Chargify *ChargifyEBB `json:"chargify,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Chargify = temp.Chargify - return nil + temp := &struct { + Chargify *ChargifyEBB `json:"chargify,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Chargify = temp.Chargify + return nil } diff --git a/models/enable_webhooks_request.go b/models/enable_webhooks_request.go index 1df64710..a38e98b4 100644 --- a/models/enable_webhooks_request.go +++ b/models/enable_webhooks_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // EnableWebhooksRequest represents a EnableWebhooksRequest struct. type EnableWebhooksRequest struct { - WebhooksEnabled bool `json:"webhooks_enabled"` + WebhooksEnabled bool `json:"webhooks_enabled"` } -// MarshalJSON implements the json.Marshaler interface for EnableWebhooksRequest. +// MarshalJSON implements the json.Marshaler interface for EnableWebhooksRequest. // It customizes the JSON marshaling process for EnableWebhooksRequest objects. func (e *EnableWebhooksRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EnableWebhooksRequest object to a map representation for JSON marshaling. func (e *EnableWebhooksRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["webhooks_enabled"] = e.WebhooksEnabled - return structMap + structMap := make(map[string]any) + structMap["webhooks_enabled"] = e.WebhooksEnabled + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksRequest. // It customizes the JSON unmarshaling process for EnableWebhooksRequest objects. func (e *EnableWebhooksRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - WebhooksEnabled bool `json:"webhooks_enabled"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.WebhooksEnabled = temp.WebhooksEnabled - return nil + temp := &struct { + WebhooksEnabled bool `json:"webhooks_enabled"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.WebhooksEnabled = temp.WebhooksEnabled + return nil } diff --git a/models/enable_webhooks_response.go b/models/enable_webhooks_response.go index 8541af39..bb0cc9ee 100644 --- a/models/enable_webhooks_response.go +++ b/models/enable_webhooks_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // EnableWebhooksResponse represents a EnableWebhooksResponse struct. type EnableWebhooksResponse struct { - WebhooksEnabled *bool `json:"webhooks_enabled,omitempty"` + WebhooksEnabled *bool `json:"webhooks_enabled,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for EnableWebhooksResponse. +// MarshalJSON implements the json.Marshaler interface for EnableWebhooksResponse. // It customizes the JSON marshaling process for EnableWebhooksResponse objects. func (e *EnableWebhooksResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EnableWebhooksResponse object to a map representation for JSON marshaling. func (e *EnableWebhooksResponse) toMap() map[string]any { - structMap := make(map[string]any) - if e.WebhooksEnabled != nil { - structMap["webhooks_enabled"] = e.WebhooksEnabled - } - return structMap + structMap := make(map[string]any) + if e.WebhooksEnabled != nil { + structMap["webhooks_enabled"] = e.WebhooksEnabled + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksResponse. // It customizes the JSON unmarshaling process for EnableWebhooksResponse objects. func (e *EnableWebhooksResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - WebhooksEnabled *bool `json:"webhooks_enabled,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.WebhooksEnabled = temp.WebhooksEnabled - return nil + temp := &struct { + WebhooksEnabled *bool `json:"webhooks_enabled,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.WebhooksEnabled = temp.WebhooksEnabled + return nil } diff --git a/models/endpoint.go b/models/endpoint.go index 0f0aed9b..41cbd59a 100644 --- a/models/endpoint.go +++ b/models/endpoint.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // Endpoint represents a Endpoint struct. type Endpoint struct { - Id *int `json:"id,omitempty"` - Url *string `json:"url,omitempty"` - SiteId *int `json:"site_id,omitempty"` - Status *string `json:"status,omitempty"` - WebhookSubscriptions []string `json:"webhook_subscriptions,omitempty"` + Id *int `json:"id,omitempty"` + Url *string `json:"url,omitempty"` + SiteId *int `json:"site_id,omitempty"` + Status *string `json:"status,omitempty"` + WebhookSubscriptions []string `json:"webhook_subscriptions,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Endpoint. +// MarshalJSON implements the json.Marshaler interface for Endpoint. // It customizes the JSON marshaling process for Endpoint objects. func (e *Endpoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the Endpoint object to a map representation for JSON marshaling. func (e *Endpoint) toMap() map[string]any { - structMap := make(map[string]any) - if e.Id != nil { - structMap["id"] = e.Id - } - if e.Url != nil { - structMap["url"] = e.Url - } - if e.SiteId != nil { - structMap["site_id"] = e.SiteId - } - if e.Status != nil { - structMap["status"] = e.Status - } - if e.WebhookSubscriptions != nil { - structMap["webhook_subscriptions"] = e.WebhookSubscriptions - } - return structMap + structMap := make(map[string]any) + if e.Id != nil { + structMap["id"] = e.Id + } + if e.Url != nil { + structMap["url"] = e.Url + } + if e.SiteId != nil { + structMap["site_id"] = e.SiteId + } + if e.Status != nil { + structMap["status"] = e.Status + } + if e.WebhookSubscriptions != nil { + structMap["webhook_subscriptions"] = e.WebhookSubscriptions + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Endpoint. +// UnmarshalJSON implements the json.Unmarshaler interface for Endpoint. // It customizes the JSON unmarshaling process for Endpoint objects. func (e *Endpoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Url *string `json:"url,omitempty"` - SiteId *int `json:"site_id,omitempty"` - Status *string `json:"status,omitempty"` - WebhookSubscriptions []string `json:"webhook_subscriptions,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Id = temp.Id - e.Url = temp.Url - e.SiteId = temp.SiteId - e.Status = temp.Status - e.WebhookSubscriptions = temp.WebhookSubscriptions - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Url *string `json:"url,omitempty"` + SiteId *int `json:"site_id,omitempty"` + Status *string `json:"status,omitempty"` + WebhookSubscriptions []string `json:"webhook_subscriptions,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Id = temp.Id + e.Url = temp.Url + e.SiteId = temp.SiteId + e.Status = temp.Status + e.WebhookSubscriptions = temp.WebhookSubscriptions + return nil } diff --git a/models/endpoint_response.go b/models/endpoint_response.go index f91ba67c..42052157 100644 --- a/models/endpoint_response.go +++ b/models/endpoint_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // EndpointResponse represents a EndpointResponse struct. type EndpointResponse struct { - Endpoint *Endpoint `json:"endpoint,omitempty"` + Endpoint *Endpoint `json:"endpoint,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for EndpointResponse. +// MarshalJSON implements the json.Marshaler interface for EndpointResponse. // It customizes the JSON marshaling process for EndpointResponse objects. func (e *EndpointResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EndpointResponse object to a map representation for JSON marshaling. func (e *EndpointResponse) toMap() map[string]any { - structMap := make(map[string]any) - if e.Endpoint != nil { - structMap["endpoint"] = e.Endpoint - } - return structMap + structMap := make(map[string]any) + if e.Endpoint != nil { + structMap["endpoint"] = e.Endpoint.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EndpointResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for EndpointResponse. // It customizes the JSON unmarshaling process for EndpointResponse objects. func (e *EndpointResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Endpoint *Endpoint `json:"endpoint,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Endpoint = temp.Endpoint - return nil + temp := &struct { + Endpoint *Endpoint `json:"endpoint,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Endpoint = temp.Endpoint + return nil } diff --git a/models/enums.go b/models/enums.go index ed7e2a49..de7234cb 100644 --- a/models/enums.go +++ b/models/enums.go @@ -1,899 +1,940 @@ -/* -Package advancedbilling - -This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). +/* +Package advancedbilling + +This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ package models -// WebhookStatus is a string enum. -type WebhookStatus string +// AllocationPreviewDirection is a string enum. +type AllocationPreviewDirection string const ( - WebhookStatus_SUCCESSFUL WebhookStatus = "successful" - WebhookStatus_FAILED WebhookStatus = "failed" - WebhookStatus_PENDING WebhookStatus = "pending" - WebhookStatus_PAUSED WebhookStatus = "paused" + AllocationPreviewDirection_UPGRADE AllocationPreviewDirection = "upgrade" + AllocationPreviewDirection_DOWNGRADE AllocationPreviewDirection = "downgrade" ) -// WebhookOrder is a string enum. -type WebhookOrder string +// AllocationPreviewLineItemKind is a string enum. +// A handle for the line item kind for allocation preview +type AllocationPreviewLineItemKind string const ( - WebhookOrder_NEWESTFIRST WebhookOrder = "newest_first" - WebhookOrder_OLDESTFIRST WebhookOrder = "oldest_first" + AllocationPreviewLineItemKind_QUANTITYBASEDCOMPONENT AllocationPreviewLineItemKind = "quantity_based_component" + AllocationPreviewLineItemKind_ONOFFCOMPONENT AllocationPreviewLineItemKind = "on_off_component" + AllocationPreviewLineItemKind_COUPON AllocationPreviewLineItemKind = "coupon" + AllocationPreviewLineItemKind_TAX AllocationPreviewLineItemKind = "tax" ) -// WebhookSubscription is a string enum. -type WebhookSubscription string +// AutoInvite is a int enum. +type AutoInvite int const ( - WebhookSubscription_BILLINGDATECHANGE WebhookSubscription = "billing_date_change" - WebhookSubscription_COMPONENTALLOCATIONCHANGE WebhookSubscription = "component_allocation_change" - WebhookSubscription_CUSTOMERCREATE WebhookSubscription = "customer_create" - WebhookSubscription_CUSTOMERUPDATE WebhookSubscription = "customer_update" - WebhookSubscription_DUNNINGSTEPREACHED WebhookSubscription = "dunning_step_reached" - WebhookSubscription_EXPIRINGCARD WebhookSubscription = "expiring_card" - WebhookSubscription_EXPIRATIONDATECHANGE WebhookSubscription = "expiration_date_change" - WebhookSubscription_INVOICEISSUED WebhookSubscription = "invoice_issued" - WebhookSubscription_METEREDUSAGE WebhookSubscription = "metered_usage" - WebhookSubscription_PAYMENTFAILURE WebhookSubscription = "payment_failure" - WebhookSubscription_PAYMENTSUCCESS WebhookSubscription = "payment_success" - WebhookSubscription_DIRECTDEBITPAYMENTPENDING WebhookSubscription = "direct_debit_payment_pending" - WebhookSubscription_DIRECTDEBITPAYMENTPAIDOUT WebhookSubscription = "direct_debit_payment_paid_out" - WebhookSubscription_DIRECTDEBITPAYMENTREJECTED WebhookSubscription = "direct_debit_payment_rejected" - WebhookSubscription_PREPAIDSUBSCRIPTIONBALANCECHANGED WebhookSubscription = "prepaid_subscription_balance_changed" - WebhookSubscription_PREPAIDUSAGE WebhookSubscription = "prepaid_usage" - WebhookSubscription_REFUNDFAILURE WebhookSubscription = "refund_failure" - WebhookSubscription_REFUNDSUCCESS WebhookSubscription = "refund_success" - WebhookSubscription_RENEWALFAILURE WebhookSubscription = "renewal_failure" - WebhookSubscription_RENEWALSUCCESS WebhookSubscription = "renewal_success" - WebhookSubscription_SIGNUPFAILURE WebhookSubscription = "signup_failure" - WebhookSubscription_SIGNUPSUCCESS WebhookSubscription = "signup_success" - WebhookSubscription_STATEMENTCLOSED WebhookSubscription = "statement_closed" - WebhookSubscription_STATEMENTSETTLED WebhookSubscription = "statement_settled" - WebhookSubscription_SUBSCRIPTIONCARDUPDATE WebhookSubscription = "subscription_card_update" - WebhookSubscription_SUBSCRIPTIONGROUPCARDUPDATE WebhookSubscription = "subscription_group_card_update" - WebhookSubscription_SUBSCRIPTIONPRODUCTCHANGE WebhookSubscription = "subscription_product_change" - WebhookSubscription_SUBSCRIPTIONSTATECHANGE WebhookSubscription = "subscription_state_change" - WebhookSubscription_TRIALENDNOTICE WebhookSubscription = "trial_end_notice" - WebhookSubscription_UPCOMINGRENEWALNOTICE WebhookSubscription = "upcoming_renewal_notice" - WebhookSubscription_UPGRADEDOWNGRADEFAILURE WebhookSubscription = "upgrade_downgrade_failure" - WebhookSubscription_UPGRADEDOWNGRADESUCCESS WebhookSubscription = "upgrade_downgrade_success" - WebhookSubscription_PENDINGCANCELLATIONCHANGE WebhookSubscription = "pending_cancellation_change" - WebhookSubscription_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED WebhookSubscription = "subscription_prepayment_account_balance_changed" - WebhookSubscription_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED WebhookSubscription = "subscription_service_credit_account_balance_changed" -) - -// CreditType is a string enum. -// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. -// Available values: `full`, `prorated`, `none`. -type CreditType string + AutoInvite_NO AutoInvite = 0 + AutoInvite_YES AutoInvite = 1 +) + +// BankAccountHolderType is a string enum. +// Defaults to personal +type BankAccountHolderType string const ( - CreditType_FULL CreditType = "full" - CreditType_PRORATED CreditType = "prorated" - CreditType_NONE CreditType = "none" + BankAccountHolderType_PERSONAL BankAccountHolderType = "personal" + BankAccountHolderType_BUSINESS BankAccountHolderType = "business" ) -// TaxConfigurationKind is a string enum. -type TaxConfigurationKind string +// BankAccountType is a string enum. +// Defaults to checking +type BankAccountType string const ( - TaxConfigurationKind_CUSTOM TaxConfigurationKind = "custom" - TaxConfigurationKind_ENUMMANAGEDAVALARA TaxConfigurationKind = "managed avalara" - TaxConfigurationKind_ENUMLINKEDAVALARA TaxConfigurationKind = "linked avalara" - TaxConfigurationKind_ENUMDIGITALRIVER TaxConfigurationKind = "digital river" + BankAccountType_CHECKING BankAccountType = "checking" + BankAccountType_SAVINGS BankAccountType = "savings" ) -// TaxDestinationAddress is a string enum. -type TaxDestinationAddress string +// BankAccountVault is a string enum. +// The vault that stores the payment profile with the provided vault_token. +type BankAccountVault string const ( - TaxDestinationAddress_SHIPPINGTHENBILLING TaxDestinationAddress = "shipping_then_billing" - TaxDestinationAddress_BILLINGTHENSHIPPING TaxDestinationAddress = "billing_then_shipping" - TaxDestinationAddress_SHIPPINGONLY TaxDestinationAddress = "shipping_only" - TaxDestinationAddress_BILLINGONLY TaxDestinationAddress = "billing_only" + BankAccountVault_BOGUS BankAccountVault = "bogus" + BankAccountVault_AUTHORIZENET BankAccountVault = "authorizenet" + BankAccountVault_STRIPECONNECT BankAccountVault = "stripe_connect" + BankAccountVault_BRAINTREEBLUE BankAccountVault = "braintree_blue" + BankAccountVault_GOCARDLESS BankAccountVault = "gocardless" ) -// CleanupScope is a string enum. -// all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0. -type CleanupScope string +// BasicDateField is a string enum. +// Allows to filter by `created_at` or `updated_at`. +type BasicDateField string const ( - CleanupScope_ALL CleanupScope = "all" - CleanupScope_CUSTOMERS CleanupScope = "customers" + BasicDateField_UPDATEDAT BasicDateField = "updated_at" + BasicDateField_CREATEDAT BasicDateField = "created_at" ) -// SortingDirection is a string enum. -// Used for sorting results. -type SortingDirection string +// BillingManifestLineItemKind is a string enum. +// A handle for the billing manifest line item kind +type BillingManifestLineItemKind string const ( - SortingDirection_ASC SortingDirection = "asc" - SortingDirection_DESC SortingDirection = "desc" + BillingManifestLineItemKind_BASELINE BillingManifestLineItemKind = "baseline" + BillingManifestLineItemKind_INITIAL BillingManifestLineItemKind = "initial" + BillingManifestLineItemKind_TRIAL BillingManifestLineItemKind = "trial" + BillingManifestLineItemKind_COUPON BillingManifestLineItemKind = "coupon" + BillingManifestLineItemKind_COMPONENT BillingManifestLineItemKind = "component" + BillingManifestLineItemKind_TAX BillingManifestLineItemKind = "tax" ) -// BasicDateField is a string enum. -// Allows to filter by `created_at` or `updated_at`. -type BasicDateField string +// CancellationMethod is a string enum. +// The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. +type CancellationMethod string const ( - BasicDateField_UPDATEDAT BasicDateField = "updated_at" - BasicDateField_CREATEDAT BasicDateField = "created_at" + CancellationMethod_MERCHANTUI CancellationMethod = "merchant_ui" + CancellationMethod_MERCHANTAPI CancellationMethod = "merchant_api" + CancellationMethod_DUNNING CancellationMethod = "dunning" + CancellationMethod_BILLINGPORTAL CancellationMethod = "billing_portal" + CancellationMethod_UNKNOWN CancellationMethod = "unknown" ) -// SubscriptionState is a string enum. -// 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. -// -// See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. -type SubscriptionState string +// CardType is a string enum. +// The type of card used. +type CardType string const ( - SubscriptionState_PENDING SubscriptionState = "pending" - SubscriptionState_FAILEDTOCREATE SubscriptionState = "failed_to_create" - SubscriptionState_TRIALING SubscriptionState = "trialing" - SubscriptionState_ASSESSING SubscriptionState = "assessing" - SubscriptionState_ACTIVE SubscriptionState = "active" - SubscriptionState_SOFTFAILURE SubscriptionState = "soft_failure" - SubscriptionState_PASTDUE SubscriptionState = "past_due" - SubscriptionState_SUSPENDED SubscriptionState = "suspended" - SubscriptionState_CANCELED SubscriptionState = "canceled" - SubscriptionState_EXPIRED SubscriptionState = "expired" - SubscriptionState_PAUSED SubscriptionState = "paused" - SubscriptionState_UNPAID SubscriptionState = "unpaid" - SubscriptionState_TRIALENDED SubscriptionState = "trial_ended" - SubscriptionState_ONHOLD SubscriptionState = "on_hold" - SubscriptionState_AWAITINGSIGNUP SubscriptionState = "awaiting_signup" -) - -// CancellationMethod is a string enum. -// The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. -type CancellationMethod string + CardType_VISA CardType = "visa" + CardType_MASTER CardType = "master" + CardType_ELO CardType = "elo" + CardType_CABAL CardType = "cabal" + CardType_ALELO CardType = "alelo" + CardType_DISCOVER CardType = "discover" + CardType_AMERICANEXPRESS CardType = "american_express" + CardType_NARANJA CardType = "naranja" + CardType_DINERSCLUB CardType = "diners_club" + CardType_JCB CardType = "jcb" + CardType_DANKORT CardType = "dankort" + CardType_MAESTRO CardType = "maestro" + CardType_MAESTRONOLUHN CardType = "maestro_no_luhn" + CardType_FORBRUGSFORENINGEN CardType = "forbrugsforeningen" + CardType_SODEXO CardType = "sodexo" + CardType_ALIA CardType = "alia" + CardType_VR CardType = "vr" + CardType_UNIONPAY CardType = "unionpay" + CardType_CARNET CardType = "carnet" + CardType_CARTESBANCAIRES CardType = "cartes_bancaires" + CardType_OLIMPICA CardType = "olimpica" + CardType_CREDITEL CardType = "creditel" + CardType_CONFIABLE CardType = "confiable" + CardType_SYNCHRONY CardType = "synchrony" + CardType_ROUTEX CardType = "routex" + CardType_MADA CardType = "mada" + CardType_BPPLUS CardType = "bp_plus" + CardType_PASSCARD CardType = "passcard" + CardType_EDENRED CardType = "edenred" + CardType_ANDA CardType = "anda" + CardType_TARJETAD CardType = "tarjeta-d" + CardType_HIPERCARD CardType = "hipercard" + CardType_BOGUS CardType = "bogus" + CardType_ENUMSWITCH CardType = "switch" + CardType_SOLO CardType = "solo" + CardType_LASER CardType = "laser" +) + +// CleanupScope is a string enum. +// all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0. +type CleanupScope string const ( - CancellationMethod_MERCHANTUI CancellationMethod = "merchant_ui" - CancellationMethod_MERCHANTAPI CancellationMethod = "merchant_api" - CancellationMethod_DUNNING CancellationMethod = "dunning" - CancellationMethod_BILLINGPORTAL CancellationMethod = "billing_portal" - CancellationMethod_UNKNOWN CancellationMethod = "unknown" + CleanupScope_ALL CleanupScope = "all" + CleanupScope_CUSTOMERS CleanupScope = "customers" ) -// PaymentCollectionMethod is a string enum. +// CollectionMethod is a string enum. // 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`. -type PaymentCollectionMethod string +type CollectionMethod string const ( - PaymentCollectionMethod_AUTOMATIC PaymentCollectionMethod = "automatic" - PaymentCollectionMethod_REMITTANCE PaymentCollectionMethod = "remittance" - PaymentCollectionMethod_PREPAID PaymentCollectionMethod = "prepaid" - PaymentCollectionMethod_INVOICE PaymentCollectionMethod = "invoice" + CollectionMethod_AUTOMATIC CollectionMethod = "automatic" + CollectionMethod_REMITTANCE CollectionMethod = "remittance" + CollectionMethod_PREPAID CollectionMethod = "prepaid" + CollectionMethod_INVOICE CollectionMethod = "invoice" ) -// ExtendedIntervalUnit is a string enum. -type ExtendedIntervalUnit string +// ComponentKind is a string enum. +// A handle for the component type +type ComponentKind string const ( - ExtendedIntervalUnit_DAY ExtendedIntervalUnit = "day" - ExtendedIntervalUnit_MONTH ExtendedIntervalUnit = "month" - ExtendedIntervalUnit_NEVER ExtendedIntervalUnit = "never" + ComponentKind_METEREDCOMPONENT ComponentKind = "metered_component" + ComponentKind_QUANTITYBASEDCOMPONENT ComponentKind = "quantity_based_component" + ComponentKind_ONOFFCOMPONENT ComponentKind = "on_off_component" + ComponentKind_PREPAIDUSAGECOMPONENT ComponentKind = "prepaid_usage_component" + ComponentKind_EVENTBASEDCOMPONENT ComponentKind = "event_based_component" ) -// IntervalUnit is a string enum. -type IntervalUnit string +// CompoundingStrategy is a string enum. +type CompoundingStrategy string const ( - IntervalUnit_DAY IntervalUnit = "day" - IntervalUnit_MONTH IntervalUnit = "month" + CompoundingStrategy_COMPOUND CompoundingStrategy = "compound" + CompoundingStrategy_FULLPRICE CompoundingStrategy = "full-price" ) -// CardType is a string enum. -// The type of card used. -type CardType string - -const ( - CardType_VISA CardType = "visa" - CardType_MASTER CardType = "master" - CardType_ELO CardType = "elo" - CardType_CABAL CardType = "cabal" - CardType_ALELO CardType = "alelo" - CardType_DISCOVER CardType = "discover" - CardType_AMERICANEXPRESS CardType = "american_express" - CardType_NARANJA CardType = "naranja" - CardType_DINERSCLUB CardType = "diners_club" - CardType_JCB CardType = "jcb" - CardType_DANKORT CardType = "dankort" - CardType_MAESTRO CardType = "maestro" - CardType_MAESTRONOLUHN CardType = "maestro_no_luhn" - CardType_FORBRUGSFORENINGEN CardType = "forbrugsforeningen" - CardType_SODEXO CardType = "sodexo" - CardType_ALIA CardType = "alia" - CardType_VR CardType = "vr" - CardType_UNIONPAY CardType = "unionpay" - CardType_CARNET CardType = "carnet" - CardType_CARTESBANCAIRES CardType = "cartes_bancaires" - CardType_OLIMPICA CardType = "olimpica" - CardType_CREDITEL CardType = "creditel" - CardType_CONFIABLE CardType = "confiable" - CardType_SYNCHRONY CardType = "synchrony" - CardType_ROUTEX CardType = "routex" - CardType_MADA CardType = "mada" - CardType_BPPLUS CardType = "bp_plus" - CardType_PASSCARD CardType = "passcard" - CardType_EDENRED CardType = "edenred" - CardType_ANDA CardType = "anda" - CardType_TARJETAD CardType = "tarjeta-d" - CardType_HIPERCARD CardType = "hipercard" - CardType_BOGUS CardType = "bogus" - CardType_ENUMSWITCH CardType = "switch" - CardType_SOLO CardType = "solo" - CardType_LASER CardType = "laser" -) - -// CurrentVault is a string enum. -// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. -type CurrentVault string +// CreateInvoiceStatus is a string enum. +type CreateInvoiceStatus string const ( - CurrentVault_ADYEN CurrentVault = "adyen" - CurrentVault_AUTHORIZENET CurrentVault = "authorizenet" - CurrentVault_AVALARA CurrentVault = "avalara" - CurrentVault_BEANSTREAM CurrentVault = "beanstream" - CurrentVault_BLUESNAP CurrentVault = "blue_snap" - CurrentVault_BOGUS CurrentVault = "bogus" - CurrentVault_BRAINTREEBLUE CurrentVault = "braintree_blue" - CurrentVault_CHECKOUT CurrentVault = "checkout" - CurrentVault_CYBERSOURCE CurrentVault = "cybersource" - CurrentVault_ELAVON CurrentVault = "elavon" - CurrentVault_EWAY CurrentVault = "eway" - CurrentVault_EWAYRAPIDSTD CurrentVault = "eway_rapid_std" - CurrentVault_FIRSTDATA CurrentVault = "firstdata" - CurrentVault_FORTE CurrentVault = "forte" - CurrentVault_GOCARDLESS CurrentVault = "gocardless" - CurrentVault_LITLE CurrentVault = "litle" - CurrentVault_MAXIOPAYMENTS CurrentVault = "maxio_payments" - CurrentVault_MODUSLINK CurrentVault = "moduslink" - CurrentVault_MONERIS CurrentVault = "moneris" - CurrentVault_NMI CurrentVault = "nmi" - CurrentVault_ORBITAL CurrentVault = "orbital" - CurrentVault_PAYMENTEXPRESS CurrentVault = "payment_express" - CurrentVault_PIN CurrentVault = "pin" - CurrentVault_SQUARE CurrentVault = "square" - CurrentVault_STRIPECONNECT CurrentVault = "stripe_connect" - CurrentVault_TRUSTCOMMERCE CurrentVault = "trust_commerce" - CurrentVault_UNIPAAS CurrentVault = "unipaas" + CreateInvoiceStatus_DRAFT CreateInvoiceStatus = "draft" + CreateInvoiceStatus_OPEN CreateInvoiceStatus = "open" ) -// PaymentType is a string enum. -type PaymentType string +// CreditNoteStatus is a string enum. +// Current status of the credit note. +type CreditNoteStatus string const ( - PaymentType_CREDITCARD PaymentType = "credit_card" - PaymentType_BANKACCOUNT PaymentType = "bank_account" - PaymentType_PAYPALACCOUNT PaymentType = "paypal_account" + CreditNoteStatus_OPEN CreditNoteStatus = "open" + CreditNoteStatus_APPLIED CreditNoteStatus = "applied" ) -// BankAccountVault is a string enum. -// The vault that stores the payment profile with the provided vault_token. -type BankAccountVault string +// CreditScheme is a string enum. +type CreditScheme string const ( - BankAccountVault_BOGUS BankAccountVault = "bogus" - BankAccountVault_AUTHORIZENET BankAccountVault = "authorizenet" - BankAccountVault_STRIPECONNECT BankAccountVault = "stripe_connect" - BankAccountVault_BRAINTREEBLUE BankAccountVault = "braintree_blue" - BankAccountVault_GOCARDLESS BankAccountVault = "gocardless" + CreditScheme_NONE CreditScheme = "none" + CreditScheme_CREDIT CreditScheme = "credit" + CreditScheme_REFUND CreditScheme = "refund" ) -// BankAccountType is a string enum. -// Defaults to checking -type BankAccountType string +// CreditType is a string enum. +// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. +// Available values: `full`, `prorated`, `none`. +type CreditType string const ( - BankAccountType_CHECKING BankAccountType = "checking" - BankAccountType_SAVINGS BankAccountType = "savings" + CreditType_FULL CreditType = "full" + CreditType_PRORATED CreditType = "prorated" + CreditType_NONE CreditType = "none" ) -// BankAccountHolderType is a string enum. -// Defaults to personal -type BankAccountHolderType string +// CurrencyPriceRole is a string enum. +// Role for the price. +type CurrencyPriceRole string const ( - BankAccountHolderType_PERSONAL BankAccountHolderType = "personal" - BankAccountHolderType_BUSINESS BankAccountHolderType = "business" + CurrencyPriceRole_BASELINE CurrencyPriceRole = "baseline" + CurrencyPriceRole_TRIAL CurrencyPriceRole = "trial" + CurrencyPriceRole_INITIAL CurrencyPriceRole = "initial" ) -// PricePointType is a string enum. -// 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. -type PricePointType string +// CurrentVault is a string enum. +// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. +type CurrentVault string const ( - PricePointType_CATALOG PricePointType = "catalog" - PricePointType_ENUMDEFAULT PricePointType = "default" - PricePointType_CUSTOM PricePointType = "custom" + CurrentVault_ADYEN CurrentVault = "adyen" + CurrentVault_AUTHORIZENET CurrentVault = "authorizenet" + CurrentVault_AVALARA CurrentVault = "avalara" + CurrentVault_BEANSTREAM CurrentVault = "beanstream" + CurrentVault_BLUESNAP CurrentVault = "blue_snap" + CurrentVault_BOGUS CurrentVault = "bogus" + CurrentVault_BRAINTREEBLUE CurrentVault = "braintree_blue" + CurrentVault_CHECKOUT CurrentVault = "checkout" + CurrentVault_CYBERSOURCE CurrentVault = "cybersource" + CurrentVault_ELAVON CurrentVault = "elavon" + CurrentVault_EWAY CurrentVault = "eway" + CurrentVault_EWAYRAPIDSTD CurrentVault = "eway_rapid_std" + CurrentVault_FIRSTDATA CurrentVault = "firstdata" + CurrentVault_FORTE CurrentVault = "forte" + CurrentVault_GOCARDLESS CurrentVault = "gocardless" + CurrentVault_LITLE CurrentVault = "litle" + CurrentVault_MAXIOPAYMENTS CurrentVault = "maxio_payments" + CurrentVault_MODUSLINK CurrentVault = "moduslink" + CurrentVault_MONERIS CurrentVault = "moneris" + CurrentVault_NMI CurrentVault = "nmi" + CurrentVault_ORBITAL CurrentVault = "orbital" + CurrentVault_PAYMENTEXPRESS CurrentVault = "payment_express" + CurrentVault_PIN CurrentVault = "pin" + CurrentVault_SQUARE CurrentVault = "square" + CurrentVault_STRIPECONNECT CurrentVault = "stripe_connect" + CurrentVault_TRUSTCOMMERCE CurrentVault = "trust_commerce" + CurrentVault_UNIPAAS CurrentVault = "unipaas" +) + +// CustomFieldOwner is a string enum. +type CustomFieldOwner string + +const ( + CustomFieldOwner_CUSTOMER CustomFieldOwner = "Customer" + CustomFieldOwner_SUBSCRIPTION CustomFieldOwner = "Subscription" ) -// AutoInvite is a int enum. -type AutoInvite int +// Direction is a string enum. +type Direction string const ( - AutoInvite_NO AutoInvite = 0 - AutoInvite_YES AutoInvite = 1 + Direction_ASC Direction = "asc" + Direction_DESC Direction = "desc" ) -// ResourceType is a string enum. -type ResourceType string +// DiscountType is a string enum. +type DiscountType string const ( - ResourceType_SUBSCRIPTIONS ResourceType = "subscriptions" - ResourceType_CUSTOMERS ResourceType = "customers" + DiscountType_AMOUNT DiscountType = "amount" + DiscountType_PERCENT DiscountType = "percent" ) -// IncludeOption is a string enum. -type IncludeOption string +// EventType is a string enum. +type EventType string const ( - IncludeOption_EXCLUDE IncludeOption = "0" - IncludeOption_INCLUDE IncludeOption = "1" + EventType_ACCOUNTTRANSACTIONCHANGED EventType = "account_transaction_changed" + EventType_BILLINGDATECHANGE EventType = "billing_date_change" + EventType_COMPONENTALLOCATIONCHANGE EventType = "component_allocation_change" + EventType_CUSTOMERUPDATE EventType = "customer_update" + EventType_CUSTOMERCREATE EventType = "customer_create" + EventType_DUNNINGSTEPREACHED EventType = "dunning_step_reached" + EventType_EXPIRATIONDATECHANGE EventType = "expiration_date_change" + EventType_EXPIRINGCARD EventType = "expiring_card" + EventType_METEREDUSAGE EventType = "metered_usage" + EventType_PAYMENTSUCCESS EventType = "payment_success" + EventType_PAYMENTSUCCESSRECREATED EventType = "payment_success_recreated" + EventType_PAYMENTFAILURE EventType = "payment_failure" + EventType_PAYMENTFAILURERECREATED EventType = "payment_failure_recreated" + EventType_REFUNDFAILURE EventType = "refund_failure" + EventType_REFUNDSUCCESS EventType = "refund_success" + EventType_RENEWALSUCCESS EventType = "renewal_success" + EventType_RENEWALSUCCESSRECREATED EventType = "renewal_success_recreated" + EventType_RENEWALFAILURE EventType = "renewal_failure" + EventType_SIGNUPSUCCESS EventType = "signup_success" + EventType_SIGNUPFAILURE EventType = "signup_failure" + EventType_STATEMENTCLOSED EventType = "statement_closed" + EventType_STATEMENTSETTLED EventType = "statement_settled" + EventType_SUBSCRIPTIONBANKACCOUNTUPDATE EventType = "subscription_bank_account_update" + EventType_SUBSCRIPTIONDELETION EventType = "subscription_deletion" + EventType_SUBSCRIPTIONPAYPALACCOUNTUPDATE EventType = "subscription_paypal_account_update" + EventType_SUBSCRIPTIONPRODUCTCHANGE EventType = "subscription_product_change" + EventType_SUBSCRIPTIONSTATECHANGE EventType = "subscription_state_change" + EventType_TRIALENDNOTICE EventType = "trial_end_notice" + EventType_UPGRADEDOWNGRADESUCCESS EventType = "upgrade_downgrade_success" + EventType_UPGRADEDOWNGRADEFAILURE EventType = "upgrade_downgrade_failure" + EventType_UPCOMINGRENEWALNOTICE EventType = "upcoming_renewal_notice" + EventType_CUSTOMFIELDVALUECHANGE EventType = "custom_field_value_change" + EventType_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED EventType = "subscription_prepayment_account_balance_changed" + EventType_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED EventType = "subscription_service_credit_account_balance_changed" ) -// CompoundingStrategy is a string enum. -type CompoundingStrategy string +// ExtendedIntervalUnit is a string enum. +type ExtendedIntervalUnit string const ( - CompoundingStrategy_COMPOUND CompoundingStrategy = "compound" - CompoundingStrategy_FULLPRICE CompoundingStrategy = "full-price" + ExtendedIntervalUnit_DAY ExtendedIntervalUnit = "day" + ExtendedIntervalUnit_MONTH ExtendedIntervalUnit = "month" + ExtendedIntervalUnit_NEVER ExtendedIntervalUnit = "never" ) -// RecurringScheme is a string enum. -type RecurringScheme string +// FailedPaymentAction is a string enum. +// 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). +type FailedPaymentAction string const ( - RecurringScheme_DONOTRECUR RecurringScheme = "do_not_recur" - RecurringScheme_RECURINDEFINITELY RecurringScheme = "recur_indefinitely" - RecurringScheme_RECURWITHDURATION RecurringScheme = "recur_with_duration" + FailedPaymentAction_LEAVEOPENINVOICE FailedPaymentAction = "leave_open_invoice" + FailedPaymentAction_ROLLBACKTOPENDING FailedPaymentAction = "rollback_to_pending" + FailedPaymentAction_INITIATEDUNNING FailedPaymentAction = "initiate_dunning" ) -// DiscountType is a string enum. -type DiscountType string +// FirstChargeType is a string enum. +type FirstChargeType string const ( - DiscountType_AMOUNT DiscountType = "amount" - DiscountType_PERCENT DiscountType = "percent" + FirstChargeType_PRORATED FirstChargeType = "prorated" + FirstChargeType_IMMEDIATE FirstChargeType = "immediate" + FirstChargeType_DELAYED FirstChargeType = "delayed" ) -// RestrictionType is a string enum. -type RestrictionType string +// GroupTargetType is a string enum. +// The type of object indicated by the id attribute. +type GroupTargetType string const ( - RestrictionType_COMPONENT RestrictionType = "Component" - RestrictionType_PRODUCT RestrictionType = "Product" + GroupTargetType_CUSTOMER GroupTargetType = "customer" + GroupTargetType_SUBSCRIPTION GroupTargetType = "subscription" + GroupTargetType_SELF GroupTargetType = "self" + GroupTargetType_PARENT GroupTargetType = "parent" + GroupTargetType_ELDEST GroupTargetType = "eldest" ) -// Direction is a string enum. -type Direction string +// IncludeNotNull is a string enum. +// Passed as a parameter to list methods to return only non null values. +type IncludeNotNull string const ( - Direction_ASC Direction = "asc" - Direction_DESC Direction = "desc" + IncludeNotNull_NOTNULL IncludeNotNull = "not_null" ) -// EventType is a string enum. -type EventType string +// IncludeOption is a string enum. +type IncludeOption string const ( - EventType_ACCOUNTTRANSACTIONCHANGED EventType = "account_transaction_changed" - EventType_BILLINGDATECHANGE EventType = "billing_date_change" - EventType_COMPONENTALLOCATIONCHANGE EventType = "component_allocation_change" - EventType_CUSTOMERUPDATE EventType = "customer_update" - EventType_CUSTOMERCREATE EventType = "customer_create" - EventType_DUNNINGSTEPREACHED EventType = "dunning_step_reached" - EventType_EXPIRATIONDATECHANGE EventType = "expiration_date_change" - EventType_EXPIRINGCARD EventType = "expiring_card" - EventType_METEREDUSAGE EventType = "metered_usage" - EventType_PAYMENTSUCCESS EventType = "payment_success" - EventType_PAYMENTSUCCESSRECREATED EventType = "payment_success_recreated" - EventType_PAYMENTFAILURE EventType = "payment_failure" - EventType_PAYMENTFAILURERECREATED EventType = "payment_failure_recreated" - EventType_REFUNDFAILURE EventType = "refund_failure" - EventType_REFUNDSUCCESS EventType = "refund_success" - EventType_RENEWALSUCCESS EventType = "renewal_success" - EventType_RENEWALSUCCESSRECREATED EventType = "renewal_success_recreated" - EventType_RENEWALFAILURE EventType = "renewal_failure" - EventType_SIGNUPSUCCESS EventType = "signup_success" - EventType_SIGNUPFAILURE EventType = "signup_failure" - EventType_STATEMENTCLOSED EventType = "statement_closed" - EventType_STATEMENTSETTLED EventType = "statement_settled" - EventType_SUBSCRIPTIONBANKACCOUNTUPDATE EventType = "subscription_bank_account_update" - EventType_SUBSCRIPTIONDELETION EventType = "subscription_deletion" - EventType_SUBSCRIPTIONPAYPALACCOUNTUPDATE EventType = "subscription_paypal_account_update" - EventType_SUBSCRIPTIONPRODUCTCHANGE EventType = "subscription_product_change" - EventType_SUBSCRIPTIONSTATECHANGE EventType = "subscription_state_change" - EventType_TRIALENDNOTICE EventType = "trial_end_notice" - EventType_UPGRADEDOWNGRADESUCCESS EventType = "upgrade_downgrade_success" - EventType_UPGRADEDOWNGRADEFAILURE EventType = "upgrade_downgrade_failure" - EventType_UPCOMINGRENEWALNOTICE EventType = "upcoming_renewal_notice" - EventType_CUSTOMFIELDVALUECHANGE EventType = "custom_field_value_change" - EventType_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED EventType = "subscription_prepayment_account_balance_changed" - EventType_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED EventType = "subscription_service_credit_account_balance_changed" + IncludeOption_EXCLUDE IncludeOption = "0" + IncludeOption_INCLUDE IncludeOption = "1" ) -// ListEventsDateField is a string enum. -type ListEventsDateField string +// IntervalUnit is a string enum. +type IntervalUnit string const ( - ListEventsDateField_CREATEDAT ListEventsDateField = "created_at" + IntervalUnit_DAY IntervalUnit = "day" + IntervalUnit_MONTH IntervalUnit = "month" ) -// PricingScheme is a string enum. -// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. -type PricingScheme string +// InvoiceConsolidationLevel is a string enum. +// 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). +type InvoiceConsolidationLevel string const ( - PricingScheme_STAIRSTEP PricingScheme = "stairstep" - PricingScheme_VOLUME PricingScheme = "volume" - PricingScheme_PERUNIT PricingScheme = "per_unit" - PricingScheme_TIERED PricingScheme = "tiered" + InvoiceConsolidationLevel_NONE InvoiceConsolidationLevel = "none" + InvoiceConsolidationLevel_CHILD InvoiceConsolidationLevel = "child" + InvoiceConsolidationLevel_PARENT InvoiceConsolidationLevel = "parent" ) -// FirstChargeType is a string enum. -type FirstChargeType string +// InvoiceDateField is a string enum. +type InvoiceDateField string const ( - FirstChargeType_PRORATED FirstChargeType = "prorated" - FirstChargeType_IMMEDIATE FirstChargeType = "immediate" - FirstChargeType_DELAYED FirstChargeType = "delayed" + InvoiceDateField_CREATEDAT InvoiceDateField = "created_at" + InvoiceDateField_DUEDATE InvoiceDateField = "due_date" + InvoiceDateField_ISSUEDATE InvoiceDateField = "issue_date" + InvoiceDateField_UPDATEDAT InvoiceDateField = "updated_at" + InvoiceDateField_PAIDDATE InvoiceDateField = "paid_date" ) -// ComponentKind is a string enum. -// A handle for the component type -type ComponentKind string +// InvoiceEventPaymentMethod is a string enum. +type InvoiceEventPaymentMethod string const ( - ComponentKind_METEREDCOMPONENT ComponentKind = "metered_component" - ComponentKind_QUANTITYBASEDCOMPONENT ComponentKind = "quantity_based_component" - ComponentKind_ONOFFCOMPONENT ComponentKind = "on_off_component" - ComponentKind_PREPAIDUSAGECOMPONENT ComponentKind = "prepaid_usage_component" - ComponentKind_EVENTBASEDCOMPONENT ComponentKind = "event_based_component" + InvoiceEventPaymentMethod_APPLEPAY InvoiceEventPaymentMethod = "apple_pay" + InvoiceEventPaymentMethod_BANKACCOUNT InvoiceEventPaymentMethod = "bank_account" + InvoiceEventPaymentMethod_CREDITCARD InvoiceEventPaymentMethod = "credit_card" + InvoiceEventPaymentMethod_EXTERNAL InvoiceEventPaymentMethod = "external" + InvoiceEventPaymentMethod_PAYPALACCOUNT InvoiceEventPaymentMethod = "paypal_account" ) -// ItemCategory is a string enum. -// One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other -type ItemCategory string +// InvoiceEventType is a string enum. +// Invoice Event Type +type InvoiceEventType string const ( - ItemCategory_ENUMBUSINESSSOFTWARE ItemCategory = "Business Software" - ItemCategory_ENUMCONSUMERSOFTWARE ItemCategory = "Consumer Software" - ItemCategory_ENUMDIGITALSERVICES ItemCategory = "Digital Services" - ItemCategory_ENUMPHYSICALGOODS ItemCategory = "Physical Goods" - ItemCategory_OTHER ItemCategory = "Other" + InvoiceEventType_ISSUEINVOICE InvoiceEventType = "issue_invoice" + InvoiceEventType_APPLYCREDITNOTE InvoiceEventType = "apply_credit_note" + InvoiceEventType_CREATECREDITNOTE InvoiceEventType = "create_credit_note" + InvoiceEventType_APPLYPAYMENT InvoiceEventType = "apply_payment" + InvoiceEventType_APPLYDEBITNOTE InvoiceEventType = "apply_debit_note" + InvoiceEventType_REFUNDINVOICE InvoiceEventType = "refund_invoice" + InvoiceEventType_VOIDINVOICE InvoiceEventType = "void_invoice" + InvoiceEventType_VOIDREMAINDER InvoiceEventType = "void_remainder" + InvoiceEventType_BACKPORTINVOICE InvoiceEventType = "backport_invoice" + InvoiceEventType_CHANGEINVOICESTATUS InvoiceEventType = "change_invoice_status" + InvoiceEventType_CHANGEINVOICECOLLECTIONMETHOD InvoiceEventType = "change_invoice_collection_method" + InvoiceEventType_REMOVEPAYMENT InvoiceEventType = "remove_payment" + InvoiceEventType_FAILEDPAYMENT InvoiceEventType = "failed_payment" + InvoiceEventType_CHANGECHARGEBACKSTATUS InvoiceEventType = "change_chargeback_status" +) + +// InvoicePaymentMethodType is a string enum. +// The type of payment method used. Defaults to other. +type InvoicePaymentMethodType string + +const ( + InvoicePaymentMethodType_CREDITCARD InvoicePaymentMethodType = "credit_card" + InvoicePaymentMethodType_CHECK InvoicePaymentMethodType = "check" + InvoicePaymentMethodType_CASH InvoicePaymentMethodType = "cash" + InvoicePaymentMethodType_MONEYORDER InvoicePaymentMethodType = "money_order" + InvoicePaymentMethodType_ACH InvoicePaymentMethodType = "ach" + InvoicePaymentMethodType_OTHER InvoicePaymentMethodType = "other" ) -// ListProductsInclude is a string enum. -type ListProductsInclude string +// InvoicePaymentType is a string enum. +// The type of payment to be applied to an Invoice. Defaults to external. +type InvoicePaymentType string const ( - ListProductsInclude_PREPAIDPRODUCTPRICEPOINT ListProductsInclude = "prepaid_product_price_point" + InvoicePaymentType_EXTERNAL InvoicePaymentType = "external" + InvoicePaymentType_PREPAYMENT InvoicePaymentType = "prepayment" + InvoicePaymentType_SERVICECREDIT InvoicePaymentType = "service_credit" + InvoicePaymentType_PAYMENT InvoicePaymentType = "payment" ) -// IncludeNotNull is a string enum. -// Passed as a parameter to list methods to return only non null values. -type IncludeNotNull string +// InvoiceRole is a string enum. +type InvoiceRole string const ( - IncludeNotNull_NOTNULL IncludeNotNull = "not_null" + InvoiceRole_UNSET InvoiceRole = "unset" + InvoiceRole_SIGNUP InvoiceRole = "signup" + InvoiceRole_RENEWAL InvoiceRole = "renewal" + InvoiceRole_USAGE InvoiceRole = "usage" + InvoiceRole_REACTIVATION InvoiceRole = "reactivation" + InvoiceRole_PRORATION InvoiceRole = "proration" + InvoiceRole_MIGRATION InvoiceRole = "migration" + InvoiceRole_ADHOC InvoiceRole = "adhoc" + InvoiceRole_BACKPORT InvoiceRole = "backport" + InvoiceRole_BACKPORTBALANCERECONCILIATION InvoiceRole = "backport-balance-reconciliation" ) -// CurrencyPriceRole is a string enum. -// Role for the price. -type CurrencyPriceRole string +// InvoiceSortField is a string enum. +type InvoiceSortField string const ( - CurrencyPriceRole_BASELINE CurrencyPriceRole = "baseline" - CurrencyPriceRole_TRIAL CurrencyPriceRole = "trial" - CurrencyPriceRole_INITIAL CurrencyPriceRole = "initial" + InvoiceSortField_STATUS InvoiceSortField = "status" + InvoiceSortField_TOTALAMOUNT InvoiceSortField = "total_amount" + InvoiceSortField_DUEAMOUNT InvoiceSortField = "due_amount" + InvoiceSortField_CREATEDAT InvoiceSortField = "created_at" + InvoiceSortField_UPDATEDAT InvoiceSortField = "updated_at" + InvoiceSortField_ISSUEDATE InvoiceSortField = "issue_date" + InvoiceSortField_DUEDATE InvoiceSortField = "due_date" + InvoiceSortField_NUMBER InvoiceSortField = "number" ) -// InvoiceStatus is a string enum. +// InvoiceStatus is a string enum. // The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. type InvoiceStatus string const ( - InvoiceStatus_DRAFT InvoiceStatus = "draft" - InvoiceStatus_OPEN InvoiceStatus = "open" - InvoiceStatus_PAID InvoiceStatus = "paid" - InvoiceStatus_PENDING InvoiceStatus = "pending" - InvoiceStatus_VOIDED InvoiceStatus = "voided" - InvoiceStatus_CANCELED InvoiceStatus = "canceled" + InvoiceStatus_DRAFT InvoiceStatus = "draft" + InvoiceStatus_OPEN InvoiceStatus = "open" + InvoiceStatus_PAID InvoiceStatus = "paid" + InvoiceStatus_PENDING InvoiceStatus = "pending" + InvoiceStatus_VOIDED InvoiceStatus = "voided" + InvoiceStatus_CANCELED InvoiceStatus = "canceled" ) -// InvoiceConsolidationLevel is a string enum. -// 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). -type InvoiceConsolidationLevel string +// ItemCategory is a string enum. +// One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other +type ItemCategory string const ( - InvoiceConsolidationLevel_NONE InvoiceConsolidationLevel = "none" - InvoiceConsolidationLevel_CHILD InvoiceConsolidationLevel = "child" - InvoiceConsolidationLevel_PARENT InvoiceConsolidationLevel = "parent" + ItemCategory_ENUMBUSINESSSOFTWARE ItemCategory = "Business Software" + ItemCategory_ENUMCONSUMERSOFTWARE ItemCategory = "Consumer Software" + ItemCategory_ENUMDIGITALSERVICES ItemCategory = "Digital Services" + ItemCategory_ENUMPHYSICALGOODS ItemCategory = "Physical Goods" + ItemCategory_OTHER ItemCategory = "Other" ) -// InvoiceDateField is a string enum. -type InvoiceDateField string +// LineItemKind is a string enum. +// A handle for the line item kind +type LineItemKind string const ( - InvoiceDateField_CREATEDAT InvoiceDateField = "created_at" - InvoiceDateField_DUEDATE InvoiceDateField = "due_date" - InvoiceDateField_ISSUEDATE InvoiceDateField = "issue_date" - InvoiceDateField_UPDATEDAT InvoiceDateField = "updated_at" - InvoiceDateField_PAIDDATE InvoiceDateField = "paid_date" + LineItemKind_BASELINE LineItemKind = "baseline" + LineItemKind_INITIAL LineItemKind = "initial" + LineItemKind_TRIAL LineItemKind = "trial" + LineItemKind_QUANTITYBASEDCOMPONENT LineItemKind = "quantity_based_component" + LineItemKind_PREPAIDUSAGECOMPONENT LineItemKind = "prepaid_usage_component" + LineItemKind_ONOFFCOMPONENT LineItemKind = "on_off_component" + LineItemKind_METEREDCOMPONENT LineItemKind = "metered_component" + LineItemKind_EVENTBASEDCOMPONENT LineItemKind = "event_based_component" + LineItemKind_COUPON LineItemKind = "coupon" + LineItemKind_TAX LineItemKind = "tax" ) -// InvoiceSortField is a string enum. -type InvoiceSortField string +// LineItemTransactionType is a string enum. +// A handle for the line item transaction type +type LineItemTransactionType string const ( - InvoiceSortField_STATUS InvoiceSortField = "status" - InvoiceSortField_TOTALAMOUNT InvoiceSortField = "total_amount" - InvoiceSortField_DUEAMOUNT InvoiceSortField = "due_amount" - InvoiceSortField_CREATEDAT InvoiceSortField = "created_at" - InvoiceSortField_UPDATEDAT InvoiceSortField = "updated_at" - InvoiceSortField_ISSUEDATE InvoiceSortField = "issue_date" - InvoiceSortField_DUEDATE InvoiceSortField = "due_date" - InvoiceSortField_NUMBER InvoiceSortField = "number" + LineItemTransactionType_CHARGE LineItemTransactionType = "charge" + LineItemTransactionType_CREDIT LineItemTransactionType = "credit" + LineItemTransactionType_ADJUSTMENT LineItemTransactionType = "adjustment" + LineItemTransactionType_PAYMENT LineItemTransactionType = "payment" + LineItemTransactionType_REFUND LineItemTransactionType = "refund" + LineItemTransactionType_INFOTRANSACTION LineItemTransactionType = "info_transaction" + LineItemTransactionType_PAYMENTAUTHORIZATION LineItemTransactionType = "payment_authorization" ) -// InvoiceEventType is a string enum. -// Invoice Event Type -type InvoiceEventType string - -const ( - InvoiceEventType_ISSUEINVOICE InvoiceEventType = "issue_invoice" - InvoiceEventType_APPLYCREDITNOTE InvoiceEventType = "apply_credit_note" - InvoiceEventType_CREATECREDITNOTE InvoiceEventType = "create_credit_note" - InvoiceEventType_APPLYPAYMENT InvoiceEventType = "apply_payment" - InvoiceEventType_APPLYDEBITNOTE InvoiceEventType = "apply_debit_note" - InvoiceEventType_REFUNDINVOICE InvoiceEventType = "refund_invoice" - InvoiceEventType_VOIDINVOICE InvoiceEventType = "void_invoice" - InvoiceEventType_VOIDREMAINDER InvoiceEventType = "void_remainder" - InvoiceEventType_BACKPORTINVOICE InvoiceEventType = "backport_invoice" - InvoiceEventType_CHANGEINVOICESTATUS InvoiceEventType = "change_invoice_status" - InvoiceEventType_CHANGEINVOICECOLLECTIONMETHOD InvoiceEventType = "change_invoice_collection_method" - InvoiceEventType_REMOVEPAYMENT InvoiceEventType = "remove_payment" - InvoiceEventType_FAILEDPAYMENT InvoiceEventType = "failed_payment" - InvoiceEventType_CHANGECHARGEBACKSTATUS InvoiceEventType = "change_chargeback_status" -) - -// InvoicePaymentMethodType is a string enum. -// The type of payment method used. -type InvoicePaymentMethodType string +// ListComponentsPricePointsInclude is a string enum. +type ListComponentsPricePointsInclude string const ( - InvoicePaymentMethodType_CREDITCARD InvoicePaymentMethodType = "credit_card" - InvoicePaymentMethodType_CHECK InvoicePaymentMethodType = "check" - InvoicePaymentMethodType_CASH InvoicePaymentMethodType = "cash" - InvoicePaymentMethodType_MONEYORDER InvoicePaymentMethodType = "money_order" - InvoicePaymentMethodType_ACH InvoicePaymentMethodType = "ach" - InvoicePaymentMethodType_OTHER InvoicePaymentMethodType = "other" + ListComponentsPricePointsInclude_CURRENCYPRICES ListComponentsPricePointsInclude = "currency_prices" ) -// InvoicePaymentType is a string enum. -// The type of payment to be applied to an Invoice. -type InvoicePaymentType string +// ListEventsDateField is a string enum. +type ListEventsDateField string const ( - InvoicePaymentType_EXTERNAL InvoicePaymentType = "external" - InvoicePaymentType_PREPAYMENT InvoicePaymentType = "prepayment" - InvoicePaymentType_SERVICECREDIT InvoicePaymentType = "service_credit" - InvoicePaymentType_PAYMENT InvoicePaymentType = "payment" + ListEventsDateField_CREATEDAT ListEventsDateField = "created_at" ) -// SubscriptionListDateField is a string enum. -type SubscriptionListDateField string +// ListProductsInclude is a string enum. +type ListProductsInclude string const ( - SubscriptionListDateField_UPDATEDAT SubscriptionListDateField = "updated_at" + ListProductsInclude_PREPAIDPRODUCTPRICEPOINT ListProductsInclude = "prepaid_product_price_point" ) -// ListSubscriptionComponentsSort is a string enum. -type ListSubscriptionComponentsSort string +// ListProductsPricePointsInclude is a string enum. +type ListProductsPricePointsInclude string const ( - ListSubscriptionComponentsSort_ID ListSubscriptionComponentsSort = "id" - ListSubscriptionComponentsSort_UPDATEDAT ListSubscriptionComponentsSort = "updated_at" + ListProductsPricePointsInclude_CURRENCYPRICES ListProductsPricePointsInclude = "currency_prices" ) // ListSubscriptionComponentsInclude is a string enum. type ListSubscriptionComponentsInclude string const ( - ListSubscriptionComponentsInclude_SUBSCRIPTION ListSubscriptionComponentsInclude = "subscription" + ListSubscriptionComponentsInclude_SUBSCRIPTION ListSubscriptionComponentsInclude = "subscription" ) -// PaymentCollectionMethod1 is a string enum. -// (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription -type PaymentCollectionMethod1 string +// ListSubscriptionComponentsSort is a string enum. +type ListSubscriptionComponentsSort string const ( - PaymentCollectionMethod1_AUTOMATIC PaymentCollectionMethod1 = "automatic" - PaymentCollectionMethod1_REMITTANCE PaymentCollectionMethod1 = "remittance" - PaymentCollectionMethod1_PREPAID PaymentCollectionMethod1 = "prepaid" - PaymentCollectionMethod1_INVOICE PaymentCollectionMethod1 = "invoice" + ListSubscriptionComponentsSort_ID ListSubscriptionComponentsSort = "id" + ListSubscriptionComponentsSort_UPDATEDAT ListSubscriptionComponentsSort = "updated_at" ) -// AllocationPreviewDirection is a string enum. -type AllocationPreviewDirection string +// ListSubscriptionGroupPrepaymentDateField is a string enum. +type ListSubscriptionGroupPrepaymentDateField string const ( - AllocationPreviewDirection_UPGRADE AllocationPreviewDirection = "upgrade" - AllocationPreviewDirection_DOWNGRADE AllocationPreviewDirection = "downgrade" + ListSubscriptionGroupPrepaymentDateField_CREATEDAT ListSubscriptionGroupPrepaymentDateField = "created_at" + ListSubscriptionGroupPrepaymentDateField_APPLICATIONAT ListSubscriptionGroupPrepaymentDateField = "application_at" ) -// LineItemTransactionType is a string enum. -// A handle for the line item transaction type -type LineItemTransactionType string +// MetafieldInput is a string enum. +// Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' +type MetafieldInput string const ( - LineItemTransactionType_CHARGE LineItemTransactionType = "charge" - LineItemTransactionType_CREDIT LineItemTransactionType = "credit" - LineItemTransactionType_ADJUSTMENT LineItemTransactionType = "adjustment" - LineItemTransactionType_PAYMENT LineItemTransactionType = "payment" - LineItemTransactionType_REFUND LineItemTransactionType = "refund" - LineItemTransactionType_INFOTRANSACTION LineItemTransactionType = "info_transaction" - LineItemTransactionType_PAYMENTAUTHORIZATION LineItemTransactionType = "payment_authorization" + MetafieldInput_BALANCETRACKER MetafieldInput = "balance_tracker" + MetafieldInput_TEXT MetafieldInput = "text" + MetafieldInput_RADIO MetafieldInput = "radio" + MetafieldInput_DROPDOWN MetafieldInput = "dropdown" ) -// AllocationPreviewLineItemKind is a string enum. -// A handle for the line item kind for allocation preview -type AllocationPreviewLineItemKind string +// PaymentType is a string enum. +type PaymentType string const ( - AllocationPreviewLineItemKind_QUANTITYBASEDCOMPONENT AllocationPreviewLineItemKind = "quantity_based_component" - AllocationPreviewLineItemKind_ONOFFCOMPONENT AllocationPreviewLineItemKind = "on_off_component" - AllocationPreviewLineItemKind_COUPON AllocationPreviewLineItemKind = "coupon" - AllocationPreviewLineItemKind_TAX AllocationPreviewLineItemKind = "tax" + PaymentType_CREDITCARD PaymentType = "credit_card" + PaymentType_BANKACCOUNT PaymentType = "bank_account" + PaymentType_PAYPALACCOUNT PaymentType = "paypal_account" ) -// CreditScheme is a string enum. -type CreditScheme string +// PrepaymentMethod is a string enum. +// :- 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. +type PrepaymentMethod string const ( - CreditScheme_NONE CreditScheme = "none" - CreditScheme_CREDIT CreditScheme = "credit" - CreditScheme_REFUND CreditScheme = "refund" + PrepaymentMethod_CHECK PrepaymentMethod = "check" + PrepaymentMethod_CASH PrepaymentMethod = "cash" + PrepaymentMethod_MONEYORDER PrepaymentMethod = "money_order" + PrepaymentMethod_ACH PrepaymentMethod = "ach" + PrepaymentMethod_PAYPALACCOUNT PrepaymentMethod = "paypal_account" + PrepaymentMethod_CREDITCARDONFILE PrepaymentMethod = "credit_card_on_file" + PrepaymentMethod_OTHER PrepaymentMethod = "other" ) -// GroupTargetType is a string enum. -// The type of object indicated by the id attribute. -type GroupTargetType string +// PricePointType is a string enum. +// 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. +type PricePointType string const ( - GroupTargetType_CUSTOMER GroupTargetType = "customer" - GroupTargetType_SUBSCRIPTION GroupTargetType = "subscription" - GroupTargetType_SELF GroupTargetType = "self" - GroupTargetType_PARENT GroupTargetType = "parent" - GroupTargetType_ELDEST GroupTargetType = "eldest" + PricePointType_CATALOG PricePointType = "catalog" + PricePointType_ENUMDEFAULT PricePointType = "default" + PricePointType_CUSTOM PricePointType = "custom" ) -// SubscriptionStateFilter is a string enum. -// Allowed values for filtering by the current state of the subscription. -type SubscriptionStateFilter string +// PricingScheme is a string enum. +// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. +type PricingScheme string const ( - SubscriptionStateFilter_ACTIVE SubscriptionStateFilter = "active" - SubscriptionStateFilter_CANCELED SubscriptionStateFilter = "canceled" - SubscriptionStateFilter_EXPIRED SubscriptionStateFilter = "expired" - SubscriptionStateFilter_EXPIREDCARDS SubscriptionStateFilter = "expired_cards" - SubscriptionStateFilter_ONHOLD SubscriptionStateFilter = "on_hold" - SubscriptionStateFilter_PASTDUE SubscriptionStateFilter = "past_due" - SubscriptionStateFilter_PENDINGCANCELLATION SubscriptionStateFilter = "pending_cancellation" - SubscriptionStateFilter_PENDINGRENEWAL SubscriptionStateFilter = "pending_renewal" - SubscriptionStateFilter_SUSPENDED SubscriptionStateFilter = "suspended" - SubscriptionStateFilter_TRIALENDED SubscriptionStateFilter = "trial_ended" - SubscriptionStateFilter_TRIALING SubscriptionStateFilter = "trialing" - SubscriptionStateFilter_UNPAID SubscriptionStateFilter = "unpaid" + PricingScheme_STAIRSTEP PricingScheme = "stairstep" + PricingScheme_VOLUME PricingScheme = "volume" + PricingScheme_PERUNIT PricingScheme = "per_unit" + PricingScheme_TIERED PricingScheme = "tiered" ) -// SubscriptionDateField is a string enum. -type SubscriptionDateField string +// ReactivationCharge is a string 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 +type ReactivationCharge string const ( - SubscriptionDateField_CURRENTPERIODENDSAT SubscriptionDateField = "current_period_ends_at" - SubscriptionDateField_CURRENTPERIODSTARTSAT SubscriptionDateField = "current_period_starts_at" - SubscriptionDateField_CREATEDAT SubscriptionDateField = "created_at" - SubscriptionDateField_ACTIVATEDAT SubscriptionDateField = "activated_at" - SubscriptionDateField_CANCELEDAT SubscriptionDateField = "canceled_at" - SubscriptionDateField_EXPIRESAT SubscriptionDateField = "expires_at" - SubscriptionDateField_TRIALSTARTEDAT SubscriptionDateField = "trial_started_at" - SubscriptionDateField_TRIALENDEDAT SubscriptionDateField = "trial_ended_at" - SubscriptionDateField_UPDATEDAT SubscriptionDateField = "updated_at" + ReactivationCharge_PRORATED ReactivationCharge = "prorated" + ReactivationCharge_IMMEDIATE ReactivationCharge = "immediate" + ReactivationCharge_DELAYED ReactivationCharge = "delayed" ) -// SubscriptionSort is a string enum. -type SubscriptionSort string +// RecurringScheme is a string enum. +type RecurringScheme string const ( - SubscriptionSort_SIGNUPDATE SubscriptionSort = "signup_date" - SubscriptionSort_PERIODSTART SubscriptionSort = "period_start" - SubscriptionSort_PERIODEND SubscriptionSort = "period_end" - SubscriptionSort_NEXTASSESSMENT SubscriptionSort = "next_assessment" - SubscriptionSort_UPDATEDAT SubscriptionSort = "updated_at" - SubscriptionSort_CREATEDAT SubscriptionSort = "created_at" + RecurringScheme_DONOTRECUR RecurringScheme = "do_not_recur" + RecurringScheme_RECURINDEFINITELY RecurringScheme = "recur_indefinitely" + RecurringScheme_RECURWITHDURATION RecurringScheme = "recur_with_duration" ) -// SubscriptionListInclude is a string enum. -type SubscriptionListInclude string +// ResourceType is a string enum. +type ResourceType string const ( - SubscriptionListInclude_SELFSERVICEPAGETOKEN SubscriptionListInclude = "self_service_page_token" + ResourceType_SUBSCRIPTIONS ResourceType = "subscriptions" + ResourceType_CUSTOMERS ResourceType = "customers" ) -// SubscriptionInclude is a string enum. -type SubscriptionInclude string +// RestrictionType is a string enum. +type RestrictionType string const ( - SubscriptionInclude_COUPONS SubscriptionInclude = "coupons" - SubscriptionInclude_SELFSERVICEPAGETOKEN SubscriptionInclude = "self_service_page_token" + RestrictionType_COMPONENT RestrictionType = "Component" + RestrictionType_PRODUCT RestrictionType = "Product" ) -// ResumptionCharge is a string enum. +// ResumptionCharge is a string enum. // (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled type ResumptionCharge string const ( - ResumptionCharge_PRORATED ResumptionCharge = "prorated" - ResumptionCharge_IMMEDIATE ResumptionCharge = "immediate" - ResumptionCharge_DELAYED ResumptionCharge = "delayed" + ResumptionCharge_PRORATED ResumptionCharge = "prorated" + ResumptionCharge_IMMEDIATE ResumptionCharge = "immediate" + ResumptionCharge_DELAYED ResumptionCharge = "delayed" ) -// ReactivationCharge is a string 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 -type ReactivationCharge string +// ServiceCreditType is a string enum. +// The type of entry +type ServiceCreditType string const ( - ReactivationCharge_PRORATED ReactivationCharge = "prorated" - ReactivationCharge_IMMEDIATE ReactivationCharge = "immediate" - ReactivationCharge_DELAYED ReactivationCharge = "delayed" + ServiceCreditType_CREDIT ServiceCreditType = "Credit" + ServiceCreditType_DEBIT ServiceCreditType = "Debit" ) -// LineItemKind is a string enum. -// A handle for the line item kind -type LineItemKind string +// SortingDirection is a string enum. +// Used for sorting results. +type SortingDirection string const ( - LineItemKind_BASELINE LineItemKind = "baseline" - LineItemKind_INITIAL LineItemKind = "initial" - LineItemKind_TRIAL LineItemKind = "trial" - LineItemKind_QUANTITYBASEDCOMPONENT LineItemKind = "quantity_based_component" - LineItemKind_PREPAIDUSAGECOMPONENT LineItemKind = "prepaid_usage_component" - LineItemKind_ONOFFCOMPONENT LineItemKind = "on_off_component" - LineItemKind_METEREDCOMPONENT LineItemKind = "metered_component" - LineItemKind_EVENTBASEDCOMPONENT LineItemKind = "event_based_component" - LineItemKind_COUPON LineItemKind = "coupon" - LineItemKind_TAX LineItemKind = "tax" + SortingDirection_ASC SortingDirection = "asc" + SortingDirection_DESC SortingDirection = "desc" ) -// CreateInvoiceStatus is a string enum. -type CreateInvoiceStatus string +// SubscriptionDateField is a string enum. +type SubscriptionDateField string const ( - CreateInvoiceStatus_DRAFT CreateInvoiceStatus = "draft" - CreateInvoiceStatus_OPEN CreateInvoiceStatus = "open" + SubscriptionDateField_CURRENTPERIODENDSAT SubscriptionDateField = "current_period_ends_at" + SubscriptionDateField_CURRENTPERIODSTARTSAT SubscriptionDateField = "current_period_starts_at" + SubscriptionDateField_CREATEDAT SubscriptionDateField = "created_at" + SubscriptionDateField_ACTIVATEDAT SubscriptionDateField = "activated_at" + SubscriptionDateField_CANCELEDAT SubscriptionDateField = "canceled_at" + SubscriptionDateField_EXPIRESAT SubscriptionDateField = "expires_at" + SubscriptionDateField_TRIALSTARTEDAT SubscriptionDateField = "trial_started_at" + SubscriptionDateField_TRIALENDEDAT SubscriptionDateField = "trial_ended_at" + SubscriptionDateField_UPDATEDAT SubscriptionDateField = "updated_at" ) -// PrepaymentMethod is a string enum. -// :- 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. -type PrepaymentMethod string +// SubscriptionGroupPrepaymentMethod is a string enum. +type SubscriptionGroupPrepaymentMethod string const ( - PrepaymentMethod_CHECK PrepaymentMethod = "check" - PrepaymentMethod_CASH PrepaymentMethod = "cash" - PrepaymentMethod_MONEYORDER PrepaymentMethod = "money_order" - PrepaymentMethod_ACH PrepaymentMethod = "ach" - PrepaymentMethod_PAYPALACCOUNT PrepaymentMethod = "paypal_account" - PrepaymentMethod_CREDITCARDONFILE PrepaymentMethod = "credit_card_on_file" - PrepaymentMethod_OTHER PrepaymentMethod = "other" + SubscriptionGroupPrepaymentMethod_CHECK SubscriptionGroupPrepaymentMethod = "check" + SubscriptionGroupPrepaymentMethod_CASH SubscriptionGroupPrepaymentMethod = "cash" + SubscriptionGroupPrepaymentMethod_MONEYORDER SubscriptionGroupPrepaymentMethod = "money_order" + SubscriptionGroupPrepaymentMethod_ACH SubscriptionGroupPrepaymentMethod = "ach" + SubscriptionGroupPrepaymentMethod_PAYPALACCOUNT SubscriptionGroupPrepaymentMethod = "paypal_account" + SubscriptionGroupPrepaymentMethod_OTHER SubscriptionGroupPrepaymentMethod = "other" ) -// ServiceCreditType is a string enum. -// The type of entry -type ServiceCreditType string +// SubscriptionInclude is a string enum. +type SubscriptionInclude string const ( - ServiceCreditType_CREDIT ServiceCreditType = "Credit" - ServiceCreditType_DEBIT ServiceCreditType = "Debit" + SubscriptionInclude_COUPONS SubscriptionInclude = "coupons" + SubscriptionInclude_SELFSERVICEPAGETOKEN SubscriptionInclude = "self_service_page_token" ) -// SubscriptionGroupPrepaymentMethod is a string enum. -type SubscriptionGroupPrepaymentMethod string +// SubscriptionListDateField is a string enum. +type SubscriptionListDateField string const ( - SubscriptionGroupPrepaymentMethod_CHECK SubscriptionGroupPrepaymentMethod = "check" - SubscriptionGroupPrepaymentMethod_CASH SubscriptionGroupPrepaymentMethod = "cash" - SubscriptionGroupPrepaymentMethod_MONEYORDER SubscriptionGroupPrepaymentMethod = "money_order" - SubscriptionGroupPrepaymentMethod_ACH SubscriptionGroupPrepaymentMethod = "ach" - SubscriptionGroupPrepaymentMethod_PAYPALACCOUNT SubscriptionGroupPrepaymentMethod = "paypal_account" - SubscriptionGroupPrepaymentMethod_OTHER SubscriptionGroupPrepaymentMethod = "other" + SubscriptionListDateField_UPDATEDAT SubscriptionListDateField = "updated_at" ) -// ListSubscriptionGroupPrepaymentDateField is a string enum. -type ListSubscriptionGroupPrepaymentDateField string +// SubscriptionListInclude is a string enum. +type SubscriptionListInclude string const ( - ListSubscriptionGroupPrepaymentDateField_CREATEDAT ListSubscriptionGroupPrepaymentDateField = "created_at" - ListSubscriptionGroupPrepaymentDateField_APPLICATIONAT ListSubscriptionGroupPrepaymentDateField = "application_at" + SubscriptionListInclude_SELFSERVICEPAGETOKEN SubscriptionListInclude = "self_service_page_token" ) // SubscriptionPurgeType is a string enum. type SubscriptionPurgeType string const ( - SubscriptionPurgeType_CUSTOMER SubscriptionPurgeType = "customer" - SubscriptionPurgeType_PAYMENTPROFILE SubscriptionPurgeType = "payment_profile" + SubscriptionPurgeType_CUSTOMER SubscriptionPurgeType = "customer" + SubscriptionPurgeType_PAYMENTPROFILE SubscriptionPurgeType = "payment_profile" ) -// BillingManifestLineItemKind is a string enum. -// A handle for the billing manifest line item kind -type BillingManifestLineItemKind string +// SubscriptionSort is a string enum. +type SubscriptionSort string const ( - BillingManifestLineItemKind_BASELINE BillingManifestLineItemKind = "baseline" - BillingManifestLineItemKind_INITIAL BillingManifestLineItemKind = "initial" - BillingManifestLineItemKind_TRIAL BillingManifestLineItemKind = "trial" - BillingManifestLineItemKind_COUPON BillingManifestLineItemKind = "coupon" - BillingManifestLineItemKind_COMPONENT BillingManifestLineItemKind = "component" - BillingManifestLineItemKind_TAX BillingManifestLineItemKind = "tax" + SubscriptionSort_SIGNUPDATE SubscriptionSort = "signup_date" + SubscriptionSort_PERIODSTART SubscriptionSort = "period_start" + SubscriptionSort_PERIODEND SubscriptionSort = "period_end" + SubscriptionSort_NEXTASSESSMENT SubscriptionSort = "next_assessment" + SubscriptionSort_UPDATEDAT SubscriptionSort = "updated_at" + SubscriptionSort_CREATEDAT SubscriptionSort = "created_at" ) -// FailedPaymentAction is a string enum. -// 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). -type FailedPaymentAction string +// SubscriptionState is a string enum. +// 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. +// See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. +type SubscriptionState string + +const ( + SubscriptionState_PENDING SubscriptionState = "pending" + SubscriptionState_FAILEDTOCREATE SubscriptionState = "failed_to_create" + SubscriptionState_TRIALING SubscriptionState = "trialing" + SubscriptionState_ASSESSING SubscriptionState = "assessing" + SubscriptionState_ACTIVE SubscriptionState = "active" + SubscriptionState_SOFTFAILURE SubscriptionState = "soft_failure" + SubscriptionState_PASTDUE SubscriptionState = "past_due" + SubscriptionState_SUSPENDED SubscriptionState = "suspended" + SubscriptionState_CANCELED SubscriptionState = "canceled" + SubscriptionState_EXPIRED SubscriptionState = "expired" + SubscriptionState_PAUSED SubscriptionState = "paused" + SubscriptionState_UNPAID SubscriptionState = "unpaid" + SubscriptionState_TRIALENDED SubscriptionState = "trial_ended" + SubscriptionState_ONHOLD SubscriptionState = "on_hold" + SubscriptionState_AWAITINGSIGNUP SubscriptionState = "awaiting_signup" +) + +// SubscriptionStateFilter is a string enum. +// Allowed values for filtering by the current state of the subscription. +type SubscriptionStateFilter string const ( - FailedPaymentAction_LEAVEOPENINVOICE FailedPaymentAction = "leave_open_invoice" - FailedPaymentAction_ROLLBACKTOPENDING FailedPaymentAction = "rollback_to_pending" - FailedPaymentAction_INITIATEDUNNING FailedPaymentAction = "initiate_dunning" + SubscriptionStateFilter_ACTIVE SubscriptionStateFilter = "active" + SubscriptionStateFilter_CANCELED SubscriptionStateFilter = "canceled" + SubscriptionStateFilter_EXPIRED SubscriptionStateFilter = "expired" + SubscriptionStateFilter_EXPIREDCARDS SubscriptionStateFilter = "expired_cards" + SubscriptionStateFilter_ONHOLD SubscriptionStateFilter = "on_hold" + SubscriptionStateFilter_PASTDUE SubscriptionStateFilter = "past_due" + SubscriptionStateFilter_PENDINGCANCELLATION SubscriptionStateFilter = "pending_cancellation" + SubscriptionStateFilter_PENDINGRENEWAL SubscriptionStateFilter = "pending_renewal" + SubscriptionStateFilter_SUSPENDED SubscriptionStateFilter = "suspended" + SubscriptionStateFilter_TRIALENDED SubscriptionStateFilter = "trial_ended" + SubscriptionStateFilter_TRIALING SubscriptionStateFilter = "trialing" + SubscriptionStateFilter_UNPAID SubscriptionStateFilter = "unpaid" ) -// ListComponentsPricePointsInclude is a string enum. -type ListComponentsPricePointsInclude string +// TaxConfigurationKind is a string enum. +type TaxConfigurationKind string const ( - ListComponentsPricePointsInclude_CURRENCYPRICES ListComponentsPricePointsInclude = "currency_prices" + TaxConfigurationKind_CUSTOM TaxConfigurationKind = "custom" + TaxConfigurationKind_ENUMMANAGEDAVALARA TaxConfigurationKind = "managed avalara" + TaxConfigurationKind_ENUMLINKEDAVALARA TaxConfigurationKind = "linked avalara" + TaxConfigurationKind_ENUMDIGITALRIVER TaxConfigurationKind = "digital river" ) -// ListProductsPricePointsInclude is a string enum. -type ListProductsPricePointsInclude string +// TaxDestinationAddress is a string enum. +type TaxDestinationAddress string + +const ( + TaxDestinationAddress_SHIPPINGTHENBILLING TaxDestinationAddress = "shipping_then_billing" + TaxDestinationAddress_BILLINGTHENSHIPPING TaxDestinationAddress = "billing_then_shipping" + TaxDestinationAddress_SHIPPINGONLY TaxDestinationAddress = "shipping_only" + TaxDestinationAddress_BILLINGONLY TaxDestinationAddress = "billing_only" +) + +// WebhookOrder is a string enum. +type WebhookOrder string + +const ( + WebhookOrder_NEWESTFIRST WebhookOrder = "newest_first" + WebhookOrder_OLDESTFIRST WebhookOrder = "oldest_first" +) + +// WebhookStatus is a string enum. +type WebhookStatus string + +const ( + WebhookStatus_SUCCESSFUL WebhookStatus = "successful" + WebhookStatus_FAILED WebhookStatus = "failed" + WebhookStatus_PENDING WebhookStatus = "pending" + WebhookStatus_PAUSED WebhookStatus = "paused" +) + +// WebhookSubscription is a string enum. +type WebhookSubscription string const ( - ListProductsPricePointsInclude_CURRENCYPRICES ListProductsPricePointsInclude = "currency_prices" + WebhookSubscription_BILLINGDATECHANGE WebhookSubscription = "billing_date_change" + WebhookSubscription_COMPONENTALLOCATIONCHANGE WebhookSubscription = "component_allocation_change" + WebhookSubscription_CUSTOMERCREATE WebhookSubscription = "customer_create" + WebhookSubscription_CUSTOMERUPDATE WebhookSubscription = "customer_update" + WebhookSubscription_DUNNINGSTEPREACHED WebhookSubscription = "dunning_step_reached" + WebhookSubscription_EXPIRINGCARD WebhookSubscription = "expiring_card" + WebhookSubscription_EXPIRATIONDATECHANGE WebhookSubscription = "expiration_date_change" + WebhookSubscription_INVOICEISSUED WebhookSubscription = "invoice_issued" + WebhookSubscription_METEREDUSAGE WebhookSubscription = "metered_usage" + WebhookSubscription_PAYMENTFAILURE WebhookSubscription = "payment_failure" + WebhookSubscription_PAYMENTSUCCESS WebhookSubscription = "payment_success" + WebhookSubscription_DIRECTDEBITPAYMENTPENDING WebhookSubscription = "direct_debit_payment_pending" + WebhookSubscription_DIRECTDEBITPAYMENTPAIDOUT WebhookSubscription = "direct_debit_payment_paid_out" + WebhookSubscription_DIRECTDEBITPAYMENTREJECTED WebhookSubscription = "direct_debit_payment_rejected" + WebhookSubscription_PREPAIDSUBSCRIPTIONBALANCECHANGED WebhookSubscription = "prepaid_subscription_balance_changed" + WebhookSubscription_PREPAIDUSAGE WebhookSubscription = "prepaid_usage" + WebhookSubscription_REFUNDFAILURE WebhookSubscription = "refund_failure" + WebhookSubscription_REFUNDSUCCESS WebhookSubscription = "refund_success" + WebhookSubscription_RENEWALFAILURE WebhookSubscription = "renewal_failure" + WebhookSubscription_RENEWALSUCCESS WebhookSubscription = "renewal_success" + WebhookSubscription_SIGNUPFAILURE WebhookSubscription = "signup_failure" + WebhookSubscription_SIGNUPSUCCESS WebhookSubscription = "signup_success" + WebhookSubscription_STATEMENTCLOSED WebhookSubscription = "statement_closed" + WebhookSubscription_STATEMENTSETTLED WebhookSubscription = "statement_settled" + WebhookSubscription_SUBSCRIPTIONCARDUPDATE WebhookSubscription = "subscription_card_update" + WebhookSubscription_SUBSCRIPTIONGROUPCARDUPDATE WebhookSubscription = "subscription_group_card_update" + WebhookSubscription_SUBSCRIPTIONPRODUCTCHANGE WebhookSubscription = "subscription_product_change" + WebhookSubscription_SUBSCRIPTIONSTATECHANGE WebhookSubscription = "subscription_state_change" + WebhookSubscription_TRIALENDNOTICE WebhookSubscription = "trial_end_notice" + WebhookSubscription_UPCOMINGRENEWALNOTICE WebhookSubscription = "upcoming_renewal_notice" + WebhookSubscription_UPGRADEDOWNGRADEFAILURE WebhookSubscription = "upgrade_downgrade_failure" + WebhookSubscription_UPGRADEDOWNGRADESUCCESS WebhookSubscription = "upgrade_downgrade_success" + WebhookSubscription_PENDINGCANCELLATIONCHANGE WebhookSubscription = "pending_cancellation_change" + WebhookSubscription_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED WebhookSubscription = "subscription_prepayment_account_balance_changed" + WebhookSubscription_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED WebhookSubscription = "subscription_service_credit_account_balance_changed" ) diff --git a/models/event.go b/models/event.go index fdf79409..39d7fabf 100644 --- a/models/event.go +++ b/models/event.go @@ -1,64 +1,64 @@ package models import ( - "encoding/json" + "encoding/json" ) // Event represents a Event struct. type Event struct { - Id int `json:"id"` - Key string `json:"key"` - Message string `json:"message"` - SubscriptionId *int `json:"subscription_id"` - CustomerId int `json:"customer_id"` - CreatedAt string `json:"created_at"` - EventSpecificData interface{} `json:"event_specific_data"` + Id int `json:"id"` + Key string `json:"key"` + Message string `json:"message"` + SubscriptionId *int `json:"subscription_id"` + CustomerId int `json:"customer_id"` + CreatedAt string `json:"created_at"` + EventSpecificData interface{} `json:"event_specific_data"` } -// MarshalJSON implements the json.Marshaler interface for Event. +// MarshalJSON implements the json.Marshaler interface for Event. // It customizes the JSON marshaling process for Event objects. func (e *Event) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the Event object to a map representation for JSON marshaling. func (e *Event) toMap() map[string]any { - structMap := make(map[string]any) - structMap["id"] = e.Id - structMap["key"] = e.Key - structMap["message"] = e.Message - structMap["subscription_id"] = e.SubscriptionId - structMap["customer_id"] = e.CustomerId - structMap["created_at"] = e.CreatedAt - structMap["event_specific_data"] = e.EventSpecificData - return structMap + structMap := make(map[string]any) + structMap["id"] = e.Id + structMap["key"] = e.Key + structMap["message"] = e.Message + structMap["subscription_id"] = e.SubscriptionId + structMap["customer_id"] = e.CustomerId + structMap["created_at"] = e.CreatedAt + structMap["event_specific_data"] = e.EventSpecificData + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Event. +// UnmarshalJSON implements the json.Unmarshaler interface for Event. // It customizes the JSON unmarshaling process for Event objects. func (e *Event) UnmarshalJSON(input []byte) error { - temp := &struct { - Id int `json:"id"` - Key string `json:"key"` - Message string `json:"message"` - SubscriptionId *int `json:"subscription_id"` - CustomerId int `json:"customer_id"` - CreatedAt string `json:"created_at"` - EventSpecificData interface{} `json:"event_specific_data"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Id = temp.Id - e.Key = temp.Key - e.Message = temp.Message - e.SubscriptionId = temp.SubscriptionId - e.CustomerId = temp.CustomerId - e.CreatedAt = temp.CreatedAt - e.EventSpecificData = temp.EventSpecificData - return nil + temp := &struct { + Id int `json:"id"` + Key string `json:"key"` + Message string `json:"message"` + SubscriptionId *int `json:"subscription_id"` + CustomerId int `json:"customer_id"` + CreatedAt string `json:"created_at"` + EventSpecificData interface{} `json:"event_specific_data"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Id = temp.Id + e.Key = temp.Key + e.Message = temp.Message + e.SubscriptionId = temp.SubscriptionId + e.CustomerId = temp.CustomerId + e.CreatedAt = temp.CreatedAt + e.EventSpecificData = temp.EventSpecificData + return nil } diff --git a/models/event_based_billing_segment_error.go b/models/event_based_billing_segment_error.go index 76e6b54f..d800b77f 100644 --- a/models/event_based_billing_segment_error.go +++ b/models/event_based_billing_segment_error.go @@ -1,41 +1,41 @@ package models import ( - "encoding/json" + "encoding/json" ) // EventBasedBillingSegmentError represents a EventBasedBillingSegmentError struct. type EventBasedBillingSegmentError struct { - // 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. - Segments map[string]interface{} `json:"segments"` + // 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. + Segments map[string]interface{} `json:"segments"` } -// MarshalJSON implements the json.Marshaler interface for EventBasedBillingSegmentError. +// MarshalJSON implements the json.Marshaler interface for EventBasedBillingSegmentError. // It customizes the JSON marshaling process for EventBasedBillingSegmentError objects. func (e *EventBasedBillingSegmentError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EventBasedBillingSegmentError object to a map representation for JSON marshaling. func (e *EventBasedBillingSegmentError) toMap() map[string]any { - structMap := make(map[string]any) - structMap["segments"] = e.Segments - return structMap + structMap := make(map[string]any) + structMap["segments"] = e.Segments + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EventBasedBillingSegmentError. +// UnmarshalJSON implements the json.Unmarshaler interface for EventBasedBillingSegmentError. // It customizes the JSON unmarshaling process for EventBasedBillingSegmentError objects. func (e *EventBasedBillingSegmentError) UnmarshalJSON(input []byte) error { - temp := &struct { - Segments map[string]interface{} `json:"segments"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Segments = temp.Segments - return nil + temp := &struct { + Segments map[string]interface{} `json:"segments"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Segments = temp.Segments + return nil } diff --git a/models/event_response.go b/models/event_response.go index 38487269..9ed3b2f1 100644 --- a/models/event_response.go +++ b/models/event_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // EventResponse represents a EventResponse struct. type EventResponse struct { - Event Event `json:"event"` + Event Event `json:"event"` } -// MarshalJSON implements the json.Marshaler interface for EventResponse. +// MarshalJSON implements the json.Marshaler interface for EventResponse. // It customizes the JSON marshaling process for EventResponse objects. func (e *EventResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the EventResponse object to a map representation for JSON marshaling. func (e *EventResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["event"] = e.Event - return structMap + structMap := make(map[string]any) + structMap["event"] = e.Event.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for EventResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for EventResponse. // It customizes the JSON unmarshaling process for EventResponse objects. func (e *EventResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Event Event `json:"event"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.Event = temp.Event - return nil + temp := &struct { + Event Event `json:"event"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.Event = temp.Event + return nil } diff --git a/models/full_subscription_group_response.go b/models/full_subscription_group_response.go index 40e6a67a..93784985 100644 --- a/models/full_subscription_group_response.go +++ b/models/full_subscription_group_response.go @@ -1,108 +1,108 @@ package models import ( - "encoding/json" + "encoding/json" ) // FullSubscriptionGroupResponse represents a FullSubscriptionGroupResponse struct. type FullSubscriptionGroupResponse struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` - Customer *SubscriptionGroupCustomer `json:"customer,omitempty"` - AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` + Customer *SubscriptionGroupCustomer `json:"customer,omitempty"` + AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for FullSubscriptionGroupResponse. +// MarshalJSON implements the json.Marshaler interface for FullSubscriptionGroupResponse. // It customizes the JSON marshaling process for FullSubscriptionGroupResponse objects. func (f *FullSubscriptionGroupResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(f.toMap()) + []byte, + error) { + return json.Marshal(f.toMap()) } // toMap converts the FullSubscriptionGroupResponse object to a map representation for JSON marshaling. func (f *FullSubscriptionGroupResponse) toMap() map[string]any { - structMap := make(map[string]any) - if f.Uid != nil { - structMap["uid"] = f.Uid - } - if f.Scheme != nil { - structMap["scheme"] = f.Scheme - } - if f.CustomerId != nil { - structMap["customer_id"] = f.CustomerId - } - if f.PaymentProfileId != nil { - structMap["payment_profile_id"] = f.PaymentProfileId - } - if f.SubscriptionIds != nil { - structMap["subscription_ids"] = f.SubscriptionIds - } - if f.PrimarySubscriptionId != nil { - structMap["primary_subscription_id"] = f.PrimarySubscriptionId - } - if f.NextAssessmentAt != nil { - structMap["next_assessment_at"] = f.NextAssessmentAt - } - if f.State != nil { - structMap["state"] = f.State - } - if f.CancelAtEndOfPeriod != nil { - structMap["cancel_at_end_of_period"] = f.CancelAtEndOfPeriod - } - if f.CurrentBillingAmountInCents != nil { - structMap["current_billing_amount_in_cents"] = f.CurrentBillingAmountInCents - } - if f.Customer != nil { - structMap["customer"] = f.Customer - } - if f.AccountBalances != nil { - structMap["account_balances"] = f.AccountBalances - } - return structMap + structMap := make(map[string]any) + if f.Uid != nil { + structMap["uid"] = f.Uid + } + if f.Scheme != nil { + structMap["scheme"] = f.Scheme + } + if f.CustomerId != nil { + structMap["customer_id"] = f.CustomerId + } + if f.PaymentProfileId != nil { + structMap["payment_profile_id"] = f.PaymentProfileId + } + if f.SubscriptionIds != nil { + structMap["subscription_ids"] = f.SubscriptionIds + } + if f.PrimarySubscriptionId != nil { + structMap["primary_subscription_id"] = f.PrimarySubscriptionId + } + if f.NextAssessmentAt != nil { + structMap["next_assessment_at"] = f.NextAssessmentAt + } + if f.State != nil { + structMap["state"] = f.State + } + if f.CancelAtEndOfPeriod != nil { + structMap["cancel_at_end_of_period"] = f.CancelAtEndOfPeriod + } + if f.CurrentBillingAmountInCents != nil { + structMap["current_billing_amount_in_cents"] = f.CurrentBillingAmountInCents + } + if f.Customer != nil { + structMap["customer"] = f.Customer.toMap() + } + if f.AccountBalances != nil { + structMap["account_balances"] = f.AccountBalances.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for FullSubscriptionGroupResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for FullSubscriptionGroupResponse. // It customizes the JSON unmarshaling process for FullSubscriptionGroupResponse objects. func (f *FullSubscriptionGroupResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` - Customer *SubscriptionGroupCustomer `json:"customer,omitempty"` - AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - f.Uid = temp.Uid - f.Scheme = temp.Scheme - f.CustomerId = temp.CustomerId - f.PaymentProfileId = temp.PaymentProfileId - f.SubscriptionIds = temp.SubscriptionIds - f.PrimarySubscriptionId = temp.PrimarySubscriptionId - f.NextAssessmentAt = temp.NextAssessmentAt - f.State = temp.State - f.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod - f.CurrentBillingAmountInCents = temp.CurrentBillingAmountInCents - f.Customer = temp.Customer - f.AccountBalances = temp.AccountBalances - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` + Customer *SubscriptionGroupCustomer `json:"customer,omitempty"` + AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + f.Uid = temp.Uid + f.Scheme = temp.Scheme + f.CustomerId = temp.CustomerId + f.PaymentProfileId = temp.PaymentProfileId + f.SubscriptionIds = temp.SubscriptionIds + f.PrimarySubscriptionId = temp.PrimarySubscriptionId + f.NextAssessmentAt = temp.NextAssessmentAt + f.State = temp.State + f.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod + f.CurrentBillingAmountInCents = temp.CurrentBillingAmountInCents + f.Customer = temp.Customer + f.AccountBalances = temp.AccountBalances + return nil } diff --git a/models/get_one_time_token_payment_profile.go b/models/get_one_time_token_payment_profile.go index e0fb450c..b488ab7a 100644 --- a/models/get_one_time_token_payment_profile.go +++ b/models/get_one_time_token_payment_profile.go @@ -1,132 +1,132 @@ package models import ( - "encoding/json" + "encoding/json" ) // GetOneTimeTokenPaymentProfile represents a GetOneTimeTokenPaymentProfile struct. type GetOneTimeTokenPaymentProfile struct { - Id Optional[string] `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - MaskedCardNumber string `json:"masked_card_number"` - // The type of card used. - CardType CardType `json:"card_type"` - ExpirationMonth float64 `json:"expiration_month"` - ExpirationYear float64 `json:"expiration_year"` - CustomerId Optional[string] `json:"customer_id"` - // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - CurrentVault CurrentVault `json:"current_vault"` - VaultToken string `json:"vault_token"` - BillingAddress string `json:"billing_address"` - BillingAddress2 *string `json:"billing_address_2,omitempty"` - BillingCity string `json:"billing_city"` - BillingCountry string `json:"billing_country"` - BillingState string `json:"billing_state"` - BillingZip string `json:"billing_zip"` - PaymentType string `json:"payment_type"` - Disabled bool `json:"disabled"` - SiteGatewaySettingId int `json:"site_gateway_setting_id"` - CustomerVaultToken Optional[string] `json:"customer_vault_token"` - GatewayHandle Optional[string] `json:"gateway_handle"` + Id Optional[string] `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + MaskedCardNumber string `json:"masked_card_number"` + // The type of card used. + CardType CardType `json:"card_type"` + ExpirationMonth float64 `json:"expiration_month"` + ExpirationYear float64 `json:"expiration_year"` + CustomerId Optional[string] `json:"customer_id"` + // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + CurrentVault CurrentVault `json:"current_vault"` + VaultToken string `json:"vault_token"` + BillingAddress string `json:"billing_address"` + BillingAddress2 *string `json:"billing_address_2,omitempty"` + BillingCity string `json:"billing_city"` + BillingCountry string `json:"billing_country"` + BillingState string `json:"billing_state"` + BillingZip string `json:"billing_zip"` + PaymentType string `json:"payment_type"` + Disabled bool `json:"disabled"` + SiteGatewaySettingId int `json:"site_gateway_setting_id"` + CustomerVaultToken Optional[string] `json:"customer_vault_token"` + GatewayHandle Optional[string] `json:"gateway_handle"` } -// MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenPaymentProfile. +// MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenPaymentProfile. // It customizes the JSON marshaling process for GetOneTimeTokenPaymentProfile objects. func (g *GetOneTimeTokenPaymentProfile) MarshalJSON() ( - []byte, - error) { - return json.Marshal(g.toMap()) + []byte, + error) { + return json.Marshal(g.toMap()) } // toMap converts the GetOneTimeTokenPaymentProfile object to a map representation for JSON marshaling. func (g *GetOneTimeTokenPaymentProfile) toMap() map[string]any { - structMap := make(map[string]any) - if g.Id.IsValueSet() { - structMap["id"] = g.Id.Value() - } - structMap["first_name"] = g.FirstName - structMap["last_name"] = g.LastName - structMap["masked_card_number"] = g.MaskedCardNumber - structMap["card_type"] = g.CardType - structMap["expiration_month"] = g.ExpirationMonth - structMap["expiration_year"] = g.ExpirationYear - if g.CustomerId.IsValueSet() { - structMap["customer_id"] = g.CustomerId.Value() - } - structMap["current_vault"] = g.CurrentVault - structMap["vault_token"] = g.VaultToken - structMap["billing_address"] = g.BillingAddress - if g.BillingAddress2 != nil { - structMap["billing_address_2"] = g.BillingAddress2 - } - structMap["billing_city"] = g.BillingCity - structMap["billing_country"] = g.BillingCountry - structMap["billing_state"] = g.BillingState - structMap["billing_zip"] = g.BillingZip - structMap["payment_type"] = g.PaymentType - structMap["disabled"] = g.Disabled - structMap["site_gateway_setting_id"] = g.SiteGatewaySettingId - if g.CustomerVaultToken.IsValueSet() { - structMap["customer_vault_token"] = g.CustomerVaultToken.Value() - } - if g.GatewayHandle.IsValueSet() { - structMap["gateway_handle"] = g.GatewayHandle.Value() - } - return structMap + structMap := make(map[string]any) + if g.Id.IsValueSet() { + structMap["id"] = g.Id.Value() + } + structMap["first_name"] = g.FirstName + structMap["last_name"] = g.LastName + structMap["masked_card_number"] = g.MaskedCardNumber + structMap["card_type"] = g.CardType + structMap["expiration_month"] = g.ExpirationMonth + structMap["expiration_year"] = g.ExpirationYear + if g.CustomerId.IsValueSet() { + structMap["customer_id"] = g.CustomerId.Value() + } + structMap["current_vault"] = g.CurrentVault + structMap["vault_token"] = g.VaultToken + structMap["billing_address"] = g.BillingAddress + if g.BillingAddress2 != nil { + structMap["billing_address_2"] = g.BillingAddress2 + } + structMap["billing_city"] = g.BillingCity + structMap["billing_country"] = g.BillingCountry + structMap["billing_state"] = g.BillingState + structMap["billing_zip"] = g.BillingZip + structMap["payment_type"] = g.PaymentType + structMap["disabled"] = g.Disabled + structMap["site_gateway_setting_id"] = g.SiteGatewaySettingId + if g.CustomerVaultToken.IsValueSet() { + structMap["customer_vault_token"] = g.CustomerVaultToken.Value() + } + if g.GatewayHandle.IsValueSet() { + structMap["gateway_handle"] = g.GatewayHandle.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenPaymentProfile. +// UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenPaymentProfile. // It customizes the JSON unmarshaling process for GetOneTimeTokenPaymentProfile objects. func (g *GetOneTimeTokenPaymentProfile) UnmarshalJSON(input []byte) error { - temp := &struct { - Id Optional[string] `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - MaskedCardNumber string `json:"masked_card_number"` - CardType CardType `json:"card_type"` - ExpirationMonth float64 `json:"expiration_month"` - ExpirationYear float64 `json:"expiration_year"` - CustomerId Optional[string] `json:"customer_id"` - CurrentVault CurrentVault `json:"current_vault"` - VaultToken string `json:"vault_token"` - BillingAddress string `json:"billing_address"` - BillingAddress2 *string `json:"billing_address_2,omitempty"` - BillingCity string `json:"billing_city"` - BillingCountry string `json:"billing_country"` - BillingState string `json:"billing_state"` - BillingZip string `json:"billing_zip"` - PaymentType string `json:"payment_type"` - Disabled bool `json:"disabled"` - SiteGatewaySettingId int `json:"site_gateway_setting_id"` - CustomerVaultToken Optional[string] `json:"customer_vault_token"` - GatewayHandle Optional[string] `json:"gateway_handle"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - g.Id = temp.Id - g.FirstName = temp.FirstName - g.LastName = temp.LastName - g.MaskedCardNumber = temp.MaskedCardNumber - g.CardType = temp.CardType - g.ExpirationMonth = temp.ExpirationMonth - g.ExpirationYear = temp.ExpirationYear - g.CustomerId = temp.CustomerId - g.CurrentVault = temp.CurrentVault - g.VaultToken = temp.VaultToken - g.BillingAddress = temp.BillingAddress - g.BillingAddress2 = temp.BillingAddress2 - g.BillingCity = temp.BillingCity - g.BillingCountry = temp.BillingCountry - g.BillingState = temp.BillingState - g.BillingZip = temp.BillingZip - g.PaymentType = temp.PaymentType - g.Disabled = temp.Disabled - g.SiteGatewaySettingId = temp.SiteGatewaySettingId - g.CustomerVaultToken = temp.CustomerVaultToken - g.GatewayHandle = temp.GatewayHandle - return nil + temp := &struct { + Id Optional[string] `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + MaskedCardNumber string `json:"masked_card_number"` + CardType CardType `json:"card_type"` + ExpirationMonth float64 `json:"expiration_month"` + ExpirationYear float64 `json:"expiration_year"` + CustomerId Optional[string] `json:"customer_id"` + CurrentVault CurrentVault `json:"current_vault"` + VaultToken string `json:"vault_token"` + BillingAddress string `json:"billing_address"` + BillingAddress2 *string `json:"billing_address_2,omitempty"` + BillingCity string `json:"billing_city"` + BillingCountry string `json:"billing_country"` + BillingState string `json:"billing_state"` + BillingZip string `json:"billing_zip"` + PaymentType string `json:"payment_type"` + Disabled bool `json:"disabled"` + SiteGatewaySettingId int `json:"site_gateway_setting_id"` + CustomerVaultToken Optional[string] `json:"customer_vault_token"` + GatewayHandle Optional[string] `json:"gateway_handle"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + g.Id = temp.Id + g.FirstName = temp.FirstName + g.LastName = temp.LastName + g.MaskedCardNumber = temp.MaskedCardNumber + g.CardType = temp.CardType + g.ExpirationMonth = temp.ExpirationMonth + g.ExpirationYear = temp.ExpirationYear + g.CustomerId = temp.CustomerId + g.CurrentVault = temp.CurrentVault + g.VaultToken = temp.VaultToken + g.BillingAddress = temp.BillingAddress + g.BillingAddress2 = temp.BillingAddress2 + g.BillingCity = temp.BillingCity + g.BillingCountry = temp.BillingCountry + g.BillingState = temp.BillingState + g.BillingZip = temp.BillingZip + g.PaymentType = temp.PaymentType + g.Disabled = temp.Disabled + g.SiteGatewaySettingId = temp.SiteGatewaySettingId + g.CustomerVaultToken = temp.CustomerVaultToken + g.GatewayHandle = temp.GatewayHandle + return nil } diff --git a/models/get_one_time_token_request.go b/models/get_one_time_token_request.go index d3cf8f26..4d9339d4 100644 --- a/models/get_one_time_token_request.go +++ b/models/get_one_time_token_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // GetOneTimeTokenRequest represents a GetOneTimeTokenRequest struct. type GetOneTimeTokenRequest struct { - PaymentProfile GetOneTimeTokenPaymentProfile `json:"payment_profile"` + PaymentProfile GetOneTimeTokenPaymentProfile `json:"payment_profile"` } -// MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenRequest. +// MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenRequest. // It customizes the JSON marshaling process for GetOneTimeTokenRequest objects. func (g *GetOneTimeTokenRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(g.toMap()) + []byte, + error) { + return json.Marshal(g.toMap()) } // toMap converts the GetOneTimeTokenRequest object to a map representation for JSON marshaling. func (g *GetOneTimeTokenRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment_profile"] = g.PaymentProfile - return structMap + structMap := make(map[string]any) + structMap["payment_profile"] = g.PaymentProfile.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenRequest. // It customizes the JSON unmarshaling process for GetOneTimeTokenRequest objects. func (g *GetOneTimeTokenRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PaymentProfile GetOneTimeTokenPaymentProfile `json:"payment_profile"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - g.PaymentProfile = temp.PaymentProfile - return nil + temp := &struct { + PaymentProfile GetOneTimeTokenPaymentProfile `json:"payment_profile"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + g.PaymentProfile = temp.PaymentProfile + return nil } diff --git a/models/group_billing.go b/models/group_billing.go index de370794..c8e5bdac 100644 --- a/models/group_billing.go +++ b/models/group_billing.go @@ -1,58 +1,58 @@ package models import ( - "encoding/json" + "encoding/json" ) -// GroupBilling represents a GroupBilling struct. +// GroupBilling represents a GroupBilling struct. // Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. type GroupBilling struct { - // A flag indicating whether or not to accrue charges on the new subscription. - Accrue *bool `json:"accrue,omitempty"` - // 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. - AlignDate *bool `json:"align_date,omitempty"` - // 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. - Prorate *bool `json:"prorate,omitempty"` + // A flag indicating whether or not to accrue charges on the new subscription. + Accrue *bool `json:"accrue,omitempty"` + // 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. + AlignDate *bool `json:"align_date,omitempty"` + // 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. + Prorate *bool `json:"prorate,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for GroupBilling. +// MarshalJSON implements the json.Marshaler interface for GroupBilling. // It customizes the JSON marshaling process for GroupBilling objects. func (g *GroupBilling) MarshalJSON() ( - []byte, - error) { - return json.Marshal(g.toMap()) + []byte, + error) { + return json.Marshal(g.toMap()) } // toMap converts the GroupBilling object to a map representation for JSON marshaling. func (g *GroupBilling) toMap() map[string]any { - structMap := make(map[string]any) - if g.Accrue != nil { - structMap["accrue"] = g.Accrue - } - if g.AlignDate != nil { - structMap["align_date"] = g.AlignDate - } - if g.Prorate != nil { - structMap["prorate"] = g.Prorate - } - return structMap + structMap := make(map[string]any) + if g.Accrue != nil { + structMap["accrue"] = g.Accrue + } + if g.AlignDate != nil { + structMap["align_date"] = g.AlignDate + } + if g.Prorate != nil { + structMap["prorate"] = g.Prorate + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for GroupBilling. +// UnmarshalJSON implements the json.Unmarshaler interface for GroupBilling. // It customizes the JSON unmarshaling process for GroupBilling objects. func (g *GroupBilling) UnmarshalJSON(input []byte) error { - temp := &struct { - Accrue *bool `json:"accrue,omitempty"` - AlignDate *bool `json:"align_date,omitempty"` - Prorate *bool `json:"prorate,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - g.Accrue = temp.Accrue - g.AlignDate = temp.AlignDate - g.Prorate = temp.Prorate - return nil + temp := &struct { + Accrue *bool `json:"accrue,omitempty"` + AlignDate *bool `json:"align_date,omitempty"` + Prorate *bool `json:"prorate,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + g.Accrue = temp.Accrue + g.AlignDate = temp.AlignDate + g.Prorate = temp.Prorate + return nil } diff --git a/models/group_settings.go b/models/group_settings.go index 2d9aa4e5..d21cf0b2 100644 --- a/models/group_settings.go +++ b/models/group_settings.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // GroupSettings represents a GroupSettings struct. type GroupSettings struct { - // Attributes of the target customer who will be the responsible payer of the created subscription. Required. - Target GroupTarget `json:"target"` - // Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. - Billing *GroupBilling `json:"billing,omitempty"` + // Attributes of the target customer who will be the responsible payer of the created subscription. Required. + Target GroupTarget `json:"target"` + // Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. + Billing *GroupBilling `json:"billing,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for GroupSettings. +// MarshalJSON implements the json.Marshaler interface for GroupSettings. // It customizes the JSON marshaling process for GroupSettings objects. func (g *GroupSettings) MarshalJSON() ( - []byte, - error) { - return json.Marshal(g.toMap()) + []byte, + error) { + return json.Marshal(g.toMap()) } // toMap converts the GroupSettings object to a map representation for JSON marshaling. func (g *GroupSettings) toMap() map[string]any { - structMap := make(map[string]any) - structMap["target"] = g.Target - if g.Billing != nil { - structMap["billing"] = g.Billing - } - return structMap + structMap := make(map[string]any) + structMap["target"] = g.Target.toMap() + if g.Billing != nil { + structMap["billing"] = g.Billing.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for GroupSettings. +// UnmarshalJSON implements the json.Unmarshaler interface for GroupSettings. // It customizes the JSON unmarshaling process for GroupSettings objects. func (g *GroupSettings) UnmarshalJSON(input []byte) error { - temp := &struct { - Target GroupTarget `json:"target"` - Billing *GroupBilling `json:"billing,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - g.Target = temp.Target - g.Billing = temp.Billing - return nil + temp := &struct { + Target GroupTarget `json:"target"` + Billing *GroupBilling `json:"billing,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + g.Target = temp.Target + g.Billing = temp.Billing + return nil } diff --git a/models/group_target.go b/models/group_target.go index 84c68e21..00735fa5 100644 --- a/models/group_target.go +++ b/models/group_target.go @@ -1,49 +1,49 @@ package models import ( - "encoding/json" + "encoding/json" ) -// GroupTarget represents a GroupTarget struct. +// GroupTarget represents a GroupTarget struct. // Attributes of the target customer who will be the responsible payer of the created subscription. Required. type GroupTarget struct { - // The type of object indicated by the id attribute. - Type GroupTargetType `json:"type"` - // The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" - Id *int `json:"id,omitempty"` + // The type of object indicated by the id attribute. + Type GroupTargetType `json:"type"` + // The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" + Id *int `json:"id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for GroupTarget. +// MarshalJSON implements the json.Marshaler interface for GroupTarget. // It customizes the JSON marshaling process for GroupTarget objects. func (g *GroupTarget) MarshalJSON() ( - []byte, - error) { - return json.Marshal(g.toMap()) + []byte, + error) { + return json.Marshal(g.toMap()) } // toMap converts the GroupTarget object to a map representation for JSON marshaling. func (g *GroupTarget) toMap() map[string]any { - structMap := make(map[string]any) - structMap["type"] = g.Type - if g.Id != nil { - structMap["id"] = g.Id - } - return structMap + structMap := make(map[string]any) + structMap["type"] = g.Type + if g.Id != nil { + structMap["id"] = g.Id + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for GroupTarget. +// UnmarshalJSON implements the json.Unmarshaler interface for GroupTarget. // It customizes the JSON unmarshaling process for GroupTarget objects. func (g *GroupTarget) UnmarshalJSON(input []byte) error { - temp := &struct { - Type GroupTargetType `json:"type"` - Id *int `json:"id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - g.Type = temp.Type - g.Id = temp.Id - return nil + temp := &struct { + Type GroupTargetType `json:"type"` + Id *int `json:"id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + g.Type = temp.Type + g.Id = temp.Id + return nil } diff --git a/models/invoice.go b/models/invoice.go index ed2c859e..dc826aae 100644 --- a/models/invoice.go +++ b/models/invoice.go @@ -1,436 +1,436 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // Invoice represents a Invoice struct. type Invoice struct { - Id *int64 `json:"id,omitempty"` - // Unique identifier for the invoice. It is generated automatically by Chargify and has the prefix "inv_" followed by alphanumeric characters. - Uid *string `json:"uid,omitempty"` - // ID of the site to which the invoice belongs. - SiteId *int `json:"site_id,omitempty"` - // ID of the customer to which the invoice belongs. - CustomerId *int `json:"customer_id,omitempty"` - // ID of the subscription that generated the invoice. - SubscriptionId *int `json:"subscription_id,omitempty"` - // 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. - Number *string `json:"number,omitempty"` - // 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. - SequenceNumber *int `json:"sequence_number,omitempty"` - TransactionTime *time.Time `json:"transaction_time,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // 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"`. - IssueDate *time.Time `json:"issue_date,omitempty"` - // Date the invoice is due. - // The format is `"YYYY-MM-DD"`. - DueDate *time.Time `json:"due_date,omitempty"` - // 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"`. - PaidDate Optional[time.Time] `json:"paid_date"` - // The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. - Status *InvoiceStatus `json:"status,omitempty"` - Role *string `json:"role,omitempty"` - ParentInvoiceId Optional[int] `json:"parent_invoice_id"` - // The collection method of the invoice, which is either "automatic" (tried and retried on an existing payment method by Chargify) or "remittance" (payment must be remitted by the customer or keyed in by the merchant). - CollectionMethod *string `json:"collection_method,omitempty"` - // 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. - PaymentInstructions *string `json:"payment_instructions,omitempty"` - // The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. - Currency *string `json:"currency,omitempty"` - // 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). - ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` - // For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. - ParentInvoiceUid Optional[string] `json:"parent_invoice_uid"` - SubscriptionGroupId Optional[int] `json:"subscription_group_id"` - // For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. - ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` - // For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice. - GroupPrimarySubscriptionId Optional[int] `json:"group_primary_subscription_id"` - // The name of the product subscribed when the invoice was generated. - ProductName *string `json:"product_name,omitempty"` - // The name of the product family subscribed when the invoice was generated. - ProductFamilyName *string `json:"product_family_name,omitempty"` - // Information about the seller (merchant) listed on the masthead of the invoice. - Seller *InvoiceSeller `json:"seller,omitempty"` - // Information about the customer who is owner or recipient the invoiced subscription. - Customer *InvoiceCustomer `json:"customer,omitempty"` - Payer *InvoicePayer `json:"payer,omitempty"` - RecipientEmails []string `json:"recipient_emails,omitempty"` - NetTerms *int `json:"net_terms,omitempty"` - // The memo printed on invoices of any collection type. This message is in control of the merchant. - Memo *string `json:"memo,omitempty"` - // The invoice billing address. - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - // The invoice shipping address. - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - // Subtotal of the invoice, which is the sum of all line items before discounts or taxes. - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - // Total discount applied to the invoice. - DiscountAmount *string `json:"discount_amount,omitempty"` - // Total tax on the invoice. - TaxAmount *string `json:"tax_amount,omitempty"` - // The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' - TotalAmount *string `json:"total_amount,omitempty"` - // The amount of credit (from credit notes) applied to this invoice. - // Credits offset the amount due from the customer. - CreditAmount *string `json:"credit_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - // The amount paid on the invoice by the customer. - PaidAmount *string `json:"paid_amount,omitempty"` - // Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. - DueAmount *string `json:"due_amount,omitempty"` - // Line items on the invoice. - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Credits []InvoiceCredit `json:"credits,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - Payments []InvoicePayment `json:"payments,omitempty"` - CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` - DisplaySettings *InvoiceDisplaySettings `json:"display_settings,omitempty"` - // The public URL of the invoice - PublicUrl *string `json:"public_url,omitempty"` - PreviousBalanceData *InvoicePreviousBalance `json:"previous_balance_data,omitempty"` + Id *int64 `json:"id,omitempty"` + // Unique identifier for the invoice. It is generated automatically by Chargify and has the prefix "inv_" followed by alphanumeric characters. + Uid *string `json:"uid,omitempty"` + // ID of the site to which the invoice belongs. + SiteId *int `json:"site_id,omitempty"` + // ID of the customer to which the invoice belongs. + CustomerId *int `json:"customer_id,omitempty"` + // ID of the subscription that generated the invoice. + SubscriptionId *int `json:"subscription_id,omitempty"` + // 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. + Number *string `json:"number,omitempty"` + // 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. + SequenceNumber *int `json:"sequence_number,omitempty"` + TransactionTime *time.Time `json:"transaction_time,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // 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"`. + IssueDate *time.Time `json:"issue_date,omitempty"` + // Date the invoice is due. + // The format is `"YYYY-MM-DD"`. + DueDate *time.Time `json:"due_date,omitempty"` + // 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"`. + PaidDate Optional[time.Time] `json:"paid_date"` + // The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. + Status *InvoiceStatus `json:"status,omitempty"` + Role *InvoiceRole `json:"role,omitempty"` + ParentInvoiceId Optional[int] `json:"parent_invoice_id"` + // 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`. + CollectionMethod *CollectionMethod `json:"collection_method,omitempty"` + // 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. + PaymentInstructions *string `json:"payment_instructions,omitempty"` + // The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. + Currency *string `json:"currency,omitempty"` + // 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). + ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` + // For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. + ParentInvoiceUid Optional[string] `json:"parent_invoice_uid"` + SubscriptionGroupId Optional[int] `json:"subscription_group_id"` + // For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. + ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` + // For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice. + GroupPrimarySubscriptionId Optional[int] `json:"group_primary_subscription_id"` + // The name of the product subscribed when the invoice was generated. + ProductName *string `json:"product_name,omitempty"` + // The name of the product family subscribed when the invoice was generated. + ProductFamilyName *string `json:"product_family_name,omitempty"` + // Information about the seller (merchant) listed on the masthead of the invoice. + Seller *InvoiceSeller `json:"seller,omitempty"` + // Information about the customer who is owner or recipient the invoiced subscription. + Customer *InvoiceCustomer `json:"customer,omitempty"` + Payer *InvoicePayer `json:"payer,omitempty"` + RecipientEmails []string `json:"recipient_emails,omitempty"` + NetTerms *int `json:"net_terms,omitempty"` + // The memo printed on invoices of any collection type. This message is in control of the merchant. + Memo *string `json:"memo,omitempty"` + // The invoice billing address. + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + // The invoice shipping address. + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + // Subtotal of the invoice, which is the sum of all line items before discounts or taxes. + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + // Total discount applied to the invoice. + DiscountAmount *string `json:"discount_amount,omitempty"` + // Total tax on the invoice. + TaxAmount *string `json:"tax_amount,omitempty"` + // The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' + TotalAmount *string `json:"total_amount,omitempty"` + // The amount of credit (from credit notes) applied to this invoice. + // Credits offset the amount due from the customer. + CreditAmount *string `json:"credit_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + // The amount paid on the invoice by the customer. + PaidAmount *string `json:"paid_amount,omitempty"` + // Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. + DueAmount *string `json:"due_amount,omitempty"` + // Line items on the invoice. + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Credits []InvoiceCredit `json:"credits,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + Payments []InvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + DisplaySettings *InvoiceDisplaySettings `json:"display_settings,omitempty"` + // The public URL of the invoice + PublicUrl *string `json:"public_url,omitempty"` + PreviousBalanceData *InvoicePreviousBalance `json:"previous_balance_data,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Invoice. +// MarshalJSON implements the json.Marshaler interface for Invoice. // It customizes the JSON marshaling process for Invoice objects. func (i *Invoice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the Invoice object to a map representation for JSON marshaling. func (i *Invoice) toMap() map[string]any { - structMap := make(map[string]any) - if i.Id != nil { - structMap["id"] = i.Id - } - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.SiteId != nil { - structMap["site_id"] = i.SiteId - } - if i.CustomerId != nil { - structMap["customer_id"] = i.CustomerId - } - if i.SubscriptionId != nil { - structMap["subscription_id"] = i.SubscriptionId - } - if i.Number != nil { - structMap["number"] = i.Number - } - if i.SequenceNumber != nil { - structMap["sequence_number"] = i.SequenceNumber - } - if i.TransactionTime != nil { - structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) - } - if i.CreatedAt != nil { - structMap["created_at"] = i.CreatedAt.Format(time.RFC3339) - } - if i.UpdatedAt != nil { - structMap["updated_at"] = i.UpdatedAt.Format(time.RFC3339) - } - if i.IssueDate != nil { - structMap["issue_date"] = i.IssueDate.Format(DEFAULT_DATE) - } - if i.DueDate != nil { - structMap["due_date"] = i.DueDate.Format(DEFAULT_DATE) - } - if i.PaidDate.IsValueSet() { - var PaidDateVal *string = nil - if i.PaidDate.Value() != nil { - val := i.PaidDate.Value().Format(DEFAULT_DATE) - PaidDateVal = &val - } - structMap["paid_date"] = PaidDateVal - } - if i.Status != nil { - structMap["status"] = i.Status - } - if i.Role != nil { - structMap["role"] = i.Role - } - if i.ParentInvoiceId.IsValueSet() { - structMap["parent_invoice_id"] = i.ParentInvoiceId.Value() - } - if i.CollectionMethod != nil { - structMap["collection_method"] = i.CollectionMethod - } - if i.PaymentInstructions != nil { - structMap["payment_instructions"] = i.PaymentInstructions - } - if i.Currency != nil { - structMap["currency"] = i.Currency - } - if i.ConsolidationLevel != nil { - structMap["consolidation_level"] = i.ConsolidationLevel - } - if i.ParentInvoiceUid.IsValueSet() { - structMap["parent_invoice_uid"] = i.ParentInvoiceUid.Value() - } - if i.SubscriptionGroupId.IsValueSet() { - structMap["subscription_group_id"] = i.SubscriptionGroupId.Value() - } - if i.ParentInvoiceNumber.IsValueSet() { - structMap["parent_invoice_number"] = i.ParentInvoiceNumber.Value() - } - if i.GroupPrimarySubscriptionId.IsValueSet() { - structMap["group_primary_subscription_id"] = i.GroupPrimarySubscriptionId.Value() - } - if i.ProductName != nil { - structMap["product_name"] = i.ProductName - } - if i.ProductFamilyName != nil { - structMap["product_family_name"] = i.ProductFamilyName - } - if i.Seller != nil { - structMap["seller"] = i.Seller - } - if i.Customer != nil { - structMap["customer"] = i.Customer - } - if i.Payer != nil { - structMap["payer"] = i.Payer - } - if i.RecipientEmails != nil { - structMap["recipient_emails"] = i.RecipientEmails - } - if i.NetTerms != nil { - structMap["net_terms"] = i.NetTerms - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.BillingAddress != nil { - structMap["billing_address"] = i.BillingAddress - } - if i.ShippingAddress != nil { - structMap["shipping_address"] = i.ShippingAddress - } - if i.SubtotalAmount != nil { - structMap["subtotal_amount"] = i.SubtotalAmount - } - if i.DiscountAmount != nil { - structMap["discount_amount"] = i.DiscountAmount - } - if i.TaxAmount != nil { - structMap["tax_amount"] = i.TaxAmount - } - if i.TotalAmount != nil { - structMap["total_amount"] = i.TotalAmount - } - if i.CreditAmount != nil { - structMap["credit_amount"] = i.CreditAmount - } - if i.RefundAmount != nil { - structMap["refund_amount"] = i.RefundAmount - } - if i.PaidAmount != nil { - structMap["paid_amount"] = i.PaidAmount - } - if i.DueAmount != nil { - structMap["due_amount"] = i.DueAmount - } - if i.LineItems != nil { - structMap["line_items"] = i.LineItems - } - if i.Discounts != nil { - structMap["discounts"] = i.Discounts - } - if i.Taxes != nil { - structMap["taxes"] = i.Taxes - } - if i.Credits != nil { - structMap["credits"] = i.Credits - } - if i.Refunds != nil { - structMap["refunds"] = i.Refunds - } - if i.Payments != nil { - structMap["payments"] = i.Payments - } - if i.CustomFields != nil { - structMap["custom_fields"] = i.CustomFields - } - if i.DisplaySettings != nil { - structMap["display_settings"] = i.DisplaySettings - } - if i.PublicUrl != nil { - structMap["public_url"] = i.PublicUrl - } - if i.PreviousBalanceData != nil { - structMap["previous_balance_data"] = i.PreviousBalanceData - } - return structMap + structMap := make(map[string]any) + if i.Id != nil { + structMap["id"] = i.Id + } + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.SiteId != nil { + structMap["site_id"] = i.SiteId + } + if i.CustomerId != nil { + structMap["customer_id"] = i.CustomerId + } + if i.SubscriptionId != nil { + structMap["subscription_id"] = i.SubscriptionId + } + if i.Number != nil { + structMap["number"] = i.Number + } + if i.SequenceNumber != nil { + structMap["sequence_number"] = i.SequenceNumber + } + if i.TransactionTime != nil { + structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) + } + if i.CreatedAt != nil { + structMap["created_at"] = i.CreatedAt.Format(time.RFC3339) + } + if i.UpdatedAt != nil { + structMap["updated_at"] = i.UpdatedAt.Format(time.RFC3339) + } + if i.IssueDate != nil { + structMap["issue_date"] = i.IssueDate.Format(DEFAULT_DATE) + } + if i.DueDate != nil { + structMap["due_date"] = i.DueDate.Format(DEFAULT_DATE) + } + if i.PaidDate.IsValueSet() { + var PaidDateVal *string = nil + if i.PaidDate.Value() != nil { + val := i.PaidDate.Value().Format(DEFAULT_DATE) + PaidDateVal = &val + } + structMap["paid_date"] = PaidDateVal + } + if i.Status != nil { + structMap["status"] = i.Status + } + if i.Role != nil { + structMap["role"] = i.Role + } + if i.ParentInvoiceId.IsValueSet() { + structMap["parent_invoice_id"] = i.ParentInvoiceId.Value() + } + if i.CollectionMethod != nil { + structMap["collection_method"] = i.CollectionMethod + } + if i.PaymentInstructions != nil { + structMap["payment_instructions"] = i.PaymentInstructions + } + if i.Currency != nil { + structMap["currency"] = i.Currency + } + if i.ConsolidationLevel != nil { + structMap["consolidation_level"] = i.ConsolidationLevel + } + if i.ParentInvoiceUid.IsValueSet() { + structMap["parent_invoice_uid"] = i.ParentInvoiceUid.Value() + } + if i.SubscriptionGroupId.IsValueSet() { + structMap["subscription_group_id"] = i.SubscriptionGroupId.Value() + } + if i.ParentInvoiceNumber.IsValueSet() { + structMap["parent_invoice_number"] = i.ParentInvoiceNumber.Value() + } + if i.GroupPrimarySubscriptionId.IsValueSet() { + structMap["group_primary_subscription_id"] = i.GroupPrimarySubscriptionId.Value() + } + if i.ProductName != nil { + structMap["product_name"] = i.ProductName + } + if i.ProductFamilyName != nil { + structMap["product_family_name"] = i.ProductFamilyName + } + if i.Seller != nil { + structMap["seller"] = i.Seller.toMap() + } + if i.Customer != nil { + structMap["customer"] = i.Customer.toMap() + } + if i.Payer != nil { + structMap["payer"] = i.Payer.toMap() + } + if i.RecipientEmails != nil { + structMap["recipient_emails"] = i.RecipientEmails + } + if i.NetTerms != nil { + structMap["net_terms"] = i.NetTerms + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.BillingAddress != nil { + structMap["billing_address"] = i.BillingAddress.toMap() + } + if i.ShippingAddress != nil { + structMap["shipping_address"] = i.ShippingAddress.toMap() + } + if i.SubtotalAmount != nil { + structMap["subtotal_amount"] = i.SubtotalAmount + } + if i.DiscountAmount != nil { + structMap["discount_amount"] = i.DiscountAmount + } + if i.TaxAmount != nil { + structMap["tax_amount"] = i.TaxAmount + } + if i.TotalAmount != nil { + structMap["total_amount"] = i.TotalAmount + } + if i.CreditAmount != nil { + structMap["credit_amount"] = i.CreditAmount + } + if i.RefundAmount != nil { + structMap["refund_amount"] = i.RefundAmount + } + if i.PaidAmount != nil { + structMap["paid_amount"] = i.PaidAmount + } + if i.DueAmount != nil { + structMap["due_amount"] = i.DueAmount + } + if i.LineItems != nil { + structMap["line_items"] = i.LineItems + } + if i.Discounts != nil { + structMap["discounts"] = i.Discounts + } + if i.Taxes != nil { + structMap["taxes"] = i.Taxes + } + if i.Credits != nil { + structMap["credits"] = i.Credits + } + if i.Refunds != nil { + structMap["refunds"] = i.Refunds + } + if i.Payments != nil { + structMap["payments"] = i.Payments + } + if i.CustomFields != nil { + structMap["custom_fields"] = i.CustomFields + } + if i.DisplaySettings != nil { + structMap["display_settings"] = i.DisplaySettings.toMap() + } + if i.PublicUrl != nil { + structMap["public_url"] = i.PublicUrl + } + if i.PreviousBalanceData != nil { + structMap["previous_balance_data"] = i.PreviousBalanceData.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Invoice. +// UnmarshalJSON implements the json.Unmarshaler interface for Invoice. // It customizes the JSON unmarshaling process for Invoice objects. func (i *Invoice) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int64 `json:"id,omitempty"` - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *string `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - TransactionTime *string `json:"transaction_time,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - IssueDate *string `json:"issue_date,omitempty"` - DueDate *string `json:"due_date,omitempty"` - PaidDate Optional[string] `json:"paid_date"` - Status *InvoiceStatus `json:"status,omitempty"` - Role *string `json:"role,omitempty"` - ParentInvoiceId Optional[int] `json:"parent_invoice_id"` - CollectionMethod *string `json:"collection_method,omitempty"` - PaymentInstructions *string `json:"payment_instructions,omitempty"` - Currency *string `json:"currency,omitempty"` - ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` - ParentInvoiceUid Optional[string] `json:"parent_invoice_uid"` - SubscriptionGroupId Optional[int] `json:"subscription_group_id"` - ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` - GroupPrimarySubscriptionId Optional[int] `json:"group_primary_subscription_id"` - ProductName *string `json:"product_name,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - Seller *InvoiceSeller `json:"seller,omitempty"` - Customer *InvoiceCustomer `json:"customer,omitempty"` - Payer *InvoicePayer `json:"payer,omitempty"` - RecipientEmails []string `json:"recipient_emails,omitempty"` - NetTerms *int `json:"net_terms,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CreditAmount *string `json:"credit_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []InvoiceDiscount `json:"discounts,omitempty"` - Taxes []InvoiceTax `json:"taxes,omitempty"` - Credits []InvoiceCredit `json:"credits,omitempty"` - Refunds []InvoiceRefund `json:"refunds,omitempty"` - Payments []InvoicePayment `json:"payments,omitempty"` - CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` - DisplaySettings *InvoiceDisplaySettings `json:"display_settings,omitempty"` - PublicUrl *string `json:"public_url,omitempty"` - PreviousBalanceData *InvoicePreviousBalance `json:"previous_balance_data,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Id = temp.Id - i.Uid = temp.Uid - i.SiteId = temp.SiteId - i.CustomerId = temp.CustomerId - i.SubscriptionId = temp.SubscriptionId - i.Number = temp.Number - i.SequenceNumber = temp.SequenceNumber - if temp.TransactionTime != nil { - TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) - if err != nil { - log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) - } - i.TransactionTime = &TransactionTimeVal - } - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - i.CreatedAt = &CreatedAtVal - } - if temp.UpdatedAt != nil { - UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) - if err != nil { - log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) - } - i.UpdatedAt = &UpdatedAtVal - } - if temp.IssueDate != nil { - IssueDateVal, err := time.Parse(DEFAULT_DATE, *temp.IssueDate) - if err != nil { - log.Fatalf("Cannot Parse issue_date as % s format.", DEFAULT_DATE) - } - i.IssueDate = &IssueDateVal - } - if temp.DueDate != nil { - DueDateVal, err := time.Parse(DEFAULT_DATE, *temp.DueDate) - if err != nil { - log.Fatalf("Cannot Parse due_date as % s format.", DEFAULT_DATE) - } - i.DueDate = &DueDateVal - } - i.PaidDate.ShouldSetValue(temp.PaidDate.IsValueSet()) - if temp.PaidDate.Value() != nil { - PaidDateVal, err := time.Parse(DEFAULT_DATE, (*temp.PaidDate.Value())) - if err != nil { - log.Fatalf("Cannot Parse paid_date as % s format.", DEFAULT_DATE) - } - i.PaidDate.SetValue(&PaidDateVal) - } - i.Status = temp.Status - i.Role = temp.Role - i.ParentInvoiceId = temp.ParentInvoiceId - i.CollectionMethod = temp.CollectionMethod - i.PaymentInstructions = temp.PaymentInstructions - i.Currency = temp.Currency - i.ConsolidationLevel = temp.ConsolidationLevel - i.ParentInvoiceUid = temp.ParentInvoiceUid - i.SubscriptionGroupId = temp.SubscriptionGroupId - i.ParentInvoiceNumber = temp.ParentInvoiceNumber - i.GroupPrimarySubscriptionId = temp.GroupPrimarySubscriptionId - i.ProductName = temp.ProductName - i.ProductFamilyName = temp.ProductFamilyName - i.Seller = temp.Seller - i.Customer = temp.Customer - i.Payer = temp.Payer - i.RecipientEmails = temp.RecipientEmails - i.NetTerms = temp.NetTerms - i.Memo = temp.Memo - i.BillingAddress = temp.BillingAddress - i.ShippingAddress = temp.ShippingAddress - i.SubtotalAmount = temp.SubtotalAmount - i.DiscountAmount = temp.DiscountAmount - i.TaxAmount = temp.TaxAmount - i.TotalAmount = temp.TotalAmount - i.CreditAmount = temp.CreditAmount - i.RefundAmount = temp.RefundAmount - i.PaidAmount = temp.PaidAmount - i.DueAmount = temp.DueAmount - i.LineItems = temp.LineItems - i.Discounts = temp.Discounts - i.Taxes = temp.Taxes - i.Credits = temp.Credits - i.Refunds = temp.Refunds - i.Payments = temp.Payments - i.CustomFields = temp.CustomFields - i.DisplaySettings = temp.DisplaySettings - i.PublicUrl = temp.PublicUrl - i.PreviousBalanceData = temp.PreviousBalanceData - return nil + temp := &struct { + Id *int64 `json:"id,omitempty"` + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *string `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + TransactionTime *string `json:"transaction_time,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + IssueDate *string `json:"issue_date,omitempty"` + DueDate *string `json:"due_date,omitempty"` + PaidDate Optional[string] `json:"paid_date"` + Status *InvoiceStatus `json:"status,omitempty"` + Role *InvoiceRole `json:"role,omitempty"` + ParentInvoiceId Optional[int] `json:"parent_invoice_id"` + CollectionMethod *CollectionMethod `json:"collection_method,omitempty"` + PaymentInstructions *string `json:"payment_instructions,omitempty"` + Currency *string `json:"currency,omitempty"` + ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` + ParentInvoiceUid Optional[string] `json:"parent_invoice_uid"` + SubscriptionGroupId Optional[int] `json:"subscription_group_id"` + ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` + GroupPrimarySubscriptionId Optional[int] `json:"group_primary_subscription_id"` + ProductName *string `json:"product_name,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + Seller *InvoiceSeller `json:"seller,omitempty"` + Customer *InvoiceCustomer `json:"customer,omitempty"` + Payer *InvoicePayer `json:"payer,omitempty"` + RecipientEmails []string `json:"recipient_emails,omitempty"` + NetTerms *int `json:"net_terms,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CreditAmount *string `json:"credit_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []InvoiceDiscount `json:"discounts,omitempty"` + Taxes []InvoiceTax `json:"taxes,omitempty"` + Credits []InvoiceCredit `json:"credits,omitempty"` + Refunds []InvoiceRefund `json:"refunds,omitempty"` + Payments []InvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + DisplaySettings *InvoiceDisplaySettings `json:"display_settings,omitempty"` + PublicUrl *string `json:"public_url,omitempty"` + PreviousBalanceData *InvoicePreviousBalance `json:"previous_balance_data,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Id = temp.Id + i.Uid = temp.Uid + i.SiteId = temp.SiteId + i.CustomerId = temp.CustomerId + i.SubscriptionId = temp.SubscriptionId + i.Number = temp.Number + i.SequenceNumber = temp.SequenceNumber + if temp.TransactionTime != nil { + TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) + if err != nil { + log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) + } + i.TransactionTime = &TransactionTimeVal + } + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + i.CreatedAt = &CreatedAtVal + } + if temp.UpdatedAt != nil { + UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) + if err != nil { + log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) + } + i.UpdatedAt = &UpdatedAtVal + } + if temp.IssueDate != nil { + IssueDateVal, err := time.Parse(DEFAULT_DATE, *temp.IssueDate) + if err != nil { + log.Fatalf("Cannot Parse issue_date as % s format.", DEFAULT_DATE) + } + i.IssueDate = &IssueDateVal + } + if temp.DueDate != nil { + DueDateVal, err := time.Parse(DEFAULT_DATE, *temp.DueDate) + if err != nil { + log.Fatalf("Cannot Parse due_date as % s format.", DEFAULT_DATE) + } + i.DueDate = &DueDateVal + } + i.PaidDate.ShouldSetValue(temp.PaidDate.IsValueSet()) + if temp.PaidDate.Value() != nil { + PaidDateVal, err := time.Parse(DEFAULT_DATE, (*temp.PaidDate.Value())) + if err != nil { + log.Fatalf("Cannot Parse paid_date as % s format.", DEFAULT_DATE) + } + i.PaidDate.SetValue(&PaidDateVal) + } + i.Status = temp.Status + i.Role = temp.Role + i.ParentInvoiceId = temp.ParentInvoiceId + i.CollectionMethod = temp.CollectionMethod + i.PaymentInstructions = temp.PaymentInstructions + i.Currency = temp.Currency + i.ConsolidationLevel = temp.ConsolidationLevel + i.ParentInvoiceUid = temp.ParentInvoiceUid + i.SubscriptionGroupId = temp.SubscriptionGroupId + i.ParentInvoiceNumber = temp.ParentInvoiceNumber + i.GroupPrimarySubscriptionId = temp.GroupPrimarySubscriptionId + i.ProductName = temp.ProductName + i.ProductFamilyName = temp.ProductFamilyName + i.Seller = temp.Seller + i.Customer = temp.Customer + i.Payer = temp.Payer + i.RecipientEmails = temp.RecipientEmails + i.NetTerms = temp.NetTerms + i.Memo = temp.Memo + i.BillingAddress = temp.BillingAddress + i.ShippingAddress = temp.ShippingAddress + i.SubtotalAmount = temp.SubtotalAmount + i.DiscountAmount = temp.DiscountAmount + i.TaxAmount = temp.TaxAmount + i.TotalAmount = temp.TotalAmount + i.CreditAmount = temp.CreditAmount + i.RefundAmount = temp.RefundAmount + i.PaidAmount = temp.PaidAmount + i.DueAmount = temp.DueAmount + i.LineItems = temp.LineItems + i.Discounts = temp.Discounts + i.Taxes = temp.Taxes + i.Credits = temp.Credits + i.Refunds = temp.Refunds + i.Payments = temp.Payments + i.CustomFields = temp.CustomFields + i.DisplaySettings = temp.DisplaySettings + i.PublicUrl = temp.PublicUrl + i.PreviousBalanceData = temp.PreviousBalanceData + return nil } diff --git a/models/invoice_address.go b/models/invoice_address.go index 8858fb8a..9bf32367 100644 --- a/models/invoice_address.go +++ b/models/invoice_address.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceAddress represents a InvoiceAddress struct. type InvoiceAddress struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceAddress. +// MarshalJSON implements the json.Marshaler interface for InvoiceAddress. // It customizes the JSON marshaling process for InvoiceAddress objects. func (i *InvoiceAddress) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceAddress object to a map representation for JSON marshaling. func (i *InvoiceAddress) toMap() map[string]any { - structMap := make(map[string]any) - if i.Street.IsValueSet() { - structMap["street"] = i.Street.Value() - } - if i.Line2.IsValueSet() { - structMap["line2"] = i.Line2.Value() - } - if i.City.IsValueSet() { - structMap["city"] = i.City.Value() - } - if i.State.IsValueSet() { - structMap["state"] = i.State.Value() - } - if i.Zip.IsValueSet() { - structMap["zip"] = i.Zip.Value() - } - if i.Country.IsValueSet() { - structMap["country"] = i.Country.Value() - } - return structMap + structMap := make(map[string]any) + if i.Street.IsValueSet() { + structMap["street"] = i.Street.Value() + } + if i.Line2.IsValueSet() { + structMap["line2"] = i.Line2.Value() + } + if i.City.IsValueSet() { + structMap["city"] = i.City.Value() + } + if i.State.IsValueSet() { + structMap["state"] = i.State.Value() + } + if i.Zip.IsValueSet() { + structMap["zip"] = i.Zip.Value() + } + if i.Country.IsValueSet() { + structMap["country"] = i.Country.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceAddress. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceAddress. // It customizes the JSON unmarshaling process for InvoiceAddress objects. func (i *InvoiceAddress) UnmarshalJSON(input []byte) error { - temp := &struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Street = temp.Street - i.Line2 = temp.Line2 - i.City = temp.City - i.State = temp.State - i.Zip = temp.Zip - i.Country = temp.Country - return nil + temp := &struct { + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Street = temp.Street + i.Line2 = temp.Line2 + i.City = temp.City + i.State = temp.State + i.Zip = temp.Zip + i.Country = temp.Country + return nil } diff --git a/models/invoice_balance_item.go b/models/invoice_balance_item.go index 306e12a9..afdd4ca0 100644 --- a/models/invoice_balance_item.go +++ b/models/invoice_balance_item.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceBalanceItem represents a InvoiceBalanceItem struct. type InvoiceBalanceItem struct { - Uid *string `json:"uid,omitempty"` - Number *string `json:"number,omitempty"` - OutstandingAmount *string `json:"outstanding_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + Number *string `json:"number,omitempty"` + OutstandingAmount *string `json:"outstanding_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceBalanceItem. +// MarshalJSON implements the json.Marshaler interface for InvoiceBalanceItem. // It customizes the JSON marshaling process for InvoiceBalanceItem objects. func (i *InvoiceBalanceItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceBalanceItem object to a map representation for JSON marshaling. func (i *InvoiceBalanceItem) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.Number != nil { - structMap["number"] = i.Number - } - if i.OutstandingAmount != nil { - structMap["outstanding_amount"] = i.OutstandingAmount - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.Number != nil { + structMap["number"] = i.Number + } + if i.OutstandingAmount != nil { + structMap["outstanding_amount"] = i.OutstandingAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceBalanceItem. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceBalanceItem. // It customizes the JSON unmarshaling process for InvoiceBalanceItem objects. func (i *InvoiceBalanceItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Number *string `json:"number,omitempty"` - OutstandingAmount *string `json:"outstanding_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.Number = temp.Number - i.OutstandingAmount = temp.OutstandingAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Number *string `json:"number,omitempty"` + OutstandingAmount *string `json:"outstanding_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.Number = temp.Number + i.OutstandingAmount = temp.OutstandingAmount + return nil } diff --git a/models/invoice_credit.go b/models/invoice_credit.go index 48c97cd0..48fbfbef 100644 --- a/models/invoice_credit.go +++ b/models/invoice_credit.go @@ -1,86 +1,86 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // InvoiceCredit represents a InvoiceCredit struct. type InvoiceCredit struct { - Uid *string `json:"uid,omitempty"` - CreditNoteNumber *string `json:"credit_note_number,omitempty"` - CreditNoteUid *string `json:"credit_note_uid,omitempty"` - TransactionTime *time.Time `json:"transaction_time,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + CreditNoteNumber *string `json:"credit_note_number,omitempty"` + CreditNoteUid *string `json:"credit_note_uid,omitempty"` + TransactionTime *time.Time `json:"transaction_time,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceCredit. +// MarshalJSON implements the json.Marshaler interface for InvoiceCredit. // It customizes the JSON marshaling process for InvoiceCredit objects. func (i *InvoiceCredit) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceCredit object to a map representation for JSON marshaling. func (i *InvoiceCredit) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.CreditNoteNumber != nil { - structMap["credit_note_number"] = i.CreditNoteNumber - } - if i.CreditNoteUid != nil { - structMap["credit_note_uid"] = i.CreditNoteUid - } - if i.TransactionTime != nil { - structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.OriginalAmount != nil { - structMap["original_amount"] = i.OriginalAmount - } - if i.AppliedAmount != nil { - structMap["applied_amount"] = i.AppliedAmount - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.CreditNoteNumber != nil { + structMap["credit_note_number"] = i.CreditNoteNumber + } + if i.CreditNoteUid != nil { + structMap["credit_note_uid"] = i.CreditNoteUid + } + if i.TransactionTime != nil { + structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.OriginalAmount != nil { + structMap["original_amount"] = i.OriginalAmount + } + if i.AppliedAmount != nil { + structMap["applied_amount"] = i.AppliedAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCredit. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCredit. // It customizes the JSON unmarshaling process for InvoiceCredit objects. func (i *InvoiceCredit) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - CreditNoteNumber *string `json:"credit_note_number,omitempty"` - CreditNoteUid *string `json:"credit_note_uid,omitempty"` - TransactionTime *string `json:"transaction_time,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.CreditNoteNumber = temp.CreditNoteNumber - i.CreditNoteUid = temp.CreditNoteUid - if temp.TransactionTime != nil { - TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) - if err != nil { - log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) - } - i.TransactionTime = &TransactionTimeVal - } - i.Memo = temp.Memo - i.OriginalAmount = temp.OriginalAmount - i.AppliedAmount = temp.AppliedAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + CreditNoteNumber *string `json:"credit_note_number,omitempty"` + CreditNoteUid *string `json:"credit_note_uid,omitempty"` + TransactionTime *string `json:"transaction_time,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.CreditNoteNumber = temp.CreditNoteNumber + i.CreditNoteUid = temp.CreditNoteUid + if temp.TransactionTime != nil { + TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) + if err != nil { + log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) + } + i.TransactionTime = &TransactionTimeVal + } + i.Memo = temp.Memo + i.OriginalAmount = temp.OriginalAmount + i.AppliedAmount = temp.AppliedAmount + return nil } diff --git a/models/invoice_custom_field.go b/models/invoice_custom_field.go index 84f62ac5..14afddf0 100644 --- a/models/invoice_custom_field.go +++ b/models/invoice_custom_field.go @@ -1,60 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceCustomField represents a InvoiceCustomField struct. type InvoiceCustomField struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - OwnerId *int `json:"owner_id,omitempty"` - OwnerType *string `json:"owner_type,omitempty"` + OwnerId *int `json:"owner_id,omitempty"` + OwnerType *CustomFieldOwner `json:"owner_type,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + MetadatumId *int `json:"metadatum_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceCustomField. +// MarshalJSON implements the json.Marshaler interface for InvoiceCustomField. // It customizes the JSON marshaling process for InvoiceCustomField objects. func (i *InvoiceCustomField) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceCustomField object to a map representation for JSON marshaling. func (i *InvoiceCustomField) toMap() map[string]any { - structMap := make(map[string]any) - if i.Name != nil { - structMap["name"] = i.Name - } - if i.Value != nil { - structMap["value"] = i.Value - } - if i.OwnerId != nil { - structMap["owner_id"] = i.OwnerId - } - if i.OwnerType != nil { - structMap["owner_type"] = i.OwnerType - } - return structMap + structMap := make(map[string]any) + if i.OwnerId != nil { + structMap["owner_id"] = i.OwnerId + } + if i.OwnerType != nil { + structMap["owner_type"] = i.OwnerType + } + if i.Name != nil { + structMap["name"] = i.Name + } + if i.Value != nil { + structMap["value"] = i.Value + } + if i.MetadatumId != nil { + structMap["metadatum_id"] = i.MetadatumId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomField. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomField. // It customizes the JSON unmarshaling process for InvoiceCustomField objects. func (i *InvoiceCustomField) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - OwnerId *int `json:"owner_id,omitempty"` - OwnerType *string `json:"owner_type,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Name = temp.Name - i.Value = temp.Value - i.OwnerId = temp.OwnerId - i.OwnerType = temp.OwnerType - return nil + temp := &struct { + OwnerId *int `json:"owner_id,omitempty"` + OwnerType *CustomFieldOwner `json:"owner_type,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + MetadatumId *int `json:"metadatum_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.OwnerId = temp.OwnerId + i.OwnerType = temp.OwnerType + i.Name = temp.Name + i.Value = temp.Value + i.MetadatumId = temp.MetadatumId + return nil } diff --git a/models/invoice_customer.go b/models/invoice_customer.go index 1b036d97..4f89bd9e 100644 --- a/models/invoice_customer.go +++ b/models/invoice_customer.go @@ -1,79 +1,79 @@ package models import ( - "encoding/json" + "encoding/json" ) -// InvoiceCustomer represents a InvoiceCustomer struct. +// InvoiceCustomer represents a InvoiceCustomer struct. // Information about the customer who is owner or recipient the invoiced subscription. type InvoiceCustomer struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - Reference Optional[string] `json:"reference"` + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + Reference Optional[string] `json:"reference"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceCustomer. +// MarshalJSON implements the json.Marshaler interface for InvoiceCustomer. // It customizes the JSON marshaling process for InvoiceCustomer objects. func (i *InvoiceCustomer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceCustomer object to a map representation for JSON marshaling. func (i *InvoiceCustomer) toMap() map[string]any { - structMap := make(map[string]any) - if i.ChargifyId != nil { - structMap["chargify_id"] = i.ChargifyId - } - if i.FirstName != nil { - structMap["first_name"] = i.FirstName - } - if i.LastName != nil { - structMap["last_name"] = i.LastName - } - if i.Organization.IsValueSet() { - structMap["organization"] = i.Organization.Value() - } - if i.Email != nil { - structMap["email"] = i.Email - } - if i.VatNumber.IsValueSet() { - structMap["vat_number"] = i.VatNumber.Value() - } - if i.Reference.IsValueSet() { - structMap["reference"] = i.Reference.Value() - } - return structMap + structMap := make(map[string]any) + if i.ChargifyId != nil { + structMap["chargify_id"] = i.ChargifyId + } + if i.FirstName != nil { + structMap["first_name"] = i.FirstName + } + if i.LastName != nil { + structMap["last_name"] = i.LastName + } + if i.Organization.IsValueSet() { + structMap["organization"] = i.Organization.Value() + } + if i.Email != nil { + structMap["email"] = i.Email + } + if i.VatNumber.IsValueSet() { + structMap["vat_number"] = i.VatNumber.Value() + } + if i.Reference.IsValueSet() { + structMap["reference"] = i.Reference.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomer. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomer. // It customizes the JSON unmarshaling process for InvoiceCustomer objects. func (i *InvoiceCustomer) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - Reference Optional[string] `json:"reference"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.ChargifyId = temp.ChargifyId - i.FirstName = temp.FirstName - i.LastName = temp.LastName - i.Organization = temp.Organization - i.Email = temp.Email - i.VatNumber = temp.VatNumber - i.Reference = temp.Reference - return nil + temp := &struct { + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + Reference Optional[string] `json:"reference"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.ChargifyId = temp.ChargifyId + i.FirstName = temp.FirstName + i.LastName = temp.LastName + i.Organization = temp.Organization + i.Email = temp.Email + i.VatNumber = temp.VatNumber + i.Reference = temp.Reference + return nil } diff --git a/models/invoice_discount.go b/models/invoice_discount.go index 64999071..f2fbef25 100644 --- a/models/invoice_discount.go +++ b/models/invoice_discount.go @@ -1,108 +1,108 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceDiscount represents a InvoiceDiscount struct. type InvoiceDiscount struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description Optional[string] `json:"description"` - Code *string `json:"code,omitempty"` - SourceType *string `json:"source_type,omitempty"` - SourceId *int `json:"source_id,omitempty"` - DiscountType *string `json:"discount_type,omitempty"` - Percentage *string `json:"percentage,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - LineItemBreakouts []InvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description Optional[string] `json:"description"` + Code *string `json:"code,omitempty"` + SourceType *string `json:"source_type,omitempty"` + SourceId *int `json:"source_id,omitempty"` + DiscountType *string `json:"discount_type,omitempty"` + Percentage *string `json:"percentage,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + LineItemBreakouts []InvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceDiscount. +// MarshalJSON implements the json.Marshaler interface for InvoiceDiscount. // It customizes the JSON marshaling process for InvoiceDiscount objects. func (i *InvoiceDiscount) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceDiscount object to a map representation for JSON marshaling. func (i *InvoiceDiscount) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.Title != nil { - structMap["title"] = i.Title - } - if i.Description.IsValueSet() { - structMap["description"] = i.Description.Value() - } - if i.Code != nil { - structMap["code"] = i.Code - } - if i.SourceType != nil { - structMap["source_type"] = i.SourceType - } - if i.SourceId != nil { - structMap["source_id"] = i.SourceId - } - if i.DiscountType != nil { - structMap["discount_type"] = i.DiscountType - } - if i.Percentage != nil { - structMap["percentage"] = i.Percentage - } - if i.EligibleAmount != nil { - structMap["eligible_amount"] = i.EligibleAmount - } - if i.DiscountAmount != nil { - structMap["discount_amount"] = i.DiscountAmount - } - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.LineItemBreakouts != nil { - structMap["line_item_breakouts"] = i.LineItemBreakouts - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.Title != nil { + structMap["title"] = i.Title + } + if i.Description.IsValueSet() { + structMap["description"] = i.Description.Value() + } + if i.Code != nil { + structMap["code"] = i.Code + } + if i.SourceType != nil { + structMap["source_type"] = i.SourceType + } + if i.SourceId != nil { + structMap["source_id"] = i.SourceId + } + if i.DiscountType != nil { + structMap["discount_type"] = i.DiscountType + } + if i.Percentage != nil { + structMap["percentage"] = i.Percentage + } + if i.EligibleAmount != nil { + structMap["eligible_amount"] = i.EligibleAmount + } + if i.DiscountAmount != nil { + structMap["discount_amount"] = i.DiscountAmount + } + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.LineItemBreakouts != nil { + structMap["line_item_breakouts"] = i.LineItemBreakouts + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscount. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscount. // It customizes the JSON unmarshaling process for InvoiceDiscount objects. func (i *InvoiceDiscount) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description Optional[string] `json:"description"` - Code *string `json:"code,omitempty"` - SourceType *string `json:"source_type,omitempty"` - SourceId *int `json:"source_id,omitempty"` - DiscountType *string `json:"discount_type,omitempty"` - Percentage *string `json:"percentage,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - LineItemBreakouts []InvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.Title = temp.Title - i.Description = temp.Description - i.Code = temp.Code - i.SourceType = temp.SourceType - i.SourceId = temp.SourceId - i.DiscountType = temp.DiscountType - i.Percentage = temp.Percentage - i.EligibleAmount = temp.EligibleAmount - i.DiscountAmount = temp.DiscountAmount - i.TransactionId = temp.TransactionId - i.LineItemBreakouts = temp.LineItemBreakouts - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description Optional[string] `json:"description"` + Code *string `json:"code,omitempty"` + SourceType *string `json:"source_type,omitempty"` + SourceId *int `json:"source_id,omitempty"` + DiscountType *string `json:"discount_type,omitempty"` + Percentage *string `json:"percentage,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + LineItemBreakouts []InvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.Title = temp.Title + i.Description = temp.Description + i.Code = temp.Code + i.SourceType = temp.SourceType + i.SourceId = temp.SourceId + i.DiscountType = temp.DiscountType + i.Percentage = temp.Percentage + i.EligibleAmount = temp.EligibleAmount + i.DiscountAmount = temp.DiscountAmount + i.TransactionId = temp.TransactionId + i.LineItemBreakouts = temp.LineItemBreakouts + return nil } diff --git a/models/invoice_discount_breakout.go b/models/invoice_discount_breakout.go index 6666fe6e..0e61b367 100644 --- a/models/invoice_discount_breakout.go +++ b/models/invoice_discount_breakout.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceDiscountBreakout represents a InvoiceDiscountBreakout struct. type InvoiceDiscountBreakout struct { - Uid *string `json:"uid,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceDiscountBreakout. +// MarshalJSON implements the json.Marshaler interface for InvoiceDiscountBreakout. // It customizes the JSON marshaling process for InvoiceDiscountBreakout objects. func (i *InvoiceDiscountBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceDiscountBreakout object to a map representation for JSON marshaling. func (i *InvoiceDiscountBreakout) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.EligibleAmount != nil { - structMap["eligible_amount"] = i.EligibleAmount - } - if i.DiscountAmount != nil { - structMap["discount_amount"] = i.DiscountAmount - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.EligibleAmount != nil { + structMap["eligible_amount"] = i.EligibleAmount + } + if i.DiscountAmount != nil { + structMap["discount_amount"] = i.DiscountAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscountBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscountBreakout. // It customizes the JSON unmarshaling process for InvoiceDiscountBreakout objects. func (i *InvoiceDiscountBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.EligibleAmount = temp.EligibleAmount - i.DiscountAmount = temp.DiscountAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.EligibleAmount = temp.EligibleAmount + i.DiscountAmount = temp.DiscountAmount + return nil } diff --git a/models/invoice_display_settings.go b/models/invoice_display_settings.go index 4571ad28..9a464e12 100644 --- a/models/invoice_display_settings.go +++ b/models/invoice_display_settings.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceDisplaySettings represents a InvoiceDisplaySettings struct. type InvoiceDisplaySettings struct { - HideZeroSubtotalLines *bool `json:"hide_zero_subtotal_lines,omitempty"` - IncludeDiscountsOnLines *bool `json:"include_discounts_on_lines,omitempty"` + HideZeroSubtotalLines *bool `json:"hide_zero_subtotal_lines,omitempty"` + IncludeDiscountsOnLines *bool `json:"include_discounts_on_lines,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceDisplaySettings. +// MarshalJSON implements the json.Marshaler interface for InvoiceDisplaySettings. // It customizes the JSON marshaling process for InvoiceDisplaySettings objects. func (i *InvoiceDisplaySettings) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceDisplaySettings object to a map representation for JSON marshaling. func (i *InvoiceDisplaySettings) toMap() map[string]any { - structMap := make(map[string]any) - if i.HideZeroSubtotalLines != nil { - structMap["hide_zero_subtotal_lines"] = i.HideZeroSubtotalLines - } - if i.IncludeDiscountsOnLines != nil { - structMap["include_discounts_on_lines"] = i.IncludeDiscountsOnLines - } - return structMap + structMap := make(map[string]any) + if i.HideZeroSubtotalLines != nil { + structMap["hide_zero_subtotal_lines"] = i.HideZeroSubtotalLines + } + if i.IncludeDiscountsOnLines != nil { + structMap["include_discounts_on_lines"] = i.IncludeDiscountsOnLines + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDisplaySettings. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDisplaySettings. // It customizes the JSON unmarshaling process for InvoiceDisplaySettings objects. func (i *InvoiceDisplaySettings) UnmarshalJSON(input []byte) error { - temp := &struct { - HideZeroSubtotalLines *bool `json:"hide_zero_subtotal_lines,omitempty"` - IncludeDiscountsOnLines *bool `json:"include_discounts_on_lines,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.HideZeroSubtotalLines = temp.HideZeroSubtotalLines - i.IncludeDiscountsOnLines = temp.IncludeDiscountsOnLines - return nil + temp := &struct { + HideZeroSubtotalLines *bool `json:"hide_zero_subtotal_lines,omitempty"` + IncludeDiscountsOnLines *bool `json:"include_discounts_on_lines,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.HideZeroSubtotalLines = temp.HideZeroSubtotalLines + i.IncludeDiscountsOnLines = temp.IncludeDiscountsOnLines + return nil } diff --git a/models/invoice_event.go b/models/invoice_event.go index 931b118d..587cbfc7 100644 --- a/models/invoice_event.go +++ b/models/invoice_event.go @@ -1,68 +1,68 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceEvent represents a InvoiceEvent struct. type InvoiceEvent struct { - Id *int `json:"id,omitempty"` - // Invoice Event Type - EventType *InvoiceEventType `json:"event_type,omitempty"` - // The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. - EventData *InvoiceEvent1 `json:"event_data,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Invoice *Invoice `json:"invoice,omitempty"` + Id *int `json:"id,omitempty"` + // Invoice Event Type + EventType *InvoiceEventType `json:"event_type,omitempty"` + // The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. + EventData *InvoiceEventData `json:"event_data,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Invoice *Invoice `json:"invoice,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceEvent. +// MarshalJSON implements the json.Marshaler interface for InvoiceEvent. // It customizes the JSON marshaling process for InvoiceEvent objects. func (i *InvoiceEvent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceEvent object to a map representation for JSON marshaling. func (i *InvoiceEvent) toMap() map[string]any { - structMap := make(map[string]any) - if i.Id != nil { - structMap["id"] = i.Id - } - if i.EventType != nil { - structMap["event_type"] = i.EventType - } - if i.EventData != nil { - structMap["event_data"] = i.EventData - } - if i.Timestamp != nil { - structMap["timestamp"] = i.Timestamp - } - if i.Invoice != nil { - structMap["invoice"] = i.Invoice - } - return structMap + structMap := make(map[string]any) + if i.Id != nil { + structMap["id"] = i.Id + } + if i.EventType != nil { + structMap["event_type"] = i.EventType + } + if i.EventData != nil { + structMap["event_data"] = i.EventData.toMap() + } + if i.Timestamp != nil { + structMap["timestamp"] = i.Timestamp + } + if i.Invoice != nil { + structMap["invoice"] = i.Invoice.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEvent. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEvent. // It customizes the JSON unmarshaling process for InvoiceEvent objects. func (i *InvoiceEvent) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - EventType *InvoiceEventType `json:"event_type,omitempty"` - EventData *InvoiceEvent1 `json:"event_data,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Invoice *Invoice `json:"invoice,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Id = temp.Id - i.EventType = temp.EventType - i.EventData = temp.EventData - i.Timestamp = temp.Timestamp - i.Invoice = temp.Invoice - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + EventType *InvoiceEventType `json:"event_type,omitempty"` + EventData *InvoiceEventData `json:"event_data,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Invoice *Invoice `json:"invoice,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Id = temp.Id + i.EventType = temp.EventType + i.EventData = temp.EventData + i.Timestamp = temp.Timestamp + i.Invoice = temp.Invoice + return nil } diff --git a/models/invoice_event_1.go b/models/invoice_event_1.go deleted file mode 100644 index 58a7de6f..00000000 --- a/models/invoice_event_1.go +++ /dev/null @@ -1,245 +0,0 @@ -package models - -import ( - "encoding/json" - "log" - "time" -) - -// InvoiceEvent1 represents a InvoiceEvent1 struct. -// The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. -type InvoiceEvent1 struct { - // Unique identifier for the credit note application. It is generated automatically by Chargify and has the prefix "cdt_" followed by alphanumeric characters. - Uid *string `json:"uid,omitempty"` - // A unique, identifying string that appears on the credit note and in places it is referenced. - CreditNoteNumber *string `json:"credit_note_number,omitempty"` - // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. - CreditNoteUid *string `json:"credit_note_uid,omitempty"` - // The full, original amount of the credit note. - OriginalAmount *string `json:"original_amount,omitempty"` - // The amount of the credit note applied to invoice. - AppliedAmount *string `json:"applied_amount,omitempty"` - // The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" - TransactionTime *time.Time `json:"transaction_time,omitempty"` - // The credit note memo. - Memo *string `json:"memo,omitempty"` - // The role of the credit note (e.g. 'general') - Role *string `json:"role,omitempty"` - // Shows whether it was applied to consolidated invoice or not - ConsolidatedInvoice *bool `json:"consolidated_invoice,omitempty"` - // List of credit notes applied to children invoices (if consolidated invoice) - AppliedCreditNotes []AppliedCreditNoteData `json:"applied_credit_notes,omitempty"` - // A unique, identifying string that appears on the debit note and in places it is referenced. - DebitNoteNumber *string `json:"debit_note_number,omitempty"` - // Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. - DebitNoteUid *string `json:"debit_note_uid,omitempty"` - // A nested data structure detailing the method of payment - PaymentMethod *PaymentMethodNestedData `json:"payment_method,omitempty"` - // The Chargify id of the original payment - TransactionId *int `json:"transaction_id,omitempty"` - // The previous collection method of the invoice. - FromCollectionMethod *string `json:"from_collection_method,omitempty"` - // The new collection method of the invoice. - ToCollectionMethod *string `json:"to_collection_method,omitempty"` - // 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). - ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` - // The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. - FromStatus *InvoiceStatus `json:"from_status,omitempty"` - // The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. - ToStatus *InvoiceStatus `json:"to_status,omitempty"` - // Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. - DueAmount *string `json:"due_amount,omitempty"` - // The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' - TotalAmount *string `json:"total_amount,omitempty"` - // If true, credit was created and applied it to the invoice. - ApplyCredit *bool `json:"apply_credit,omitempty"` - CreditNoteAttributes *CreditNote1 `json:"credit_note_attributes,omitempty"` - // The ID of the payment transaction to be refunded. - PaymentId *int `json:"payment_id,omitempty"` - // The amount of the refund. - RefundAmount *string `json:"refund_amount,omitempty"` - // The ID of the refund transaction. - RefundId *int `json:"refund_id,omitempty"` - // The flag that shows whether the original payment was a prepayment or not - Prepayment *bool `json:"prepayment,omitempty"` - // If true, the invoice is an advance invoice. - IsAdvanceInvoice *bool `json:"is_advance_invoice,omitempty"` -} - -// MarshalJSON implements the json.Marshaler interface for InvoiceEvent1. -// It customizes the JSON marshaling process for InvoiceEvent1 objects. -func (i *InvoiceEvent1) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) -} - -// toMap converts the InvoiceEvent1 object to a map representation for JSON marshaling. -func (i *InvoiceEvent1) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.CreditNoteNumber != nil { - structMap["credit_note_number"] = i.CreditNoteNumber - } - if i.CreditNoteUid != nil { - structMap["credit_note_uid"] = i.CreditNoteUid - } - if i.OriginalAmount != nil { - structMap["original_amount"] = i.OriginalAmount - } - if i.AppliedAmount != nil { - structMap["applied_amount"] = i.AppliedAmount - } - if i.TransactionTime != nil { - structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.Role != nil { - structMap["role"] = i.Role - } - if i.ConsolidatedInvoice != nil { - structMap["consolidated_invoice"] = i.ConsolidatedInvoice - } - if i.AppliedCreditNotes != nil { - structMap["applied_credit_notes"] = i.AppliedCreditNotes - } - if i.DebitNoteNumber != nil { - structMap["debit_note_number"] = i.DebitNoteNumber - } - if i.DebitNoteUid != nil { - structMap["debit_note_uid"] = i.DebitNoteUid - } - if i.PaymentMethod != nil { - structMap["payment_method"] = i.PaymentMethod - } - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.FromCollectionMethod != nil { - structMap["from_collection_method"] = i.FromCollectionMethod - } - if i.ToCollectionMethod != nil { - structMap["to_collection_method"] = i.ToCollectionMethod - } - if i.ConsolidationLevel != nil { - structMap["consolidation_level"] = i.ConsolidationLevel - } - if i.FromStatus != nil { - structMap["from_status"] = i.FromStatus - } - if i.ToStatus != nil { - structMap["to_status"] = i.ToStatus - } - if i.DueAmount != nil { - structMap["due_amount"] = i.DueAmount - } - if i.TotalAmount != nil { - structMap["total_amount"] = i.TotalAmount - } - if i.ApplyCredit != nil { - structMap["apply_credit"] = i.ApplyCredit - } - if i.CreditNoteAttributes != nil { - structMap["credit_note_attributes"] = i.CreditNoteAttributes - } - if i.PaymentId != nil { - structMap["payment_id"] = i.PaymentId - } - if i.RefundAmount != nil { - structMap["refund_amount"] = i.RefundAmount - } - if i.RefundId != nil { - structMap["refund_id"] = i.RefundId - } - if i.Prepayment != nil { - structMap["prepayment"] = i.Prepayment - } - if i.IsAdvanceInvoice != nil { - structMap["is_advance_invoice"] = i.IsAdvanceInvoice - } - return structMap -} - -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEvent1. -// It customizes the JSON unmarshaling process for InvoiceEvent1 objects. -func (i *InvoiceEvent1) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - CreditNoteNumber *string `json:"credit_note_number,omitempty"` - CreditNoteUid *string `json:"credit_note_uid,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - TransactionTime *string `json:"transaction_time,omitempty"` - Memo *string `json:"memo,omitempty"` - Role *string `json:"role,omitempty"` - ConsolidatedInvoice *bool `json:"consolidated_invoice,omitempty"` - AppliedCreditNotes []AppliedCreditNoteData `json:"applied_credit_notes,omitempty"` - DebitNoteNumber *string `json:"debit_note_number,omitempty"` - DebitNoteUid *string `json:"debit_note_uid,omitempty"` - PaymentMethod *PaymentMethodNestedData `json:"payment_method,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - FromCollectionMethod *string `json:"from_collection_method,omitempty"` - ToCollectionMethod *string `json:"to_collection_method,omitempty"` - ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` - FromStatus *InvoiceStatus `json:"from_status,omitempty"` - ToStatus *InvoiceStatus `json:"to_status,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - ApplyCredit *bool `json:"apply_credit,omitempty"` - CreditNoteAttributes *CreditNote1 `json:"credit_note_attributes,omitempty"` - PaymentId *int `json:"payment_id,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - RefundId *int `json:"refund_id,omitempty"` - Prepayment *bool `json:"prepayment,omitempty"` - IsAdvanceInvoice *bool `json:"is_advance_invoice,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.CreditNoteNumber = temp.CreditNoteNumber - i.CreditNoteUid = temp.CreditNoteUid - i.OriginalAmount = temp.OriginalAmount - i.AppliedAmount = temp.AppliedAmount - if temp.TransactionTime != nil { - TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) - if err != nil { - log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) - } - i.TransactionTime = &TransactionTimeVal - } - i.Memo = temp.Memo - i.Role = temp.Role - i.ConsolidatedInvoice = temp.ConsolidatedInvoice - i.AppliedCreditNotes = temp.AppliedCreditNotes - i.DebitNoteNumber = temp.DebitNoteNumber - i.DebitNoteUid = temp.DebitNoteUid - i.PaymentMethod = temp.PaymentMethod - i.TransactionId = temp.TransactionId - i.FromCollectionMethod = temp.FromCollectionMethod - i.ToCollectionMethod = temp.ToCollectionMethod - i.ConsolidationLevel = temp.ConsolidationLevel - i.FromStatus = temp.FromStatus - i.ToStatus = temp.ToStatus - i.DueAmount = temp.DueAmount - i.TotalAmount = temp.TotalAmount - i.ApplyCredit = temp.ApplyCredit - i.CreditNoteAttributes = temp.CreditNoteAttributes - i.PaymentId = temp.PaymentId - i.RefundAmount = temp.RefundAmount - i.RefundId = temp.RefundId - i.Prepayment = temp.Prepayment - i.IsAdvanceInvoice = temp.IsAdvanceInvoice - return nil -} diff --git a/models/invoice_event_data.go b/models/invoice_event_data.go new file mode 100644 index 00000000..1b4b63c3 --- /dev/null +++ b/models/invoice_event_data.go @@ -0,0 +1,270 @@ +package models + +import ( + "encoding/json" + "log" + "time" +) + +// InvoiceEventData represents a InvoiceEventData struct. +// The event data is the data that, when combined with the command, results in the output invoice found in the invoice field. +type InvoiceEventData struct { + // Unique identifier for the credit note application. It is generated automatically by Chargify and has the prefix "cdt_" followed by alphanumeric characters. + Uid *string `json:"uid,omitempty"` + // A unique, identifying string that appears on the credit note and in places it is referenced. + CreditNoteNumber *string `json:"credit_note_number,omitempty"` + // Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters. + CreditNoteUid *string `json:"credit_note_uid,omitempty"` + // The full, original amount of the credit note. + OriginalAmount *string `json:"original_amount,omitempty"` + // The amount of the credit note applied to invoice. + AppliedAmount *string `json:"applied_amount,omitempty"` + // The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + TransactionTime *time.Time `json:"transaction_time,omitempty"` + // The credit note memo. + Memo *string `json:"memo,omitempty"` + // The role of the credit note (e.g. 'general') + Role *string `json:"role,omitempty"` + // Shows whether it was applied to consolidated invoice or not + ConsolidatedInvoice *bool `json:"consolidated_invoice,omitempty"` + // List of credit notes applied to children invoices (if consolidated invoice) + AppliedCreditNotes []AppliedCreditNoteData `json:"applied_credit_notes,omitempty"` + // A unique, identifying string that appears on the debit note and in places it is referenced. + DebitNoteNumber *string `json:"debit_note_number,omitempty"` + // Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. + DebitNoteUid *string `json:"debit_note_uid,omitempty"` + // A nested data structure detailing the method of payment + PaymentMethod *InvoiceEventPayment1 `json:"payment_method,omitempty"` + // The Chargify id of the original payment + TransactionId *int `json:"transaction_id,omitempty"` + ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` + RemainingPrepaymentAmount Optional[string] `json:"remaining_prepayment_amount"` + // The flag that shows whether the original payment was a prepayment or not + Prepayment *bool `json:"prepayment,omitempty"` + External *bool `json:"external,omitempty"` + // The previous collection method of the invoice. + FromCollectionMethod *string `json:"from_collection_method,omitempty"` + // The new collection method of the invoice. + ToCollectionMethod *string `json:"to_collection_method,omitempty"` + // 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). + ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` + // The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. + FromStatus *InvoiceStatus `json:"from_status,omitempty"` + // The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. + ToStatus *InvoiceStatus `json:"to_status,omitempty"` + // Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. + DueAmount *string `json:"due_amount,omitempty"` + // The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' + TotalAmount *string `json:"total_amount,omitempty"` + // If true, credit was created and applied it to the invoice. + ApplyCredit *bool `json:"apply_credit,omitempty"` + CreditNoteAttributes *CreditNote1 `json:"credit_note_attributes,omitempty"` + // The ID of the payment transaction to be refunded. + PaymentId *int `json:"payment_id,omitempty"` + // The amount of the refund. + RefundAmount *string `json:"refund_amount,omitempty"` + // The ID of the refund transaction. + RefundId *int `json:"refund_id,omitempty"` + // If true, the invoice is an advance invoice. + IsAdvanceInvoice *bool `json:"is_advance_invoice,omitempty"` + // The reason for the void. + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON implements the json.Marshaler interface for InvoiceEventData. +// It customizes the JSON marshaling process for InvoiceEventData objects. +func (i *InvoiceEventData) MarshalJSON() ( + []byte, + error) { + return json.Marshal(i.toMap()) +} + +// toMap converts the InvoiceEventData object to a map representation for JSON marshaling. +func (i *InvoiceEventData) toMap() map[string]any { + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.CreditNoteNumber != nil { + structMap["credit_note_number"] = i.CreditNoteNumber + } + if i.CreditNoteUid != nil { + structMap["credit_note_uid"] = i.CreditNoteUid + } + if i.OriginalAmount != nil { + structMap["original_amount"] = i.OriginalAmount + } + if i.AppliedAmount != nil { + structMap["applied_amount"] = i.AppliedAmount + } + if i.TransactionTime != nil { + structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.Role != nil { + structMap["role"] = i.Role + } + if i.ConsolidatedInvoice != nil { + structMap["consolidated_invoice"] = i.ConsolidatedInvoice + } + if i.AppliedCreditNotes != nil { + structMap["applied_credit_notes"] = i.AppliedCreditNotes + } + if i.DebitNoteNumber != nil { + structMap["debit_note_number"] = i.DebitNoteNumber + } + if i.DebitNoteUid != nil { + structMap["debit_note_uid"] = i.DebitNoteUid + } + if i.PaymentMethod != nil { + structMap["payment_method"] = i.PaymentMethod.toMap() + } + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.ParentInvoiceNumber.IsValueSet() { + structMap["parent_invoice_number"] = i.ParentInvoiceNumber.Value() + } + if i.RemainingPrepaymentAmount.IsValueSet() { + structMap["remaining_prepayment_amount"] = i.RemainingPrepaymentAmount.Value() + } + if i.Prepayment != nil { + structMap["prepayment"] = i.Prepayment + } + if i.External != nil { + structMap["external"] = i.External + } + if i.FromCollectionMethod != nil { + structMap["from_collection_method"] = i.FromCollectionMethod + } + if i.ToCollectionMethod != nil { + structMap["to_collection_method"] = i.ToCollectionMethod + } + if i.ConsolidationLevel != nil { + structMap["consolidation_level"] = i.ConsolidationLevel + } + if i.FromStatus != nil { + structMap["from_status"] = i.FromStatus + } + if i.ToStatus != nil { + structMap["to_status"] = i.ToStatus + } + if i.DueAmount != nil { + structMap["due_amount"] = i.DueAmount + } + if i.TotalAmount != nil { + structMap["total_amount"] = i.TotalAmount + } + if i.ApplyCredit != nil { + structMap["apply_credit"] = i.ApplyCredit + } + if i.CreditNoteAttributes != nil { + structMap["credit_note_attributes"] = i.CreditNoteAttributes.toMap() + } + if i.PaymentId != nil { + structMap["payment_id"] = i.PaymentId + } + if i.RefundAmount != nil { + structMap["refund_amount"] = i.RefundAmount + } + if i.RefundId != nil { + structMap["refund_id"] = i.RefundId + } + if i.IsAdvanceInvoice != nil { + structMap["is_advance_invoice"] = i.IsAdvanceInvoice + } + if i.Reason != nil { + structMap["reason"] = i.Reason + } + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventData. +// It customizes the JSON unmarshaling process for InvoiceEventData objects. +func (i *InvoiceEventData) UnmarshalJSON(input []byte) error { + temp := &struct { + Uid *string `json:"uid,omitempty"` + CreditNoteNumber *string `json:"credit_note_number,omitempty"` + CreditNoteUid *string `json:"credit_note_uid,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + TransactionTime *string `json:"transaction_time,omitempty"` + Memo *string `json:"memo,omitempty"` + Role *string `json:"role,omitempty"` + ConsolidatedInvoice *bool `json:"consolidated_invoice,omitempty"` + AppliedCreditNotes []AppliedCreditNoteData `json:"applied_credit_notes,omitempty"` + DebitNoteNumber *string `json:"debit_note_number,omitempty"` + DebitNoteUid *string `json:"debit_note_uid,omitempty"` + PaymentMethod *InvoiceEventPayment1 `json:"payment_method,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"` + RemainingPrepaymentAmount Optional[string] `json:"remaining_prepayment_amount"` + Prepayment *bool `json:"prepayment,omitempty"` + External *bool `json:"external,omitempty"` + FromCollectionMethod *string `json:"from_collection_method,omitempty"` + ToCollectionMethod *string `json:"to_collection_method,omitempty"` + ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"` + FromStatus *InvoiceStatus `json:"from_status,omitempty"` + ToStatus *InvoiceStatus `json:"to_status,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + ApplyCredit *bool `json:"apply_credit,omitempty"` + CreditNoteAttributes *CreditNote1 `json:"credit_note_attributes,omitempty"` + PaymentId *int `json:"payment_id,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + RefundId *int `json:"refund_id,omitempty"` + IsAdvanceInvoice *bool `json:"is_advance_invoice,omitempty"` + Reason *string `json:"reason,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.CreditNoteNumber = temp.CreditNoteNumber + i.CreditNoteUid = temp.CreditNoteUid + i.OriginalAmount = temp.OriginalAmount + i.AppliedAmount = temp.AppliedAmount + if temp.TransactionTime != nil { + TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) + if err != nil { + log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) + } + i.TransactionTime = &TransactionTimeVal + } + i.Memo = temp.Memo + i.Role = temp.Role + i.ConsolidatedInvoice = temp.ConsolidatedInvoice + i.AppliedCreditNotes = temp.AppliedCreditNotes + i.DebitNoteNumber = temp.DebitNoteNumber + i.DebitNoteUid = temp.DebitNoteUid + i.PaymentMethod = temp.PaymentMethod + i.TransactionId = temp.TransactionId + i.ParentInvoiceNumber = temp.ParentInvoiceNumber + i.RemainingPrepaymentAmount = temp.RemainingPrepaymentAmount + i.Prepayment = temp.Prepayment + i.External = temp.External + i.FromCollectionMethod = temp.FromCollectionMethod + i.ToCollectionMethod = temp.ToCollectionMethod + i.ConsolidationLevel = temp.ConsolidationLevel + i.FromStatus = temp.FromStatus + i.ToStatus = temp.ToStatus + i.DueAmount = temp.DueAmount + i.TotalAmount = temp.TotalAmount + i.ApplyCredit = temp.ApplyCredit + i.CreditNoteAttributes = temp.CreditNoteAttributes + i.PaymentId = temp.PaymentId + i.RefundAmount = temp.RefundAmount + i.RefundId = temp.RefundId + i.IsAdvanceInvoice = temp.IsAdvanceInvoice + i.Reason = temp.Reason + return nil +} diff --git a/models/invoice_event_payment.go b/models/invoice_event_payment.go new file mode 100644 index 00000000..97332bc4 --- /dev/null +++ b/models/invoice_event_payment.go @@ -0,0 +1,110 @@ +/* +Package advancedbilling + +This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). +*/ +package models + +import ( + "encoding/json" +) + +// InvoiceEventPayment represents a InvoiceEventPayment struct. +// A nested data structure detailing the method of payment +type InvoiceEventPayment struct { + Type *string `json:"type,omitempty"` + MaskedAccountNumber *string `json:"masked_account_number,omitempty"` + MaskedRoutingNumber *string `json:"masked_routing_number,omitempty"` + CardBrand *string `json:"card_brand,omitempty"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + Details Optional[string] `json:"details"` + Kind *string `json:"kind,omitempty"` + Memo Optional[string] `json:"memo"` + Email *string `json:"email,omitempty"` +} + +// MarshalJSON implements the json.Marshaler interface for InvoiceEventPayment. +// It customizes the JSON marshaling process for InvoiceEventPayment objects. +func (i *InvoiceEventPayment) MarshalJSON() ( + []byte, + error) { + return json.Marshal(i.toMap()) +} + +// toMap converts the InvoiceEventPayment object to a map representation for JSON marshaling. +func (i *InvoiceEventPayment) toMap() map[string]any { + structMap := make(map[string]any) + if i.Type != nil { + structMap["type"] = *i.Type + } else { + structMap["type"] = "Invoice Event Payment" + } + if i.MaskedAccountNumber != nil { + structMap["masked_account_number"] = i.MaskedAccountNumber + } + if i.MaskedRoutingNumber != nil { + structMap["masked_routing_number"] = i.MaskedRoutingNumber + } + if i.CardBrand != nil { + structMap["card_brand"] = i.CardBrand + } + if i.CardExpiration != nil { + structMap["card_expiration"] = i.CardExpiration + } + if i.LastFour.IsValueSet() { + structMap["last_four"] = i.LastFour.Value() + } + if i.MaskedCardNumber != nil { + structMap["masked_card_number"] = i.MaskedCardNumber + } + if i.Details.IsValueSet() { + structMap["details"] = i.Details.Value() + } + if i.Kind != nil { + structMap["kind"] = i.Kind + } + if i.Memo.IsValueSet() { + structMap["memo"] = i.Memo.Value() + } + if i.Email != nil { + structMap["email"] = i.Email + } + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventPayment. +// It customizes the JSON unmarshaling process for InvoiceEventPayment objects. +func (i *InvoiceEventPayment) UnmarshalJSON(input []byte) error { + temp := &struct { + Type *string `json:"type,omitempty"` + MaskedAccountNumber *string `json:"masked_account_number,omitempty"` + MaskedRoutingNumber *string `json:"masked_routing_number,omitempty"` + CardBrand *string `json:"card_brand,omitempty"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + Details Optional[string] `json:"details"` + Kind *string `json:"kind,omitempty"` + Memo Optional[string] `json:"memo"` + Email *string `json:"email,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Type = temp.Type + i.MaskedAccountNumber = temp.MaskedAccountNumber + i.MaskedRoutingNumber = temp.MaskedRoutingNumber + i.CardBrand = temp.CardBrand + i.CardExpiration = temp.CardExpiration + i.LastFour = temp.LastFour + i.MaskedCardNumber = temp.MaskedCardNumber + i.Details = temp.Details + i.Kind = temp.Kind + i.Memo = temp.Memo + i.Email = temp.Email + return nil +} diff --git a/models/invoice_event_payment_1.go b/models/invoice_event_payment_1.go new file mode 100644 index 00000000..8ca8d60d --- /dev/null +++ b/models/invoice_event_payment_1.go @@ -0,0 +1,89 @@ +package models + +import ( + "encoding/json" +) + +// InvoiceEventPayment1 represents a InvoiceEventPayment1 struct. +// A nested data structure detailing the method of payment +type InvoiceEventPayment1 struct { + Type *string `json:"type,omitempty"` + MaskedAccountNumber string `json:"masked_account_number"` + MaskedRoutingNumber string `json:"masked_routing_number"` + CardBrand string `json:"card_brand"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber string `json:"masked_card_number"` + Details *string `json:"details"` + Kind string `json:"kind"` + Memo *string `json:"memo"` + Email string `json:"email"` +} + +// MarshalJSON implements the json.Marshaler interface for InvoiceEventPayment1. +// It customizes the JSON marshaling process for InvoiceEventPayment1 objects. +func (i *InvoiceEventPayment1) MarshalJSON() ( + []byte, + error) { + return json.Marshal(i.toMap()) +} + +// toMap converts the InvoiceEventPayment1 object to a map representation for JSON marshaling. +func (i *InvoiceEventPayment1) toMap() map[string]any { + structMap := make(map[string]any) + if i.Type != nil { + structMap["type"] = *i.Type + } else { + structMap["type"] = "Invoice Event Payment1" + } + structMap["masked_account_number"] = i.MaskedAccountNumber + structMap["masked_routing_number"] = i.MaskedRoutingNumber + structMap["card_brand"] = i.CardBrand + if i.CardExpiration != nil { + structMap["card_expiration"] = i.CardExpiration + } + if i.LastFour.IsValueSet() { + structMap["last_four"] = i.LastFour.Value() + } + structMap["masked_card_number"] = i.MaskedCardNumber + structMap["details"] = i.Details + structMap["kind"] = i.Kind + structMap["memo"] = i.Memo + structMap["email"] = i.Email + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventPayment1. +// It customizes the JSON unmarshaling process for InvoiceEventPayment1 objects. +func (i *InvoiceEventPayment1) UnmarshalJSON(input []byte) error { + temp := &struct { + Type *string `json:"type,omitempty"` + MaskedAccountNumber string `json:"masked_account_number"` + MaskedRoutingNumber string `json:"masked_routing_number"` + CardBrand string `json:"card_brand"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber string `json:"masked_card_number"` + Details *string `json:"details"` + Kind string `json:"kind"` + Memo *string `json:"memo"` + Email string `json:"email"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Type = temp.Type + i.MaskedAccountNumber = temp.MaskedAccountNumber + i.MaskedRoutingNumber = temp.MaskedRoutingNumber + i.CardBrand = temp.CardBrand + i.CardExpiration = temp.CardExpiration + i.LastFour = temp.LastFour + i.MaskedCardNumber = temp.MaskedCardNumber + i.Details = temp.Details + i.Kind = temp.Kind + i.Memo = temp.Memo + i.Email = temp.Email + return nil +} diff --git a/models/invoice_line_item.go b/models/invoice_line_item.go index 8d39ce26..17b3310e 100644 --- a/models/invoice_line_item.go +++ b/models/invoice_line_item.go @@ -1,206 +1,206 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // InvoiceLineItem represents a InvoiceLineItem struct. type InvoiceLineItem struct { - // Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. - Uid *string `json:"uid,omitempty"` - // A short descriptor for the charge or item represented by this line. - Title *string `json:"title,omitempty"` - // Detailed description for the charge or item represented by this line. May include proration details in plain text. - // Note: this string may contain line breaks that are hints for the best display format on the invoice. - Description *string `json:"description,omitempty"` - // The quantity or count of units billed by the line item. - // This is a decimal number represented as a string. (See "About Decimal Numbers".) - Quantity *string `json:"quantity,omitempty"` - // 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`. - UnitPrice *string `json:"unit_price,omitempty"` - // 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). - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - // 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. - DiscountAmount *string `json:"discount_amount,omitempty"` - // 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. - TaxAmount *string `json:"tax_amount,omitempty"` - // 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`. - TotalAmount *string `json:"total_amount,omitempty"` - // 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. - TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` - // 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. - PeriodRangeStart *time.Time `json:"period_range_start,omitempty"` - // 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. - PeriodRangeEnd *time.Time `json:"period_range_end,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - // 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`. - ProductId Optional[int] `json:"product_id"` - // The version of the product subscribed when the charge was made. - ProductVersion Optional[int] `json:"product_version"` - // The ID of the component being billed. Will be `nil` for non-component charges. - ComponentId Optional[int] `json:"component_id"` - // The price point ID of the component being billed. Will be `nil` for non-component charges. - PricePointId Optional[int] `json:"price_point_id"` - Hide *bool `json:"hide,omitempty"` - ComponentCostData Optional[InvoiceLineItemComponentCostData] `json:"component_cost_data"` - // The price point ID of the line item's product - ProductPricePointId Optional[int] `json:"product_price_point_id"` - CustomItem *bool `json:"custom_item,omitempty"` + // Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. + Uid *string `json:"uid,omitempty"` + // A short descriptor for the charge or item represented by this line. + Title *string `json:"title,omitempty"` + // Detailed description for the charge or item represented by this line. May include proration details in plain text. + // Note: this string may contain line breaks that are hints for the best display format on the invoice. + Description *string `json:"description,omitempty"` + // The quantity or count of units billed by the line item. + // This is a decimal number represented as a string. (See "About Decimal Numbers".) + Quantity *string `json:"quantity,omitempty"` + // 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`. + UnitPrice *string `json:"unit_price,omitempty"` + // 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). + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + // 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. + DiscountAmount *string `json:"discount_amount,omitempty"` + // 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. + TaxAmount *string `json:"tax_amount,omitempty"` + // 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`. + TotalAmount *string `json:"total_amount,omitempty"` + // 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. + TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` + // 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. + PeriodRangeStart *time.Time `json:"period_range_start,omitempty"` + // 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. + PeriodRangeEnd *time.Time `json:"period_range_end,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + // 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`. + ProductId Optional[int] `json:"product_id"` + // The version of the product subscribed when the charge was made. + ProductVersion Optional[int] `json:"product_version"` + // The ID of the component being billed. Will be `nil` for non-component charges. + ComponentId Optional[int] `json:"component_id"` + // The price point ID of the component being billed. Will be `nil` for non-component charges. + PricePointId Optional[int] `json:"price_point_id"` + Hide *bool `json:"hide,omitempty"` + ComponentCostData Optional[InvoiceLineItemComponentCostData] `json:"component_cost_data"` + // The price point ID of the line item's product + ProductPricePointId Optional[int] `json:"product_price_point_id"` + CustomItem *bool `json:"custom_item,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceLineItem. +// MarshalJSON implements the json.Marshaler interface for InvoiceLineItem. // It customizes the JSON marshaling process for InvoiceLineItem objects. func (i *InvoiceLineItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceLineItem object to a map representation for JSON marshaling. func (i *InvoiceLineItem) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.Title != nil { - structMap["title"] = i.Title - } - if i.Description != nil { - structMap["description"] = i.Description - } - if i.Quantity != nil { - structMap["quantity"] = i.Quantity - } - if i.UnitPrice != nil { - structMap["unit_price"] = i.UnitPrice - } - if i.SubtotalAmount != nil { - structMap["subtotal_amount"] = i.SubtotalAmount - } - if i.DiscountAmount != nil { - structMap["discount_amount"] = i.DiscountAmount - } - if i.TaxAmount != nil { - structMap["tax_amount"] = i.TaxAmount - } - if i.TotalAmount != nil { - structMap["total_amount"] = i.TotalAmount - } - if i.TieredUnitPrice != nil { - structMap["tiered_unit_price"] = i.TieredUnitPrice - } - if i.PeriodRangeStart != nil { - structMap["period_range_start"] = i.PeriodRangeStart.Format(DEFAULT_DATE) - } - if i.PeriodRangeEnd != nil { - structMap["period_range_end"] = i.PeriodRangeEnd.Format(DEFAULT_DATE) - } - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.ProductId.IsValueSet() { - structMap["product_id"] = i.ProductId.Value() - } - if i.ProductVersion.IsValueSet() { - structMap["product_version"] = i.ProductVersion.Value() - } - if i.ComponentId.IsValueSet() { - structMap["component_id"] = i.ComponentId.Value() - } - if i.PricePointId.IsValueSet() { - structMap["price_point_id"] = i.PricePointId.Value() - } - if i.Hide != nil { - structMap["hide"] = i.Hide - } - if i.ComponentCostData.IsValueSet() { - structMap["component_cost_data"] = i.ComponentCostData.Value() - } - if i.ProductPricePointId.IsValueSet() { - structMap["product_price_point_id"] = i.ProductPricePointId.Value() - } - if i.CustomItem != nil { - structMap["custom_item"] = i.CustomItem - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.Title != nil { + structMap["title"] = i.Title + } + if i.Description != nil { + structMap["description"] = i.Description + } + if i.Quantity != nil { + structMap["quantity"] = i.Quantity + } + if i.UnitPrice != nil { + structMap["unit_price"] = i.UnitPrice + } + if i.SubtotalAmount != nil { + structMap["subtotal_amount"] = i.SubtotalAmount + } + if i.DiscountAmount != nil { + structMap["discount_amount"] = i.DiscountAmount + } + if i.TaxAmount != nil { + structMap["tax_amount"] = i.TaxAmount + } + if i.TotalAmount != nil { + structMap["total_amount"] = i.TotalAmount + } + if i.TieredUnitPrice != nil { + structMap["tiered_unit_price"] = i.TieredUnitPrice + } + if i.PeriodRangeStart != nil { + structMap["period_range_start"] = i.PeriodRangeStart.Format(DEFAULT_DATE) + } + if i.PeriodRangeEnd != nil { + structMap["period_range_end"] = i.PeriodRangeEnd.Format(DEFAULT_DATE) + } + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.ProductId.IsValueSet() { + structMap["product_id"] = i.ProductId.Value() + } + if i.ProductVersion.IsValueSet() { + structMap["product_version"] = i.ProductVersion.Value() + } + if i.ComponentId.IsValueSet() { + structMap["component_id"] = i.ComponentId.Value() + } + if i.PricePointId.IsValueSet() { + structMap["price_point_id"] = i.PricePointId.Value() + } + if i.Hide != nil { + structMap["hide"] = i.Hide + } + if i.ComponentCostData.IsValueSet() { + structMap["component_cost_data"] = i.ComponentCostData.Value() + } + if i.ProductPricePointId.IsValueSet() { + structMap["product_price_point_id"] = i.ProductPricePointId.Value() + } + if i.CustomItem != nil { + structMap["custom_item"] = i.CustomItem + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItem. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItem. // It customizes the JSON unmarshaling process for InvoiceLineItem objects. func (i *InvoiceLineItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description *string `json:"description,omitempty"` - Quantity *string `json:"quantity,omitempty"` - UnitPrice *string `json:"unit_price,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` - PeriodRangeStart *string `json:"period_range_start,omitempty"` - PeriodRangeEnd *string `json:"period_range_end,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - ProductId Optional[int] `json:"product_id"` - ProductVersion Optional[int] `json:"product_version"` - ComponentId Optional[int] `json:"component_id"` - PricePointId Optional[int] `json:"price_point_id"` - Hide *bool `json:"hide,omitempty"` - ComponentCostData Optional[InvoiceLineItemComponentCostData] `json:"component_cost_data"` - ProductPricePointId Optional[int] `json:"product_price_point_id"` - CustomItem *bool `json:"custom_item,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.Title = temp.Title - i.Description = temp.Description - i.Quantity = temp.Quantity - i.UnitPrice = temp.UnitPrice - i.SubtotalAmount = temp.SubtotalAmount - i.DiscountAmount = temp.DiscountAmount - i.TaxAmount = temp.TaxAmount - i.TotalAmount = temp.TotalAmount - i.TieredUnitPrice = temp.TieredUnitPrice - if temp.PeriodRangeStart != nil { - PeriodRangeStartVal, err := time.Parse(DEFAULT_DATE, *temp.PeriodRangeStart) - if err != nil { - log.Fatalf("Cannot Parse period_range_start as % s format.", DEFAULT_DATE) - } - i.PeriodRangeStart = &PeriodRangeStartVal - } - if temp.PeriodRangeEnd != nil { - PeriodRangeEndVal, err := time.Parse(DEFAULT_DATE, *temp.PeriodRangeEnd) - if err != nil { - log.Fatalf("Cannot Parse period_range_end as % s format.", DEFAULT_DATE) - } - i.PeriodRangeEnd = &PeriodRangeEndVal - } - i.TransactionId = temp.TransactionId - i.ProductId = temp.ProductId - i.ProductVersion = temp.ProductVersion - i.ComponentId = temp.ComponentId - i.PricePointId = temp.PricePointId - i.Hide = temp.Hide - i.ComponentCostData = temp.ComponentCostData - i.ProductPricePointId = temp.ProductPricePointId - i.CustomItem = temp.CustomItem - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` + Quantity *string `json:"quantity,omitempty"` + UnitPrice *string `json:"unit_price,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"` + PeriodRangeStart *string `json:"period_range_start,omitempty"` + PeriodRangeEnd *string `json:"period_range_end,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + ProductId Optional[int] `json:"product_id"` + ProductVersion Optional[int] `json:"product_version"` + ComponentId Optional[int] `json:"component_id"` + PricePointId Optional[int] `json:"price_point_id"` + Hide *bool `json:"hide,omitempty"` + ComponentCostData Optional[InvoiceLineItemComponentCostData] `json:"component_cost_data"` + ProductPricePointId Optional[int] `json:"product_price_point_id"` + CustomItem *bool `json:"custom_item,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.Title = temp.Title + i.Description = temp.Description + i.Quantity = temp.Quantity + i.UnitPrice = temp.UnitPrice + i.SubtotalAmount = temp.SubtotalAmount + i.DiscountAmount = temp.DiscountAmount + i.TaxAmount = temp.TaxAmount + i.TotalAmount = temp.TotalAmount + i.TieredUnitPrice = temp.TieredUnitPrice + if temp.PeriodRangeStart != nil { + PeriodRangeStartVal, err := time.Parse(DEFAULT_DATE, *temp.PeriodRangeStart) + if err != nil { + log.Fatalf("Cannot Parse period_range_start as % s format.", DEFAULT_DATE) + } + i.PeriodRangeStart = &PeriodRangeStartVal + } + if temp.PeriodRangeEnd != nil { + PeriodRangeEndVal, err := time.Parse(DEFAULT_DATE, *temp.PeriodRangeEnd) + if err != nil { + log.Fatalf("Cannot Parse period_range_end as % s format.", DEFAULT_DATE) + } + i.PeriodRangeEnd = &PeriodRangeEndVal + } + i.TransactionId = temp.TransactionId + i.ProductId = temp.ProductId + i.ProductVersion = temp.ProductVersion + i.ComponentId = temp.ComponentId + i.PricePointId = temp.PricePointId + i.Hide = temp.Hide + i.ComponentCostData = temp.ComponentCostData + i.ProductPricePointId = temp.ProductPricePointId + i.CustomItem = temp.CustomItem + return nil } diff --git a/models/invoice_line_item_component_cost_data.go b/models/invoice_line_item_component_cost_data.go index f5942198..a391e31a 100644 --- a/models/invoice_line_item_component_cost_data.go +++ b/models/invoice_line_item_component_cost_data.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceLineItemComponentCostData represents a InvoiceLineItemComponentCostData struct. type InvoiceLineItemComponentCostData struct { - Rates []ComponentCostData `json:"rates,omitempty"` + Rates []ComponentCostData `json:"rates,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceLineItemComponentCostData. +// MarshalJSON implements the json.Marshaler interface for InvoiceLineItemComponentCostData. // It customizes the JSON marshaling process for InvoiceLineItemComponentCostData objects. func (i *InvoiceLineItemComponentCostData) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceLineItemComponentCostData object to a map representation for JSON marshaling. func (i *InvoiceLineItemComponentCostData) toMap() map[string]any { - structMap := make(map[string]any) - if i.Rates != nil { - structMap["rates"] = i.Rates - } - return structMap + structMap := make(map[string]any) + if i.Rates != nil { + structMap["rates"] = i.Rates + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItemComponentCostData. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItemComponentCostData. // It customizes the JSON unmarshaling process for InvoiceLineItemComponentCostData objects. func (i *InvoiceLineItemComponentCostData) UnmarshalJSON(input []byte) error { - temp := &struct { - Rates []ComponentCostData `json:"rates,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Rates = temp.Rates - return nil + temp := &struct { + Rates []ComponentCostData `json:"rates,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Rates = temp.Rates + return nil } diff --git a/models/invoice_payer.go b/models/invoice_payer.go index 69e93cf5..1a93b0f0 100644 --- a/models/invoice_payer.go +++ b/models/invoice_payer.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoicePayer represents a InvoicePayer struct. type InvoicePayer struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePayer. +// MarshalJSON implements the json.Marshaler interface for InvoicePayer. // It customizes the JSON marshaling process for InvoicePayer objects. func (i *InvoicePayer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePayer object to a map representation for JSON marshaling. func (i *InvoicePayer) toMap() map[string]any { - structMap := make(map[string]any) - if i.ChargifyId != nil { - structMap["chargify_id"] = i.ChargifyId - } - if i.FirstName != nil { - structMap["first_name"] = i.FirstName - } - if i.LastName != nil { - structMap["last_name"] = i.LastName - } - if i.Organization.IsValueSet() { - structMap["organization"] = i.Organization.Value() - } - if i.Email != nil { - structMap["email"] = i.Email - } - if i.VatNumber.IsValueSet() { - structMap["vat_number"] = i.VatNumber.Value() - } - return structMap + structMap := make(map[string]any) + if i.ChargifyId != nil { + structMap["chargify_id"] = i.ChargifyId + } + if i.FirstName != nil { + structMap["first_name"] = i.FirstName + } + if i.LastName != nil { + structMap["last_name"] = i.LastName + } + if i.Organization.IsValueSet() { + structMap["organization"] = i.Organization.Value() + } + if i.Email != nil { + structMap["email"] = i.Email + } + if i.VatNumber.IsValueSet() { + structMap["vat_number"] = i.VatNumber.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayer. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayer. // It customizes the JSON unmarshaling process for InvoicePayer objects. func (i *InvoicePayer) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyId *int `json:"chargify_id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization Optional[string] `json:"organization"` - Email *string `json:"email,omitempty"` - VatNumber Optional[string] `json:"vat_number"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.ChargifyId = temp.ChargifyId - i.FirstName = temp.FirstName - i.LastName = temp.LastName - i.Organization = temp.Organization - i.Email = temp.Email - i.VatNumber = temp.VatNumber - return nil + temp := &struct { + ChargifyId *int `json:"chargify_id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization Optional[string] `json:"organization"` + Email *string `json:"email,omitempty"` + VatNumber Optional[string] `json:"vat_number"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.ChargifyId = temp.ChargifyId + i.FirstName = temp.FirstName + i.LastName = temp.LastName + i.Organization = temp.Organization + i.Email = temp.Email + i.VatNumber = temp.VatNumber + return nil } diff --git a/models/invoice_payer_change.go b/models/invoice_payer_change.go new file mode 100644 index 00000000..483a66d9 --- /dev/null +++ b/models/invoice_payer_change.go @@ -0,0 +1,60 @@ +package models + +import ( + "encoding/json" +) + +// InvoicePayerChange represents a InvoicePayerChange struct. +type InvoicePayerChange struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization *string `json:"organization,omitempty"` + Email *string `json:"email,omitempty"` +} + +// MarshalJSON implements the json.Marshaler interface for InvoicePayerChange. +// It customizes the JSON marshaling process for InvoicePayerChange objects. +func (i *InvoicePayerChange) MarshalJSON() ( + []byte, + error) { + return json.Marshal(i.toMap()) +} + +// toMap converts the InvoicePayerChange object to a map representation for JSON marshaling. +func (i *InvoicePayerChange) toMap() map[string]any { + structMap := make(map[string]any) + if i.FirstName != nil { + structMap["first_name"] = i.FirstName + } + if i.LastName != nil { + structMap["last_name"] = i.LastName + } + if i.Organization != nil { + structMap["organization"] = i.Organization + } + if i.Email != nil { + structMap["email"] = i.Email + } + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayerChange. +// It customizes the JSON unmarshaling process for InvoicePayerChange objects. +func (i *InvoicePayerChange) UnmarshalJSON(input []byte) error { + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization *string `json:"organization,omitempty"` + Email *string `json:"email,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.FirstName = temp.FirstName + i.LastName = temp.LastName + i.Organization = temp.Organization + i.Email = temp.Email + return nil +} diff --git a/models/invoice_payment.go b/models/invoice_payment.go index 5d34ff35..ebbac256 100644 --- a/models/invoice_payment.go +++ b/models/invoice_payment.go @@ -1,105 +1,105 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // InvoicePayment represents a InvoicePayment struct. type InvoicePayment struct { - TransactionTime *time.Time `json:"transaction_time,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - PaymentMethod *InvoicePaymentMethod `json:"payment_method,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - Prepayment *bool `json:"prepayment,omitempty"` - GatewayHandle Optional[string] `json:"gateway_handle"` - GatewayUsed *string `json:"gateway_used,omitempty"` - // The transaction ID for the payment as returned from the payment gateway - GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` + TransactionTime *time.Time `json:"transaction_time,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + PaymentMethod *InvoicePaymentMethod `json:"payment_method,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + Prepayment *bool `json:"prepayment,omitempty"` + GatewayHandle Optional[string] `json:"gateway_handle"` + GatewayUsed *string `json:"gateway_used,omitempty"` + // The transaction ID for the payment as returned from the payment gateway + GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePayment. +// MarshalJSON implements the json.Marshaler interface for InvoicePayment. // It customizes the JSON marshaling process for InvoicePayment objects. func (i *InvoicePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePayment object to a map representation for JSON marshaling. func (i *InvoicePayment) toMap() map[string]any { - structMap := make(map[string]any) - if i.TransactionTime != nil { - structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.OriginalAmount != nil { - structMap["original_amount"] = i.OriginalAmount - } - if i.AppliedAmount != nil { - structMap["applied_amount"] = i.AppliedAmount - } - if i.PaymentMethod != nil { - structMap["payment_method"] = i.PaymentMethod - } - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.Prepayment != nil { - structMap["prepayment"] = i.Prepayment - } - if i.GatewayHandle.IsValueSet() { - structMap["gateway_handle"] = i.GatewayHandle.Value() - } - if i.GatewayUsed != nil { - structMap["gateway_used"] = i.GatewayUsed - } - if i.GatewayTransactionId.IsValueSet() { - structMap["gateway_transaction_id"] = i.GatewayTransactionId.Value() - } - return structMap + structMap := make(map[string]any) + if i.TransactionTime != nil { + structMap["transaction_time"] = i.TransactionTime.Format(time.RFC3339) + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.OriginalAmount != nil { + structMap["original_amount"] = i.OriginalAmount + } + if i.AppliedAmount != nil { + structMap["applied_amount"] = i.AppliedAmount + } + if i.PaymentMethod != nil { + structMap["payment_method"] = i.PaymentMethod.toMap() + } + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.Prepayment != nil { + structMap["prepayment"] = i.Prepayment + } + if i.GatewayHandle.IsValueSet() { + structMap["gateway_handle"] = i.GatewayHandle.Value() + } + if i.GatewayUsed != nil { + structMap["gateway_used"] = i.GatewayUsed + } + if i.GatewayTransactionId.IsValueSet() { + structMap["gateway_transaction_id"] = i.GatewayTransactionId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayment. // It customizes the JSON unmarshaling process for InvoicePayment objects. func (i *InvoicePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - TransactionTime *string `json:"transaction_time,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - PaymentMethod *InvoicePaymentMethod `json:"payment_method,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - Prepayment *bool `json:"prepayment,omitempty"` - GatewayHandle Optional[string] `json:"gateway_handle"` - GatewayUsed *string `json:"gateway_used,omitempty"` - GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - if temp.TransactionTime != nil { - TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) - if err != nil { - log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) - } - i.TransactionTime = &TransactionTimeVal - } - i.Memo = temp.Memo - i.OriginalAmount = temp.OriginalAmount - i.AppliedAmount = temp.AppliedAmount - i.PaymentMethod = temp.PaymentMethod - i.TransactionId = temp.TransactionId - i.Prepayment = temp.Prepayment - i.GatewayHandle = temp.GatewayHandle - i.GatewayUsed = temp.GatewayUsed - i.GatewayTransactionId = temp.GatewayTransactionId - return nil + temp := &struct { + TransactionTime *string `json:"transaction_time,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + PaymentMethod *InvoicePaymentMethod `json:"payment_method,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + Prepayment *bool `json:"prepayment,omitempty"` + GatewayHandle Optional[string] `json:"gateway_handle"` + GatewayUsed *string `json:"gateway_used,omitempty"` + GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + if temp.TransactionTime != nil { + TransactionTimeVal, err := time.Parse(time.RFC3339, *temp.TransactionTime) + if err != nil { + log.Fatalf("Cannot Parse transaction_time as % s format.", time.RFC3339) + } + i.TransactionTime = &TransactionTimeVal + } + i.Memo = temp.Memo + i.OriginalAmount = temp.OriginalAmount + i.AppliedAmount = temp.AppliedAmount + i.PaymentMethod = temp.PaymentMethod + i.TransactionId = temp.TransactionId + i.Prepayment = temp.Prepayment + i.GatewayHandle = temp.GatewayHandle + i.GatewayUsed = temp.GatewayUsed + i.GatewayTransactionId = temp.GatewayTransactionId + return nil } diff --git a/models/invoice_payment_application.go b/models/invoice_payment_application.go index 9b14d26f..15668962 100644 --- a/models/invoice_payment_application.go +++ b/models/invoice_payment_application.go @@ -1,57 +1,57 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoicePaymentApplication represents a InvoicePaymentApplication struct. type InvoicePaymentApplication struct { - // Unique identifier for the paid invoice. It has the prefix "inv_" followed by alphanumeric characters. - InvoiceUid *string `json:"invoice_uid,omitempty"` - // Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. - ApplicationUid *string `json:"application_uid,omitempty"` - // Dollar amount of the paid invoice. - AppliedAmount *string `json:"applied_amount,omitempty"` + // Unique identifier for the paid invoice. It has the prefix "inv_" followed by alphanumeric characters. + InvoiceUid *string `json:"invoice_uid,omitempty"` + // Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. + ApplicationUid *string `json:"application_uid,omitempty"` + // Dollar amount of the paid invoice. + AppliedAmount *string `json:"applied_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePaymentApplication. +// MarshalJSON implements the json.Marshaler interface for InvoicePaymentApplication. // It customizes the JSON marshaling process for InvoicePaymentApplication objects. func (i *InvoicePaymentApplication) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePaymentApplication object to a map representation for JSON marshaling. func (i *InvoicePaymentApplication) toMap() map[string]any { - structMap := make(map[string]any) - if i.InvoiceUid != nil { - structMap["invoice_uid"] = i.InvoiceUid - } - if i.ApplicationUid != nil { - structMap["application_uid"] = i.ApplicationUid - } - if i.AppliedAmount != nil { - structMap["applied_amount"] = i.AppliedAmount - } - return structMap + structMap := make(map[string]any) + if i.InvoiceUid != nil { + structMap["invoice_uid"] = i.InvoiceUid + } + if i.ApplicationUid != nil { + structMap["application_uid"] = i.ApplicationUid + } + if i.AppliedAmount != nil { + structMap["applied_amount"] = i.AppliedAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentApplication. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentApplication. // It customizes the JSON unmarshaling process for InvoicePaymentApplication objects. func (i *InvoicePaymentApplication) UnmarshalJSON(input []byte) error { - temp := &struct { - InvoiceUid *string `json:"invoice_uid,omitempty"` - ApplicationUid *string `json:"application_uid,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.InvoiceUid = temp.InvoiceUid - i.ApplicationUid = temp.ApplicationUid - i.AppliedAmount = temp.AppliedAmount - return nil + temp := &struct { + InvoiceUid *string `json:"invoice_uid,omitempty"` + ApplicationUid *string `json:"application_uid,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.InvoiceUid = temp.InvoiceUid + i.ApplicationUid = temp.ApplicationUid + i.AppliedAmount = temp.AppliedAmount + return nil } diff --git a/models/invoice_payment_method.go b/models/invoice_payment_method.go index cb2d5126..e58ef307 100644 --- a/models/invoice_payment_method.go +++ b/models/invoice_payment_method.go @@ -1,84 +1,84 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoicePaymentMethod represents a InvoicePaymentMethod struct. type InvoicePaymentMethod struct { - Details *string `json:"details,omitempty"` - Kind *string `json:"kind,omitempty"` - Memo *string `json:"memo,omitempty"` - Type *string `json:"type,omitempty"` - CardBrand *string `json:"card_brand,omitempty"` - CardExpiration *string `json:"card_expiration,omitempty"` - LastFour Optional[string] `json:"last_four"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` + Details *string `json:"details,omitempty"` + Kind *string `json:"kind,omitempty"` + Memo *string `json:"memo,omitempty"` + Type *string `json:"type,omitempty"` + CardBrand *string `json:"card_brand,omitempty"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePaymentMethod. +// MarshalJSON implements the json.Marshaler interface for InvoicePaymentMethod. // It customizes the JSON marshaling process for InvoicePaymentMethod objects. func (i *InvoicePaymentMethod) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePaymentMethod object to a map representation for JSON marshaling. func (i *InvoicePaymentMethod) toMap() map[string]any { - structMap := make(map[string]any) - if i.Details != nil { - structMap["details"] = i.Details - } - if i.Kind != nil { - structMap["kind"] = i.Kind - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.Type != nil { - structMap["type"] = i.Type - } - if i.CardBrand != nil { - structMap["card_brand"] = i.CardBrand - } - if i.CardExpiration != nil { - structMap["card_expiration"] = i.CardExpiration - } - if i.LastFour.IsValueSet() { - structMap["last_four"] = i.LastFour.Value() - } - if i.MaskedCardNumber != nil { - structMap["masked_card_number"] = i.MaskedCardNumber - } - return structMap + structMap := make(map[string]any) + if i.Details != nil { + structMap["details"] = i.Details + } + if i.Kind != nil { + structMap["kind"] = i.Kind + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.Type != nil { + structMap["type"] = i.Type + } + if i.CardBrand != nil { + structMap["card_brand"] = i.CardBrand + } + if i.CardExpiration != nil { + structMap["card_expiration"] = i.CardExpiration + } + if i.LastFour.IsValueSet() { + structMap["last_four"] = i.LastFour.Value() + } + if i.MaskedCardNumber != nil { + structMap["masked_card_number"] = i.MaskedCardNumber + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentMethod. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentMethod. // It customizes the JSON unmarshaling process for InvoicePaymentMethod objects. func (i *InvoicePaymentMethod) UnmarshalJSON(input []byte) error { - temp := &struct { - Details *string `json:"details,omitempty"` - Kind *string `json:"kind,omitempty"` - Memo *string `json:"memo,omitempty"` - Type *string `json:"type,omitempty"` - CardBrand *string `json:"card_brand,omitempty"` - CardExpiration *string `json:"card_expiration,omitempty"` - LastFour Optional[string] `json:"last_four"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Details = temp.Details - i.Kind = temp.Kind - i.Memo = temp.Memo - i.Type = temp.Type - i.CardBrand = temp.CardBrand - i.CardExpiration = temp.CardExpiration - i.LastFour = temp.LastFour - i.MaskedCardNumber = temp.MaskedCardNumber - return nil + temp := &struct { + Details *string `json:"details,omitempty"` + Kind *string `json:"kind,omitempty"` + Memo *string `json:"memo,omitempty"` + Type *string `json:"type,omitempty"` + CardBrand *string `json:"card_brand,omitempty"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Details = temp.Details + i.Kind = temp.Kind + i.Memo = temp.Memo + i.Type = temp.Type + i.CardBrand = temp.CardBrand + i.CardExpiration = temp.CardExpiration + i.LastFour = temp.LastFour + i.MaskedCardNumber = temp.MaskedCardNumber + return nil } diff --git a/models/invoice_pre_payment.go b/models/invoice_pre_payment.go index ea32da9f..f1a6968e 100644 --- a/models/invoice_pre_payment.go +++ b/models/invoice_pre_payment.go @@ -1,57 +1,57 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoicePrePayment represents a InvoicePrePayment struct. type InvoicePrePayment struct { - // The subscription id for the prepayment account - SubscriptionId *string `json:"subscription_id,omitempty"` - // The amount in cents of the prepayment that was created as a result of this payment. - AmountInCents *string `json:"amount_in_cents,omitempty"` - // The total balance of the prepayment account for this subscription including any prior prepayments - EndingBalanceInCents *string `json:"ending_balance_in_cents,omitempty"` + // The subscription id for the prepayment account + SubscriptionId *string `json:"subscription_id,omitempty"` + // The amount in cents of the prepayment that was created as a result of this payment. + AmountInCents *string `json:"amount_in_cents,omitempty"` + // The total balance of the prepayment account for this subscription including any prior prepayments + EndingBalanceInCents *string `json:"ending_balance_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePrePayment. +// MarshalJSON implements the json.Marshaler interface for InvoicePrePayment. // It customizes the JSON marshaling process for InvoicePrePayment objects. func (i *InvoicePrePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePrePayment object to a map representation for JSON marshaling. func (i *InvoicePrePayment) toMap() map[string]any { - structMap := make(map[string]any) - if i.SubscriptionId != nil { - structMap["subscription_id"] = i.SubscriptionId - } - if i.AmountInCents != nil { - structMap["amount_in_cents"] = i.AmountInCents - } - if i.EndingBalanceInCents != nil { - structMap["ending_balance_in_cents"] = i.EndingBalanceInCents - } - return structMap + structMap := make(map[string]any) + if i.SubscriptionId != nil { + structMap["subscription_id"] = i.SubscriptionId + } + if i.AmountInCents != nil { + structMap["amount_in_cents"] = i.AmountInCents + } + if i.EndingBalanceInCents != nil { + structMap["ending_balance_in_cents"] = i.EndingBalanceInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePrePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePrePayment. // It customizes the JSON unmarshaling process for InvoicePrePayment objects. func (i *InvoicePrePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionId *string `json:"subscription_id,omitempty"` - AmountInCents *string `json:"amount_in_cents,omitempty"` - EndingBalanceInCents *string `json:"ending_balance_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.SubscriptionId = temp.SubscriptionId - i.AmountInCents = temp.AmountInCents - i.EndingBalanceInCents = temp.EndingBalanceInCents - return nil + temp := &struct { + SubscriptionId *string `json:"subscription_id,omitempty"` + AmountInCents *string `json:"amount_in_cents,omitempty"` + EndingBalanceInCents *string `json:"ending_balance_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.SubscriptionId = temp.SubscriptionId + i.AmountInCents = temp.AmountInCents + i.EndingBalanceInCents = temp.EndingBalanceInCents + return nil } diff --git a/models/invoice_previous_balance.go b/models/invoice_previous_balance.go index 131f44aa..3b8fdc54 100644 --- a/models/invoice_previous_balance.go +++ b/models/invoice_previous_balance.go @@ -1,56 +1,56 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // InvoicePreviousBalance represents a InvoicePreviousBalance struct. type InvoicePreviousBalance struct { - CapturedAt *time.Time `json:"captured_at,omitempty"` - Invoices []InvoiceBalanceItem `json:"invoices,omitempty"` + CapturedAt *time.Time `json:"captured_at,omitempty"` + Invoices []InvoiceBalanceItem `json:"invoices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoicePreviousBalance. +// MarshalJSON implements the json.Marshaler interface for InvoicePreviousBalance. // It customizes the JSON marshaling process for InvoicePreviousBalance objects. func (i *InvoicePreviousBalance) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoicePreviousBalance object to a map representation for JSON marshaling. func (i *InvoicePreviousBalance) toMap() map[string]any { - structMap := make(map[string]any) - if i.CapturedAt != nil { - structMap["captured_at"] = i.CapturedAt.Format(time.RFC3339) - } - if i.Invoices != nil { - structMap["invoices"] = i.Invoices - } - return structMap + structMap := make(map[string]any) + if i.CapturedAt != nil { + structMap["captured_at"] = i.CapturedAt.Format(time.RFC3339) + } + if i.Invoices != nil { + structMap["invoices"] = i.Invoices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePreviousBalance. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoicePreviousBalance. // It customizes the JSON unmarshaling process for InvoicePreviousBalance objects. func (i *InvoicePreviousBalance) UnmarshalJSON(input []byte) error { - temp := &struct { - CapturedAt *string `json:"captured_at,omitempty"` - Invoices []InvoiceBalanceItem `json:"invoices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - if temp.CapturedAt != nil { - CapturedAtVal, err := time.Parse(time.RFC3339, *temp.CapturedAt) - if err != nil { - log.Fatalf("Cannot Parse captured_at as % s format.", time.RFC3339) - } - i.CapturedAt = &CapturedAtVal - } - i.Invoices = temp.Invoices - return nil + temp := &struct { + CapturedAt *string `json:"captured_at,omitempty"` + Invoices []InvoiceBalanceItem `json:"invoices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + if temp.CapturedAt != nil { + CapturedAtVal, err := time.Parse(time.RFC3339, *temp.CapturedAt) + if err != nil { + log.Fatalf("Cannot Parse captured_at as % s format.", time.RFC3339) + } + i.CapturedAt = &CapturedAtVal + } + i.Invoices = temp.Invoices + return nil } diff --git a/models/invoice_refund.go b/models/invoice_refund.go index 91d85fa0..b129eb5b 100644 --- a/models/invoice_refund.go +++ b/models/invoice_refund.go @@ -1,73 +1,73 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceRefund represents a InvoiceRefund struct. type InvoiceRefund struct { - TransactionId *int `json:"transaction_id,omitempty"` - PaymentId *int `json:"payment_id,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - // The transaction ID for the refund as returned from the payment gateway - GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` + TransactionId *int `json:"transaction_id,omitempty"` + PaymentId *int `json:"payment_id,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + // The transaction ID for the refund as returned from the payment gateway + GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceRefund. +// MarshalJSON implements the json.Marshaler interface for InvoiceRefund. // It customizes the JSON marshaling process for InvoiceRefund objects. func (i *InvoiceRefund) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceRefund object to a map representation for JSON marshaling. func (i *InvoiceRefund) toMap() map[string]any { - structMap := make(map[string]any) - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.PaymentId != nil { - structMap["payment_id"] = i.PaymentId - } - if i.Memo != nil { - structMap["memo"] = i.Memo - } - if i.OriginalAmount != nil { - structMap["original_amount"] = i.OriginalAmount - } - if i.AppliedAmount != nil { - structMap["applied_amount"] = i.AppliedAmount - } - if i.GatewayTransactionId.IsValueSet() { - structMap["gateway_transaction_id"] = i.GatewayTransactionId.Value() - } - return structMap + structMap := make(map[string]any) + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.PaymentId != nil { + structMap["payment_id"] = i.PaymentId + } + if i.Memo != nil { + structMap["memo"] = i.Memo + } + if i.OriginalAmount != nil { + structMap["original_amount"] = i.OriginalAmount + } + if i.AppliedAmount != nil { + structMap["applied_amount"] = i.AppliedAmount + } + if i.GatewayTransactionId.IsValueSet() { + structMap["gateway_transaction_id"] = i.GatewayTransactionId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceRefund. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceRefund. // It customizes the JSON unmarshaling process for InvoiceRefund objects. func (i *InvoiceRefund) UnmarshalJSON(input []byte) error { - temp := &struct { - TransactionId *int `json:"transaction_id,omitempty"` - PaymentId *int `json:"payment_id,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.TransactionId = temp.TransactionId - i.PaymentId = temp.PaymentId - i.Memo = temp.Memo - i.OriginalAmount = temp.OriginalAmount - i.AppliedAmount = temp.AppliedAmount - i.GatewayTransactionId = temp.GatewayTransactionId - return nil + temp := &struct { + TransactionId *int `json:"transaction_id,omitempty"` + PaymentId *int `json:"payment_id,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + GatewayTransactionId Optional[string] `json:"gateway_transaction_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.TransactionId = temp.TransactionId + i.PaymentId = temp.PaymentId + i.Memo = temp.Memo + i.OriginalAmount = temp.OriginalAmount + i.AppliedAmount = temp.AppliedAmount + i.GatewayTransactionId = temp.GatewayTransactionId + return nil } diff --git a/models/invoice_response.go b/models/invoice_response.go index e20cccd9..e97fb61d 100644 --- a/models/invoice_response.go +++ b/models/invoice_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceResponse represents a InvoiceResponse struct. type InvoiceResponse struct { - Invoice Invoice `json:"invoice"` + Invoice Invoice `json:"invoice"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceResponse. +// MarshalJSON implements the json.Marshaler interface for InvoiceResponse. // It customizes the JSON marshaling process for InvoiceResponse objects. func (i *InvoiceResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceResponse object to a map representation for JSON marshaling. func (i *InvoiceResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["invoice"] = i.Invoice - return structMap + structMap := make(map[string]any) + structMap["invoice"] = i.Invoice.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceResponse. // It customizes the JSON unmarshaling process for InvoiceResponse objects. func (i *InvoiceResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Invoice Invoice `json:"invoice"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Invoice = temp.Invoice - return nil + temp := &struct { + Invoice Invoice `json:"invoice"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Invoice = temp.Invoice + return nil } diff --git a/models/invoice_seller.go b/models/invoice_seller.go index 94ac8569..36213800 100644 --- a/models/invoice_seller.go +++ b/models/invoice_seller.go @@ -1,61 +1,61 @@ package models import ( - "encoding/json" + "encoding/json" ) -// InvoiceSeller represents a InvoiceSeller struct. +// InvoiceSeller represents a InvoiceSeller struct. // Information about the seller (merchant) listed on the masthead of the invoice. type InvoiceSeller struct { - Name *string `json:"name,omitempty"` - Address *InvoiceAddress `json:"address,omitempty"` - Phone *string `json:"phone,omitempty"` - LogoUrl Optional[string] `json:"logo_url"` + Name *string `json:"name,omitempty"` + Address *InvoiceAddress `json:"address,omitempty"` + Phone *string `json:"phone,omitempty"` + LogoUrl Optional[string] `json:"logo_url"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceSeller. +// MarshalJSON implements the json.Marshaler interface for InvoiceSeller. // It customizes the JSON marshaling process for InvoiceSeller objects. func (i *InvoiceSeller) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceSeller object to a map representation for JSON marshaling. func (i *InvoiceSeller) toMap() map[string]any { - structMap := make(map[string]any) - if i.Name != nil { - structMap["name"] = i.Name - } - if i.Address != nil { - structMap["address"] = i.Address - } - if i.Phone != nil { - structMap["phone"] = i.Phone - } - if i.LogoUrl.IsValueSet() { - structMap["logo_url"] = i.LogoUrl.Value() - } - return structMap + structMap := make(map[string]any) + if i.Name != nil { + structMap["name"] = i.Name + } + if i.Address != nil { + structMap["address"] = i.Address.toMap() + } + if i.Phone != nil { + structMap["phone"] = i.Phone + } + if i.LogoUrl.IsValueSet() { + structMap["logo_url"] = i.LogoUrl.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceSeller. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceSeller. // It customizes the JSON unmarshaling process for InvoiceSeller objects. func (i *InvoiceSeller) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Address *InvoiceAddress `json:"address,omitempty"` - Phone *string `json:"phone,omitempty"` - LogoUrl Optional[string] `json:"logo_url"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Name = temp.Name - i.Address = temp.Address - i.Phone = temp.Phone - i.LogoUrl = temp.LogoUrl - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Address *InvoiceAddress `json:"address,omitempty"` + Phone *string `json:"phone,omitempty"` + LogoUrl Optional[string] `json:"logo_url"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Name = temp.Name + i.Address = temp.Address + i.Phone = temp.Phone + i.LogoUrl = temp.LogoUrl + return nil } diff --git a/models/invoice_tax.go b/models/invoice_tax.go index ed04f3d6..bfc24a50 100644 --- a/models/invoice_tax.go +++ b/models/invoice_tax.go @@ -1,102 +1,102 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceTax represents a InvoiceTax struct. type InvoiceTax struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description Optional[string] `json:"description"` - SourceType *string `json:"source_type,omitempty"` - SourceId *int `json:"source_id,omitempty"` - Percentage *string `json:"percentage,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - LineItemBreakouts []InvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` - TaxComponentBreakouts []InvoiceTaxComponentBreakout `json:"tax_component_breakouts,omitempty"` + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description Optional[string] `json:"description"` + SourceType *string `json:"source_type,omitempty"` + SourceId *int `json:"source_id,omitempty"` + Percentage *string `json:"percentage,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + LineItemBreakouts []InvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` + TaxComponentBreakouts []InvoiceTaxComponentBreakout `json:"tax_component_breakouts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceTax. +// MarshalJSON implements the json.Marshaler interface for InvoiceTax. // It customizes the JSON marshaling process for InvoiceTax objects. func (i *InvoiceTax) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceTax object to a map representation for JSON marshaling. func (i *InvoiceTax) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.Title != nil { - structMap["title"] = i.Title - } - if i.Description.IsValueSet() { - structMap["description"] = i.Description.Value() - } - if i.SourceType != nil { - structMap["source_type"] = i.SourceType - } - if i.SourceId != nil { - structMap["source_id"] = i.SourceId - } - if i.Percentage != nil { - structMap["percentage"] = i.Percentage - } - if i.TaxableAmount != nil { - structMap["taxable_amount"] = i.TaxableAmount - } - if i.TaxAmount != nil { - structMap["tax_amount"] = i.TaxAmount - } - if i.TransactionId != nil { - structMap["transaction_id"] = i.TransactionId - } - if i.LineItemBreakouts != nil { - structMap["line_item_breakouts"] = i.LineItemBreakouts - } - if i.TaxComponentBreakouts != nil { - structMap["tax_component_breakouts"] = i.TaxComponentBreakouts - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.Title != nil { + structMap["title"] = i.Title + } + if i.Description.IsValueSet() { + structMap["description"] = i.Description.Value() + } + if i.SourceType != nil { + structMap["source_type"] = i.SourceType + } + if i.SourceId != nil { + structMap["source_id"] = i.SourceId + } + if i.Percentage != nil { + structMap["percentage"] = i.Percentage + } + if i.TaxableAmount != nil { + structMap["taxable_amount"] = i.TaxableAmount + } + if i.TaxAmount != nil { + structMap["tax_amount"] = i.TaxAmount + } + if i.TransactionId != nil { + structMap["transaction_id"] = i.TransactionId + } + if i.LineItemBreakouts != nil { + structMap["line_item_breakouts"] = i.LineItemBreakouts + } + if i.TaxComponentBreakouts != nil { + structMap["tax_component_breakouts"] = i.TaxComponentBreakouts + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTax. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTax. // It customizes the JSON unmarshaling process for InvoiceTax objects. func (i *InvoiceTax) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - Description Optional[string] `json:"description"` - SourceType *string `json:"source_type,omitempty"` - SourceId *int `json:"source_id,omitempty"` - Percentage *string `json:"percentage,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TransactionId *int `json:"transaction_id,omitempty"` - LineItemBreakouts []InvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` - TaxComponentBreakouts []InvoiceTaxComponentBreakout `json:"tax_component_breakouts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.Title = temp.Title - i.Description = temp.Description - i.SourceType = temp.SourceType - i.SourceId = temp.SourceId - i.Percentage = temp.Percentage - i.TaxableAmount = temp.TaxableAmount - i.TaxAmount = temp.TaxAmount - i.TransactionId = temp.TransactionId - i.LineItemBreakouts = temp.LineItemBreakouts - i.TaxComponentBreakouts = temp.TaxComponentBreakouts - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + Description Optional[string] `json:"description"` + SourceType *string `json:"source_type,omitempty"` + SourceId *int `json:"source_id,omitempty"` + Percentage *string `json:"percentage,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TransactionId *int `json:"transaction_id,omitempty"` + LineItemBreakouts []InvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` + TaxComponentBreakouts []InvoiceTaxComponentBreakout `json:"tax_component_breakouts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.Title = temp.Title + i.Description = temp.Description + i.SourceType = temp.SourceType + i.SourceId = temp.SourceId + i.Percentage = temp.Percentage + i.TaxableAmount = temp.TaxableAmount + i.TaxAmount = temp.TaxAmount + i.TransactionId = temp.TransactionId + i.LineItemBreakouts = temp.LineItemBreakouts + i.TaxComponentBreakouts = temp.TaxComponentBreakouts + return nil } diff --git a/models/invoice_tax_breakout.go b/models/invoice_tax_breakout.go index 3e493cf2..c60c0e9f 100644 --- a/models/invoice_tax_breakout.go +++ b/models/invoice_tax_breakout.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceTaxBreakout represents a InvoiceTaxBreakout struct. type InvoiceTaxBreakout struct { - Uid *string `json:"uid,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceTaxBreakout. +// MarshalJSON implements the json.Marshaler interface for InvoiceTaxBreakout. // It customizes the JSON marshaling process for InvoiceTaxBreakout objects. func (i *InvoiceTaxBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceTaxBreakout object to a map representation for JSON marshaling. func (i *InvoiceTaxBreakout) toMap() map[string]any { - structMap := make(map[string]any) - if i.Uid != nil { - structMap["uid"] = i.Uid - } - if i.TaxableAmount != nil { - structMap["taxable_amount"] = i.TaxableAmount - } - if i.TaxAmount != nil { - structMap["tax_amount"] = i.TaxAmount - } - return structMap + structMap := make(map[string]any) + if i.Uid != nil { + structMap["uid"] = i.Uid + } + if i.TaxableAmount != nil { + structMap["taxable_amount"] = i.TaxableAmount + } + if i.TaxAmount != nil { + structMap["tax_amount"] = i.TaxAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxBreakout. // It customizes the JSON unmarshaling process for InvoiceTaxBreakout objects. func (i *InvoiceTaxBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Uid = temp.Uid - i.TaxableAmount = temp.TaxableAmount - i.TaxAmount = temp.TaxAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Uid = temp.Uid + i.TaxableAmount = temp.TaxableAmount + i.TaxAmount = temp.TaxAmount + return nil } diff --git a/models/invoice_tax_component_breakout.go b/models/invoice_tax_component_breakout.go index 9c391a40..c0a24dea 100644 --- a/models/invoice_tax_component_breakout.go +++ b/models/invoice_tax_component_breakout.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // InvoiceTaxComponentBreakout represents a InvoiceTaxComponentBreakout struct. type InvoiceTaxComponentBreakout struct { - TaxRuleId *int `json:"tax_rule_id,omitempty"` - Percentage *string `json:"percentage,omitempty"` - CountryCode *string `json:"country_code,omitempty"` - SubdivisionCode *string `json:"subdivision_code,omitempty"` + TaxRuleId *int `json:"tax_rule_id,omitempty"` + Percentage *string `json:"percentage,omitempty"` + CountryCode *string `json:"country_code,omitempty"` + SubdivisionCode *string `json:"subdivision_code,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for InvoiceTaxComponentBreakout. +// MarshalJSON implements the json.Marshaler interface for InvoiceTaxComponentBreakout. // It customizes the JSON marshaling process for InvoiceTaxComponentBreakout objects. func (i *InvoiceTaxComponentBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the InvoiceTaxComponentBreakout object to a map representation for JSON marshaling. func (i *InvoiceTaxComponentBreakout) toMap() map[string]any { - structMap := make(map[string]any) - if i.TaxRuleId != nil { - structMap["tax_rule_id"] = i.TaxRuleId - } - if i.Percentage != nil { - structMap["percentage"] = i.Percentage - } - if i.CountryCode != nil { - structMap["country_code"] = i.CountryCode - } - if i.SubdivisionCode != nil { - structMap["subdivision_code"] = i.SubdivisionCode - } - return structMap + structMap := make(map[string]any) + if i.TaxRuleId != nil { + structMap["tax_rule_id"] = i.TaxRuleId + } + if i.Percentage != nil { + structMap["percentage"] = i.Percentage + } + if i.CountryCode != nil { + structMap["country_code"] = i.CountryCode + } + if i.SubdivisionCode != nil { + structMap["subdivision_code"] = i.SubdivisionCode + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxComponentBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxComponentBreakout. // It customizes the JSON unmarshaling process for InvoiceTaxComponentBreakout objects. func (i *InvoiceTaxComponentBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - TaxRuleId *int `json:"tax_rule_id,omitempty"` - Percentage *string `json:"percentage,omitempty"` - CountryCode *string `json:"country_code,omitempty"` - SubdivisionCode *string `json:"subdivision_code,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.TaxRuleId = temp.TaxRuleId - i.Percentage = temp.Percentage - i.CountryCode = temp.CountryCode - i.SubdivisionCode = temp.SubdivisionCode - return nil + temp := &struct { + TaxRuleId *int `json:"tax_rule_id,omitempty"` + Percentage *string `json:"percentage,omitempty"` + CountryCode *string `json:"country_code,omitempty"` + SubdivisionCode *string `json:"subdivision_code,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.TaxRuleId = temp.TaxRuleId + i.Percentage = temp.Percentage + i.CountryCode = temp.CountryCode + i.SubdivisionCode = temp.SubdivisionCode + return nil } diff --git a/models/issue_advance_invoice_request.go b/models/issue_advance_invoice_request.go index f558ace6..fe6baedf 100644 --- a/models/issue_advance_invoice_request.go +++ b/models/issue_advance_invoice_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // IssueAdvanceInvoiceRequest represents a IssueAdvanceInvoiceRequest struct. type IssueAdvanceInvoiceRequest struct { - Force *bool `json:"force,omitempty"` + Force *bool `json:"force,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for IssueAdvanceInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for IssueAdvanceInvoiceRequest. // It customizes the JSON marshaling process for IssueAdvanceInvoiceRequest objects. func (i *IssueAdvanceInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the IssueAdvanceInvoiceRequest object to a map representation for JSON marshaling. func (i *IssueAdvanceInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - if i.Force != nil { - structMap["force"] = i.Force - } - return structMap + structMap := make(map[string]any) + if i.Force != nil { + structMap["force"] = i.Force + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for IssueAdvanceInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for IssueAdvanceInvoiceRequest. // It customizes the JSON unmarshaling process for IssueAdvanceInvoiceRequest objects. func (i *IssueAdvanceInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Force *bool `json:"force,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Force = temp.Force - return nil + temp := &struct { + Force *bool `json:"force,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Force = temp.Force + return nil } diff --git a/models/issue_invoice_request.go b/models/issue_invoice_request.go index 447b0805..cab77206 100644 --- a/models/issue_invoice_request.go +++ b/models/issue_invoice_request.go @@ -1,46 +1,46 @@ package models import ( - "encoding/json" + "encoding/json" ) // IssueInvoiceRequest represents a IssueInvoiceRequest struct. type IssueInvoiceRequest struct { - // 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). - OnFailedPayment *FailedPaymentAction `json:"on_failed_payment,omitempty"` + // 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). + OnFailedPayment *FailedPaymentAction `json:"on_failed_payment,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for IssueInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for IssueInvoiceRequest. // It customizes the JSON marshaling process for IssueInvoiceRequest objects. func (i *IssueInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the IssueInvoiceRequest object to a map representation for JSON marshaling. func (i *IssueInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - if i.OnFailedPayment != nil { - structMap["on_failed_payment"] = i.OnFailedPayment - } - return structMap + structMap := make(map[string]any) + if i.OnFailedPayment != nil { + structMap["on_failed_payment"] = i.OnFailedPayment + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for IssueInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for IssueInvoiceRequest. // It customizes the JSON unmarshaling process for IssueInvoiceRequest objects. func (i *IssueInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - OnFailedPayment *FailedPaymentAction `json:"on_failed_payment,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.OnFailedPayment = temp.OnFailedPayment - return nil + temp := &struct { + OnFailedPayment *FailedPaymentAction `json:"on_failed_payment,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.OnFailedPayment = temp.OnFailedPayment + return nil } diff --git a/models/issue_service_credit.go b/models/issue_service_credit.go index 03513666..ad25dcb5 100644 --- a/models/issue_service_credit.go +++ b/models/issue_service_credit.go @@ -1,44 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) // IssueServiceCredit represents a IssueServiceCredit struct. type IssueServiceCredit struct { - Amount interface{} `json:"amount"` - Memo string `json:"memo"` + Amount interface{} `json:"amount"` + Memo string `json:"memo"` } -// MarshalJSON implements the json.Marshaler interface for IssueServiceCredit. +// MarshalJSON implements the json.Marshaler interface for IssueServiceCredit. // It customizes the JSON marshaling process for IssueServiceCredit objects. func (i *IssueServiceCredit) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the IssueServiceCredit object to a map representation for JSON marshaling. func (i *IssueServiceCredit) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount"] = i.Amount - structMap["memo"] = i.Memo - return structMap + structMap := make(map[string]any) + structMap["amount"] = i.Amount + structMap["memo"] = i.Memo + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCredit. +// UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCredit. // It customizes the JSON unmarshaling process for IssueServiceCredit objects. func (i *IssueServiceCredit) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount interface{} `json:"amount"` - Memo string `json:"memo"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.Amount = temp.Amount - i.Memo = temp.Memo - return nil + temp := &struct { + Amount interface{} `json:"amount"` + Memo string `json:"memo"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.Amount = temp.Amount + i.Memo = temp.Memo + return nil } diff --git a/models/issue_service_credit_request.go b/models/issue_service_credit_request.go index af273f4d..28d21a75 100644 --- a/models/issue_service_credit_request.go +++ b/models/issue_service_credit_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // IssueServiceCreditRequest represents a IssueServiceCreditRequest struct. type IssueServiceCreditRequest struct { - ServiceCredit IssueServiceCredit `json:"service_credit"` + ServiceCredit IssueServiceCredit `json:"service_credit"` } -// MarshalJSON implements the json.Marshaler interface for IssueServiceCreditRequest. +// MarshalJSON implements the json.Marshaler interface for IssueServiceCreditRequest. // It customizes the JSON marshaling process for IssueServiceCreditRequest objects. func (i *IssueServiceCreditRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(i.toMap()) + []byte, + error) { + return json.Marshal(i.toMap()) } // toMap converts the IssueServiceCreditRequest object to a map representation for JSON marshaling. func (i *IssueServiceCreditRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["service_credit"] = i.ServiceCredit - return structMap + structMap := make(map[string]any) + structMap["service_credit"] = i.ServiceCredit.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCreditRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCreditRequest. // It customizes the JSON unmarshaling process for IssueServiceCreditRequest objects. func (i *IssueServiceCreditRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - ServiceCredit IssueServiceCredit `json:"service_credit"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - i.ServiceCredit = temp.ServiceCredit - return nil + temp := &struct { + ServiceCredit IssueServiceCredit `json:"service_credit"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + i.ServiceCredit = temp.ServiceCredit + return nil } diff --git a/models/list_components_price_points_response.go b/models/list_components_price_points_response.go index 8983b79b..9da3dd47 100644 --- a/models/list_components_price_points_response.go +++ b/models/list_components_price_points_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListComponentsPricePointsResponse represents a ListComponentsPricePointsResponse struct. type ListComponentsPricePointsResponse struct { - PricePoints []ComponentPricePoint `json:"price_points"` + PricePoints []ComponentPricePoint `json:"price_points"` } -// MarshalJSON implements the json.Marshaler interface for ListComponentsPricePointsResponse. +// MarshalJSON implements the json.Marshaler interface for ListComponentsPricePointsResponse. // It customizes the JSON marshaling process for ListComponentsPricePointsResponse objects. func (l *ListComponentsPricePointsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListComponentsPricePointsResponse object to a map representation for JSON marshaling. func (l *ListComponentsPricePointsResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["price_points"] = l.PricePoints - return structMap + structMap := make(map[string]any) + structMap["price_points"] = l.PricePoints + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListComponentsPricePointsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListComponentsPricePointsResponse. // It customizes the JSON unmarshaling process for ListComponentsPricePointsResponse objects. func (l *ListComponentsPricePointsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoints []ComponentPricePoint `json:"price_points"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.PricePoints = temp.PricePoints - return nil + temp := &struct { + PricePoints []ComponentPricePoint `json:"price_points"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.PricePoints = temp.PricePoints + return nil } diff --git a/models/list_credit_notes_response.go b/models/list_credit_notes_response.go index bf672270..981a6f72 100644 --- a/models/list_credit_notes_response.go +++ b/models/list_credit_notes_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListCreditNotesResponse represents a ListCreditNotesResponse struct. type ListCreditNotesResponse struct { - CreditNotes []CreditNote `json:"credit_notes"` + CreditNotes []CreditNote `json:"credit_notes"` } -// MarshalJSON implements the json.Marshaler interface for ListCreditNotesResponse. +// MarshalJSON implements the json.Marshaler interface for ListCreditNotesResponse. // It customizes the JSON marshaling process for ListCreditNotesResponse objects. func (l *ListCreditNotesResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListCreditNotesResponse object to a map representation for JSON marshaling. func (l *ListCreditNotesResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["credit_notes"] = l.CreditNotes - return structMap + structMap := make(map[string]any) + structMap["credit_notes"] = l.CreditNotes + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListCreditNotesResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListCreditNotesResponse. // It customizes the JSON unmarshaling process for ListCreditNotesResponse objects. func (l *ListCreditNotesResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - CreditNotes []CreditNote `json:"credit_notes"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.CreditNotes = temp.CreditNotes - return nil + temp := &struct { + CreditNotes []CreditNote `json:"credit_notes"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.CreditNotes = temp.CreditNotes + return nil } diff --git a/models/list_invoice_events_response.go b/models/list_invoice_events_response.go index 33e37527..7cdfe241 100644 --- a/models/list_invoice_events_response.go +++ b/models/list_invoice_events_response.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListInvoiceEventsResponse represents a ListInvoiceEventsResponse struct. type ListInvoiceEventsResponse struct { - Events []InvoiceEvent `json:"events,omitempty"` - Page *int `json:"page,omitempty"` - PerPage *int `json:"per_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` + Events []InvoiceEvent `json:"events,omitempty"` + Page *int `json:"page,omitempty"` + PerPage *int `json:"per_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListInvoiceEventsResponse. +// MarshalJSON implements the json.Marshaler interface for ListInvoiceEventsResponse. // It customizes the JSON marshaling process for ListInvoiceEventsResponse objects. func (l *ListInvoiceEventsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListInvoiceEventsResponse object to a map representation for JSON marshaling. func (l *ListInvoiceEventsResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.Events != nil { - structMap["events"] = l.Events - } - if l.Page != nil { - structMap["page"] = l.Page - } - if l.PerPage != nil { - structMap["per_page"] = l.PerPage - } - if l.TotalPages != nil { - structMap["total_pages"] = l.TotalPages - } - return structMap + structMap := make(map[string]any) + if l.Events != nil { + structMap["events"] = l.Events + } + if l.Page != nil { + structMap["page"] = l.Page + } + if l.PerPage != nil { + structMap["per_page"] = l.PerPage + } + if l.TotalPages != nil { + structMap["total_pages"] = l.TotalPages + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListInvoiceEventsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListInvoiceEventsResponse. // It customizes the JSON unmarshaling process for ListInvoiceEventsResponse objects. func (l *ListInvoiceEventsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Events []InvoiceEvent `json:"events,omitempty"` - Page *int `json:"page,omitempty"` - PerPage *int `json:"per_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Events = temp.Events - l.Page = temp.Page - l.PerPage = temp.PerPage - l.TotalPages = temp.TotalPages - return nil + temp := &struct { + Events []InvoiceEvent `json:"events,omitempty"` + Page *int `json:"page,omitempty"` + PerPage *int `json:"per_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Events = temp.Events + l.Page = temp.Page + l.PerPage = temp.PerPage + l.TotalPages = temp.TotalPages + return nil } diff --git a/models/list_invoices_response.go b/models/list_invoices_response.go index 80d08498..aa5a8012 100644 --- a/models/list_invoices_response.go +++ b/models/list_invoices_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListInvoicesResponse represents a ListInvoicesResponse struct. type ListInvoicesResponse struct { - Invoices []Invoice `json:"invoices"` + Invoices []Invoice `json:"invoices"` } -// MarshalJSON implements the json.Marshaler interface for ListInvoicesResponse. +// MarshalJSON implements the json.Marshaler interface for ListInvoicesResponse. // It customizes the JSON marshaling process for ListInvoicesResponse objects. func (l *ListInvoicesResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListInvoicesResponse object to a map representation for JSON marshaling. func (l *ListInvoicesResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["invoices"] = l.Invoices - return structMap + structMap := make(map[string]any) + structMap["invoices"] = l.Invoices + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListInvoicesResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListInvoicesResponse. // It customizes the JSON unmarshaling process for ListInvoicesResponse objects. func (l *ListInvoicesResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Invoices []Invoice `json:"invoices"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Invoices = temp.Invoices - return nil + temp := &struct { + Invoices []Invoice `json:"invoices"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Invoices = temp.Invoices + return nil } diff --git a/models/list_metafields_response.go b/models/list_metafields_response.go index ca15c0b0..e915834f 100644 --- a/models/list_metafields_response.go +++ b/models/list_metafields_response.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListMetafieldsResponse represents a ListMetafieldsResponse struct. type ListMetafieldsResponse struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` - Metafields []Metafield `json:"metafields,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` + Metafields []Metafield `json:"metafields,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListMetafieldsResponse. +// MarshalJSON implements the json.Marshaler interface for ListMetafieldsResponse. // It customizes the JSON marshaling process for ListMetafieldsResponse objects. func (l *ListMetafieldsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListMetafieldsResponse object to a map representation for JSON marshaling. func (l *ListMetafieldsResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.TotalCount != nil { - structMap["total_count"] = l.TotalCount - } - if l.CurrentPage != nil { - structMap["current_page"] = l.CurrentPage - } - if l.TotalPages != nil { - structMap["total_pages"] = l.TotalPages - } - if l.PerPage != nil { - structMap["per_page"] = l.PerPage - } - if l.Metafields != nil { - structMap["metafields"] = l.Metafields - } - return structMap + structMap := make(map[string]any) + if l.TotalCount != nil { + structMap["total_count"] = l.TotalCount + } + if l.CurrentPage != nil { + structMap["current_page"] = l.CurrentPage + } + if l.TotalPages != nil { + structMap["total_pages"] = l.TotalPages + } + if l.PerPage != nil { + structMap["per_page"] = l.PerPage + } + if l.Metafields != nil { + structMap["metafields"] = l.Metafields + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListMetafieldsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListMetafieldsResponse. // It customizes the JSON unmarshaling process for ListMetafieldsResponse objects. func (l *ListMetafieldsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` - Metafields []Metafield `json:"metafields,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.TotalCount = temp.TotalCount - l.CurrentPage = temp.CurrentPage - l.TotalPages = temp.TotalPages - l.PerPage = temp.PerPage - l.Metafields = temp.Metafields - return nil + temp := &struct { + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` + Metafields []Metafield `json:"metafields,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.TotalCount = temp.TotalCount + l.CurrentPage = temp.CurrentPage + l.TotalPages = temp.TotalPages + l.PerPage = temp.PerPage + l.Metafields = temp.Metafields + return nil } diff --git a/models/list_mrr_response.go b/models/list_mrr_response.go index 629f483d..2e61cebf 100644 --- a/models/list_mrr_response.go +++ b/models/list_mrr_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListMRRResponse represents a ListMRRResponse struct. type ListMRRResponse struct { - Mrr ListMRRResponseResult `json:"mrr"` + Mrr ListMRRResponseResult `json:"mrr"` } -// MarshalJSON implements the json.Marshaler interface for ListMRRResponse. +// MarshalJSON implements the json.Marshaler interface for ListMRRResponse. // It customizes the JSON marshaling process for ListMRRResponse objects. func (l *ListMRRResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListMRRResponse object to a map representation for JSON marshaling. func (l *ListMRRResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["mrr"] = l.Mrr - return structMap + structMap := make(map[string]any) + structMap["mrr"] = l.Mrr.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponse. // It customizes the JSON unmarshaling process for ListMRRResponse objects. func (l *ListMRRResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Mrr ListMRRResponseResult `json:"mrr"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Mrr = temp.Mrr - return nil + temp := &struct { + Mrr ListMRRResponseResult `json:"mrr"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Mrr = temp.Mrr + return nil } diff --git a/models/list_mrr_response_result.go b/models/list_mrr_response_result.go index d70148ce..96324824 100644 --- a/models/list_mrr_response_result.go +++ b/models/list_mrr_response_result.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListMRRResponseResult represents a ListMRRResponseResult struct. type ListMRRResponseResult struct { - Page *int `json:"page,omitempty"` - PerPage *int `json:"per_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - TotalEntries *int `json:"total_entries,omitempty"` - Currency *string `json:"currency,omitempty"` - CurrencySymbol *string `json:"currency_symbol,omitempty"` - Movements []Movement `json:"movements,omitempty"` + Page *int `json:"page,omitempty"` + PerPage *int `json:"per_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + TotalEntries *int `json:"total_entries,omitempty"` + Currency *string `json:"currency,omitempty"` + CurrencySymbol *string `json:"currency_symbol,omitempty"` + Movements []Movement `json:"movements,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListMRRResponseResult. +// MarshalJSON implements the json.Marshaler interface for ListMRRResponseResult. // It customizes the JSON marshaling process for ListMRRResponseResult objects. func (l *ListMRRResponseResult) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListMRRResponseResult object to a map representation for JSON marshaling. func (l *ListMRRResponseResult) toMap() map[string]any { - structMap := make(map[string]any) - if l.Page != nil { - structMap["page"] = l.Page - } - if l.PerPage != nil { - structMap["per_page"] = l.PerPage - } - if l.TotalPages != nil { - structMap["total_pages"] = l.TotalPages - } - if l.TotalEntries != nil { - structMap["total_entries"] = l.TotalEntries - } - if l.Currency != nil { - structMap["currency"] = l.Currency - } - if l.CurrencySymbol != nil { - structMap["currency_symbol"] = l.CurrencySymbol - } - if l.Movements != nil { - structMap["movements"] = l.Movements - } - return structMap + structMap := make(map[string]any) + if l.Page != nil { + structMap["page"] = l.Page + } + if l.PerPage != nil { + structMap["per_page"] = l.PerPage + } + if l.TotalPages != nil { + structMap["total_pages"] = l.TotalPages + } + if l.TotalEntries != nil { + structMap["total_entries"] = l.TotalEntries + } + if l.Currency != nil { + structMap["currency"] = l.Currency + } + if l.CurrencySymbol != nil { + structMap["currency_symbol"] = l.CurrencySymbol + } + if l.Movements != nil { + structMap["movements"] = l.Movements + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponseResult. +// UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponseResult. // It customizes the JSON unmarshaling process for ListMRRResponseResult objects. func (l *ListMRRResponseResult) UnmarshalJSON(input []byte) error { - temp := &struct { - Page *int `json:"page,omitempty"` - PerPage *int `json:"per_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - TotalEntries *int `json:"total_entries,omitempty"` - Currency *string `json:"currency,omitempty"` - CurrencySymbol *string `json:"currency_symbol,omitempty"` - Movements []Movement `json:"movements,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Page = temp.Page - l.PerPage = temp.PerPage - l.TotalPages = temp.TotalPages - l.TotalEntries = temp.TotalEntries - l.Currency = temp.Currency - l.CurrencySymbol = temp.CurrencySymbol - l.Movements = temp.Movements - return nil + temp := &struct { + Page *int `json:"page,omitempty"` + PerPage *int `json:"per_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + TotalEntries *int `json:"total_entries,omitempty"` + Currency *string `json:"currency,omitempty"` + CurrencySymbol *string `json:"currency_symbol,omitempty"` + Movements []Movement `json:"movements,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Page = temp.Page + l.PerPage = temp.PerPage + l.TotalPages = temp.TotalPages + l.TotalEntries = temp.TotalEntries + l.Currency = temp.Currency + l.CurrencySymbol = temp.CurrencySymbol + l.Movements = temp.Movements + return nil } diff --git a/models/list_offers_response.go b/models/list_offers_response.go index 72704a84..b0aec3cc 100644 --- a/models/list_offers_response.go +++ b/models/list_offers_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListOffersResponse represents a ListOffersResponse struct. type ListOffersResponse struct { - Offers []Offer `json:"offers,omitempty"` + Offers []Offer `json:"offers,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListOffersResponse. +// MarshalJSON implements the json.Marshaler interface for ListOffersResponse. // It customizes the JSON marshaling process for ListOffersResponse objects. func (l *ListOffersResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListOffersResponse object to a map representation for JSON marshaling. func (l *ListOffersResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.Offers != nil { - structMap["offers"] = l.Offers - } - return structMap + structMap := make(map[string]any) + if l.Offers != nil { + structMap["offers"] = l.Offers + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListOffersResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListOffersResponse. // It customizes the JSON unmarshaling process for ListOffersResponse objects. func (l *ListOffersResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Offers []Offer `json:"offers,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Offers = temp.Offers - return nil + temp := &struct { + Offers []Offer `json:"offers,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Offers = temp.Offers + return nil } diff --git a/models/list_product_price_points_response.go b/models/list_product_price_points_response.go index e5a64f08..fb149bb3 100644 --- a/models/list_product_price_points_response.go +++ b/models/list_product_price_points_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListProductPricePointsResponse represents a ListProductPricePointsResponse struct. type ListProductPricePointsResponse struct { - PricePoints []ProductPricePoint `json:"price_points"` + PricePoints []ProductPricePoint `json:"price_points"` } -// MarshalJSON implements the json.Marshaler interface for ListProductPricePointsResponse. +// MarshalJSON implements the json.Marshaler interface for ListProductPricePointsResponse. // It customizes the JSON marshaling process for ListProductPricePointsResponse objects. func (l *ListProductPricePointsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListProductPricePointsResponse object to a map representation for JSON marshaling. func (l *ListProductPricePointsResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["price_points"] = l.PricePoints - return structMap + structMap := make(map[string]any) + structMap["price_points"] = l.PricePoints + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListProductPricePointsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListProductPricePointsResponse. // It customizes the JSON unmarshaling process for ListProductPricePointsResponse objects. func (l *ListProductPricePointsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoints []ProductPricePoint `json:"price_points"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.PricePoints = temp.PricePoints - return nil + temp := &struct { + PricePoints []ProductPricePoint `json:"price_points"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.PricePoints = temp.PricePoints + return nil } diff --git a/models/list_public_keys_meta.go b/models/list_public_keys_meta.go index d1b924e8..3ea75a32 100644 --- a/models/list_public_keys_meta.go +++ b/models/list_public_keys_meta.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListPublicKeysMeta represents a ListPublicKeysMeta struct. type ListPublicKeysMeta struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListPublicKeysMeta. +// MarshalJSON implements the json.Marshaler interface for ListPublicKeysMeta. // It customizes the JSON marshaling process for ListPublicKeysMeta objects. func (l *ListPublicKeysMeta) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListPublicKeysMeta object to a map representation for JSON marshaling. func (l *ListPublicKeysMeta) toMap() map[string]any { - structMap := make(map[string]any) - if l.TotalCount != nil { - structMap["total_count"] = l.TotalCount - } - if l.CurrentPage != nil { - structMap["current_page"] = l.CurrentPage - } - if l.TotalPages != nil { - structMap["total_pages"] = l.TotalPages - } - if l.PerPage != nil { - structMap["per_page"] = l.PerPage - } - return structMap + structMap := make(map[string]any) + if l.TotalCount != nil { + structMap["total_count"] = l.TotalCount + } + if l.CurrentPage != nil { + structMap["current_page"] = l.CurrentPage + } + if l.TotalPages != nil { + structMap["total_pages"] = l.TotalPages + } + if l.PerPage != nil { + structMap["per_page"] = l.PerPage + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysMeta. +// UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysMeta. // It customizes the JSON unmarshaling process for ListPublicKeysMeta objects. func (l *ListPublicKeysMeta) UnmarshalJSON(input []byte) error { - temp := &struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.TotalCount = temp.TotalCount - l.CurrentPage = temp.CurrentPage - l.TotalPages = temp.TotalPages - l.PerPage = temp.PerPage - return nil + temp := &struct { + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.TotalCount = temp.TotalCount + l.CurrentPage = temp.CurrentPage + l.TotalPages = temp.TotalPages + l.PerPage = temp.PerPage + return nil } diff --git a/models/list_public_keys_response.go b/models/list_public_keys_response.go index 0d665cee..33b7ee9a 100644 --- a/models/list_public_keys_response.go +++ b/models/list_public_keys_response.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListPublicKeysResponse represents a ListPublicKeysResponse struct. type ListPublicKeysResponse struct { - ChargifyJsKeys []PublicKey `json:"chargify_js_keys,omitempty"` - Meta *ListPublicKeysMeta `json:"meta,omitempty"` + ChargifyJsKeys []PublicKey `json:"chargify_js_keys,omitempty"` + Meta *ListPublicKeysMeta `json:"meta,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListPublicKeysResponse. +// MarshalJSON implements the json.Marshaler interface for ListPublicKeysResponse. // It customizes the JSON marshaling process for ListPublicKeysResponse objects. func (l *ListPublicKeysResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListPublicKeysResponse object to a map representation for JSON marshaling. func (l *ListPublicKeysResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.ChargifyJsKeys != nil { - structMap["chargify_js_keys"] = l.ChargifyJsKeys - } - if l.Meta != nil { - structMap["meta"] = l.Meta - } - return structMap + structMap := make(map[string]any) + if l.ChargifyJsKeys != nil { + structMap["chargify_js_keys"] = l.ChargifyJsKeys + } + if l.Meta != nil { + structMap["meta"] = l.Meta.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysResponse. // It customizes the JSON unmarshaling process for ListPublicKeysResponse objects. func (l *ListPublicKeysResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyJsKeys []PublicKey `json:"chargify_js_keys,omitempty"` - Meta *ListPublicKeysMeta `json:"meta,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.ChargifyJsKeys = temp.ChargifyJsKeys - l.Meta = temp.Meta - return nil + temp := &struct { + ChargifyJsKeys []PublicKey `json:"chargify_js_keys,omitempty"` + Meta *ListPublicKeysMeta `json:"meta,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.ChargifyJsKeys = temp.ChargifyJsKeys + l.Meta = temp.Meta + return nil } diff --git a/models/list_sale_rep_item.go b/models/list_sale_rep_item.go index d65d36c9..a1fd69c9 100644 --- a/models/list_sale_rep_item.go +++ b/models/list_sale_rep_item.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSaleRepItem represents a ListSaleRepItem struct. type ListSaleRepItem struct { - Id *int `json:"id,omitempty"` - FullName *string `json:"full_name,omitempty"` - SubscriptionsCount *int `json:"subscriptions_count,omitempty"` - MrrData map[string]SaleRepItemMrr `json:"mrr_data,omitempty"` - TestMode *bool `json:"test_mode,omitempty"` + Id *int `json:"id,omitempty"` + FullName *string `json:"full_name,omitempty"` + SubscriptionsCount *int `json:"subscriptions_count,omitempty"` + MrrData map[string]SaleRepItemMrr `json:"mrr_data,omitempty"` + TestMode *bool `json:"test_mode,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSaleRepItem. +// MarshalJSON implements the json.Marshaler interface for ListSaleRepItem. // It customizes the JSON marshaling process for ListSaleRepItem objects. func (l *ListSaleRepItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSaleRepItem object to a map representation for JSON marshaling. func (l *ListSaleRepItem) toMap() map[string]any { - structMap := make(map[string]any) - if l.Id != nil { - structMap["id"] = l.Id - } - if l.FullName != nil { - structMap["full_name"] = l.FullName - } - if l.SubscriptionsCount != nil { - structMap["subscriptions_count"] = l.SubscriptionsCount - } - if l.MrrData != nil { - structMap["mrr_data"] = l.MrrData - } - if l.TestMode != nil { - structMap["test_mode"] = l.TestMode - } - return structMap + structMap := make(map[string]any) + if l.Id != nil { + structMap["id"] = l.Id + } + if l.FullName != nil { + structMap["full_name"] = l.FullName + } + if l.SubscriptionsCount != nil { + structMap["subscriptions_count"] = l.SubscriptionsCount + } + if l.MrrData != nil { + structMap["mrr_data"] = l.MrrData + } + if l.TestMode != nil { + structMap["test_mode"] = l.TestMode + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSaleRepItem. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSaleRepItem. // It customizes the JSON unmarshaling process for ListSaleRepItem objects. func (l *ListSaleRepItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - FullName *string `json:"full_name,omitempty"` - SubscriptionsCount *int `json:"subscriptions_count,omitempty"` - MrrData map[string]SaleRepItemMrr `json:"mrr_data,omitempty"` - TestMode *bool `json:"test_mode,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Id = temp.Id - l.FullName = temp.FullName - l.SubscriptionsCount = temp.SubscriptionsCount - l.MrrData = temp.MrrData - l.TestMode = temp.TestMode - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + FullName *string `json:"full_name,omitempty"` + SubscriptionsCount *int `json:"subscriptions_count,omitempty"` + MrrData map[string]SaleRepItemMrr `json:"mrr_data,omitempty"` + TestMode *bool `json:"test_mode,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Id = temp.Id + l.FullName = temp.FullName + l.SubscriptionsCount = temp.SubscriptionsCount + l.MrrData = temp.MrrData + l.TestMode = temp.TestMode + return nil } diff --git a/models/list_segments_response.go b/models/list_segments_response.go index 36b8059b..5bc7cbb3 100644 --- a/models/list_segments_response.go +++ b/models/list_segments_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSegmentsResponse represents a ListSegmentsResponse struct. type ListSegmentsResponse struct { - Segments []Segment `json:"segments,omitempty"` + Segments []Segment `json:"segments,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSegmentsResponse. +// MarshalJSON implements the json.Marshaler interface for ListSegmentsResponse. // It customizes the JSON marshaling process for ListSegmentsResponse objects. func (l *ListSegmentsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSegmentsResponse object to a map representation for JSON marshaling. func (l *ListSegmentsResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.Segments != nil { - structMap["segments"] = l.Segments - } - return structMap + structMap := make(map[string]any) + if l.Segments != nil { + structMap["segments"] = l.Segments + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSegmentsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSegmentsResponse. // It customizes the JSON unmarshaling process for ListSegmentsResponse objects. func (l *ListSegmentsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Segments []Segment `json:"segments,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Segments = temp.Segments - return nil + temp := &struct { + Segments []Segment `json:"segments,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Segments = temp.Segments + return nil } diff --git a/models/list_subcription_group_prepayment_item.go b/models/list_subcription_group_prepayment_item.go index c2137150..5f029f84 100644 --- a/models/list_subcription_group_prepayment_item.go +++ b/models/list_subcription_group_prepayment_item.go @@ -1,91 +1,91 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubcriptionGroupPrepaymentItem represents a ListSubcriptionGroupPrepaymentItem struct. type ListSubcriptionGroupPrepaymentItem struct { - Id *int `json:"id,omitempty"` - SubscriptionGroupUid *string `json:"subscription_group_uid,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - RemainingAmountInCents *int64 `json:"remaining_amount_in_cents,omitempty"` - Details *string `json:"details,omitempty"` - External *bool `json:"external,omitempty"` - Memo *string `json:"memo,omitempty"` - // :- 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. - PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` + Id *int `json:"id,omitempty"` + SubscriptionGroupUid *string `json:"subscription_group_uid,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + RemainingAmountInCents *int64 `json:"remaining_amount_in_cents,omitempty"` + Details *string `json:"details,omitempty"` + External *bool `json:"external,omitempty"` + Memo *string `json:"memo,omitempty"` + // :- 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. + PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSubcriptionGroupPrepaymentItem. +// MarshalJSON implements the json.Marshaler interface for ListSubcriptionGroupPrepaymentItem. // It customizes the JSON marshaling process for ListSubcriptionGroupPrepaymentItem objects. func (l *ListSubcriptionGroupPrepaymentItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubcriptionGroupPrepaymentItem object to a map representation for JSON marshaling. func (l *ListSubcriptionGroupPrepaymentItem) toMap() map[string]any { - structMap := make(map[string]any) - if l.Id != nil { - structMap["id"] = l.Id - } - if l.SubscriptionGroupUid != nil { - structMap["subscription_group_uid"] = l.SubscriptionGroupUid - } - if l.AmountInCents != nil { - structMap["amount_in_cents"] = l.AmountInCents - } - if l.RemainingAmountInCents != nil { - structMap["remaining_amount_in_cents"] = l.RemainingAmountInCents - } - if l.Details != nil { - structMap["details"] = l.Details - } - if l.External != nil { - structMap["external"] = l.External - } - if l.Memo != nil { - structMap["memo"] = l.Memo - } - if l.PaymentType != nil { - structMap["payment_type"] = l.PaymentType - } - if l.CreatedAt != nil { - structMap["created_at"] = l.CreatedAt - } - return structMap + structMap := make(map[string]any) + if l.Id != nil { + structMap["id"] = l.Id + } + if l.SubscriptionGroupUid != nil { + structMap["subscription_group_uid"] = l.SubscriptionGroupUid + } + if l.AmountInCents != nil { + structMap["amount_in_cents"] = l.AmountInCents + } + if l.RemainingAmountInCents != nil { + structMap["remaining_amount_in_cents"] = l.RemainingAmountInCents + } + if l.Details != nil { + structMap["details"] = l.Details + } + if l.External != nil { + structMap["external"] = l.External + } + if l.Memo != nil { + structMap["memo"] = l.Memo + } + if l.PaymentType != nil { + structMap["payment_type"] = l.PaymentType + } + if l.CreatedAt != nil { + structMap["created_at"] = l.CreatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubcriptionGroupPrepaymentItem. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubcriptionGroupPrepaymentItem. // It customizes the JSON unmarshaling process for ListSubcriptionGroupPrepaymentItem objects. func (l *ListSubcriptionGroupPrepaymentItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SubscriptionGroupUid *string `json:"subscription_group_uid,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - RemainingAmountInCents *int64 `json:"remaining_amount_in_cents,omitempty"` - Details *string `json:"details,omitempty"` - External *bool `json:"external,omitempty"` - Memo *string `json:"memo,omitempty"` - PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Id = temp.Id - l.SubscriptionGroupUid = temp.SubscriptionGroupUid - l.AmountInCents = temp.AmountInCents - l.RemainingAmountInCents = temp.RemainingAmountInCents - l.Details = temp.Details - l.External = temp.External - l.Memo = temp.Memo - l.PaymentType = temp.PaymentType - l.CreatedAt = temp.CreatedAt - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SubscriptionGroupUid *string `json:"subscription_group_uid,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + RemainingAmountInCents *int64 `json:"remaining_amount_in_cents,omitempty"` + Details *string `json:"details,omitempty"` + External *bool `json:"external,omitempty"` + Memo *string `json:"memo,omitempty"` + PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Id = temp.Id + l.SubscriptionGroupUid = temp.SubscriptionGroupUid + l.AmountInCents = temp.AmountInCents + l.RemainingAmountInCents = temp.RemainingAmountInCents + l.Details = temp.Details + l.External = temp.External + l.Memo = temp.Memo + l.PaymentType = temp.PaymentType + l.CreatedAt = temp.CreatedAt + return nil } diff --git a/models/list_subscription_components_response.go b/models/list_subscription_components_response.go index e3ea415b..b5bf066a 100644 --- a/models/list_subscription_components_response.go +++ b/models/list_subscription_components_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionComponentsResponse represents a ListSubscriptionComponentsResponse struct. type ListSubscriptionComponentsResponse struct { - SubscriptionsComponents []SubscriptionComponent `json:"subscriptions_components"` + SubscriptionsComponents []SubscriptionComponent `json:"subscriptions_components"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionComponentsResponse. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionComponentsResponse. // It customizes the JSON marshaling process for ListSubscriptionComponentsResponse objects. func (l *ListSubscriptionComponentsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionComponentsResponse object to a map representation for JSON marshaling. func (l *ListSubscriptionComponentsResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscriptions_components"] = l.SubscriptionsComponents - return structMap + structMap := make(map[string]any) + structMap["subscriptions_components"] = l.SubscriptionsComponents + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionComponentsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionComponentsResponse. // It customizes the JSON unmarshaling process for ListSubscriptionComponentsResponse objects. func (l *ListSubscriptionComponentsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionsComponents []SubscriptionComponent `json:"subscriptions_components"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.SubscriptionsComponents = temp.SubscriptionsComponents - return nil + temp := &struct { + SubscriptionsComponents []SubscriptionComponent `json:"subscriptions_components"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.SubscriptionsComponents = temp.SubscriptionsComponents + return nil } diff --git a/models/list_subscription_group_prepayment.go b/models/list_subscription_group_prepayment.go index 6441b9f4..6aafc41c 100644 --- a/models/list_subscription_group_prepayment.go +++ b/models/list_subscription_group_prepayment.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionGroupPrepayment represents a ListSubscriptionGroupPrepayment struct. type ListSubscriptionGroupPrepayment struct { - Prepayment ListSubcriptionGroupPrepaymentItem `json:"prepayment"` + Prepayment ListSubcriptionGroupPrepaymentItem `json:"prepayment"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepayment. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepayment. // It customizes the JSON marshaling process for ListSubscriptionGroupPrepayment objects. func (l *ListSubscriptionGroupPrepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionGroupPrepayment object to a map representation for JSON marshaling. func (l *ListSubscriptionGroupPrepayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayment"] = l.Prepayment - return structMap + structMap := make(map[string]any) + structMap["prepayment"] = l.Prepayment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepayment. // It customizes the JSON unmarshaling process for ListSubscriptionGroupPrepayment objects. func (l *ListSubscriptionGroupPrepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayment ListSubcriptionGroupPrepaymentItem `json:"prepayment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Prepayment = temp.Prepayment - return nil + temp := &struct { + Prepayment ListSubcriptionGroupPrepaymentItem `json:"prepayment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Prepayment = temp.Prepayment + return nil } diff --git a/models/list_subscription_group_prepayment_response.go b/models/list_subscription_group_prepayment_response.go index 6a101cd9..296a17a7 100644 --- a/models/list_subscription_group_prepayment_response.go +++ b/models/list_subscription_group_prepayment_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionGroupPrepaymentResponse represents a ListSubscriptionGroupPrepaymentResponse struct. type ListSubscriptionGroupPrepaymentResponse struct { - Prepayments []ListSubscriptionGroupPrepayment `json:"prepayments"` + Prepayments []ListSubscriptionGroupPrepayment `json:"prepayments"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepaymentResponse. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepaymentResponse. // It customizes the JSON marshaling process for ListSubscriptionGroupPrepaymentResponse objects. func (l *ListSubscriptionGroupPrepaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionGroupPrepaymentResponse object to a map representation for JSON marshaling. func (l *ListSubscriptionGroupPrepaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayments"] = l.Prepayments - return structMap + structMap := make(map[string]any) + structMap["prepayments"] = l.Prepayments + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepaymentResponse. // It customizes the JSON unmarshaling process for ListSubscriptionGroupPrepaymentResponse objects. func (l *ListSubscriptionGroupPrepaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayments []ListSubscriptionGroupPrepayment `json:"prepayments"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Prepayments = temp.Prepayments - return nil + temp := &struct { + Prepayments []ListSubscriptionGroupPrepayment `json:"prepayments"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Prepayments = temp.Prepayments + return nil } diff --git a/models/list_subscription_groups_item.go b/models/list_subscription_groups_item.go index 54a1f395..b67918cc 100644 --- a/models/list_subscription_groups_item.go +++ b/models/list_subscription_groups_item.go @@ -1,96 +1,96 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionGroupsItem represents a ListSubscriptionGroupsItem struct. type ListSubscriptionGroupsItem struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsItem. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsItem. // It customizes the JSON marshaling process for ListSubscriptionGroupsItem objects. func (l *ListSubscriptionGroupsItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionGroupsItem object to a map representation for JSON marshaling. func (l *ListSubscriptionGroupsItem) toMap() map[string]any { - structMap := make(map[string]any) - if l.Uid != nil { - structMap["uid"] = l.Uid - } - if l.Scheme != nil { - structMap["scheme"] = l.Scheme - } - if l.CustomerId != nil { - structMap["customer_id"] = l.CustomerId - } - if l.PaymentProfileId != nil { - structMap["payment_profile_id"] = l.PaymentProfileId - } - if l.SubscriptionIds != nil { - structMap["subscription_ids"] = l.SubscriptionIds - } - if l.PrimarySubscriptionId != nil { - structMap["primary_subscription_id"] = l.PrimarySubscriptionId - } - if l.NextAssessmentAt != nil { - structMap["next_assessment_at"] = l.NextAssessmentAt - } - if l.State != nil { - structMap["state"] = l.State - } - if l.CancelAtEndOfPeriod != nil { - structMap["cancel_at_end_of_period"] = l.CancelAtEndOfPeriod - } - if l.AccountBalances != nil { - structMap["account_balances"] = l.AccountBalances - } - return structMap + structMap := make(map[string]any) + if l.Uid != nil { + structMap["uid"] = l.Uid + } + if l.Scheme != nil { + structMap["scheme"] = l.Scheme + } + if l.CustomerId != nil { + structMap["customer_id"] = l.CustomerId + } + if l.PaymentProfileId != nil { + structMap["payment_profile_id"] = l.PaymentProfileId + } + if l.SubscriptionIds != nil { + structMap["subscription_ids"] = l.SubscriptionIds + } + if l.PrimarySubscriptionId != nil { + structMap["primary_subscription_id"] = l.PrimarySubscriptionId + } + if l.NextAssessmentAt != nil { + structMap["next_assessment_at"] = l.NextAssessmentAt + } + if l.State != nil { + structMap["state"] = l.State + } + if l.CancelAtEndOfPeriod != nil { + structMap["cancel_at_end_of_period"] = l.CancelAtEndOfPeriod + } + if l.AccountBalances != nil { + structMap["account_balances"] = l.AccountBalances.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsItem. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsItem. // It customizes the JSON unmarshaling process for ListSubscriptionGroupsItem objects. func (l *ListSubscriptionGroupsItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.Uid = temp.Uid - l.Scheme = temp.Scheme - l.CustomerId = temp.CustomerId - l.PaymentProfileId = temp.PaymentProfileId - l.SubscriptionIds = temp.SubscriptionIds - l.PrimarySubscriptionId = temp.PrimarySubscriptionId - l.NextAssessmentAt = temp.NextAssessmentAt - l.State = temp.State - l.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod - l.AccountBalances = temp.AccountBalances - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + AccountBalances *SubscriptionGroupBalances `json:"account_balances,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.Uid = temp.Uid + l.Scheme = temp.Scheme + l.CustomerId = temp.CustomerId + l.PaymentProfileId = temp.PaymentProfileId + l.SubscriptionIds = temp.SubscriptionIds + l.PrimarySubscriptionId = temp.PrimarySubscriptionId + l.NextAssessmentAt = temp.NextAssessmentAt + l.State = temp.State + l.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod + l.AccountBalances = temp.AccountBalances + return nil } diff --git a/models/list_subscription_groups_meta.go b/models/list_subscription_groups_meta.go index 55cd00e0..fe349327 100644 --- a/models/list_subscription_groups_meta.go +++ b/models/list_subscription_groups_meta.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionGroupsMeta represents a ListSubscriptionGroupsMeta struct. type ListSubscriptionGroupsMeta struct { - CurrentPage *int `json:"current_page,omitempty"` - TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalCount *int `json:"total_count,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsMeta. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsMeta. // It customizes the JSON marshaling process for ListSubscriptionGroupsMeta objects. func (l *ListSubscriptionGroupsMeta) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionGroupsMeta object to a map representation for JSON marshaling. func (l *ListSubscriptionGroupsMeta) toMap() map[string]any { - structMap := make(map[string]any) - if l.CurrentPage != nil { - structMap["current_page"] = l.CurrentPage - } - if l.TotalCount != nil { - structMap["total_count"] = l.TotalCount - } - return structMap + structMap := make(map[string]any) + if l.CurrentPage != nil { + structMap["current_page"] = l.CurrentPage + } + if l.TotalCount != nil { + structMap["total_count"] = l.TotalCount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsMeta. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsMeta. // It customizes the JSON unmarshaling process for ListSubscriptionGroupsMeta objects. func (l *ListSubscriptionGroupsMeta) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrentPage *int `json:"current_page,omitempty"` - TotalCount *int `json:"total_count,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.CurrentPage = temp.CurrentPage - l.TotalCount = temp.TotalCount - return nil + temp := &struct { + CurrentPage *int `json:"current_page,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.CurrentPage = temp.CurrentPage + l.TotalCount = temp.TotalCount + return nil } diff --git a/models/list_subscription_groups_response.go b/models/list_subscription_groups_response.go index def87add..78b00fbd 100644 --- a/models/list_subscription_groups_response.go +++ b/models/list_subscription_groups_response.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ListSubscriptionGroupsResponse represents a ListSubscriptionGroupsResponse struct. type ListSubscriptionGroupsResponse struct { - SubscriptionGroups []ListSubscriptionGroupsItem `json:"subscription_groups,omitempty"` - Meta *ListSubscriptionGroupsMeta `json:"meta,omitempty"` + SubscriptionGroups []ListSubscriptionGroupsItem `json:"subscription_groups,omitempty"` + Meta *ListSubscriptionGroupsMeta `json:"meta,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsResponse. +// MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsResponse. // It customizes the JSON marshaling process for ListSubscriptionGroupsResponse objects. func (l *ListSubscriptionGroupsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(l.toMap()) + []byte, + error) { + return json.Marshal(l.toMap()) } // toMap converts the ListSubscriptionGroupsResponse object to a map representation for JSON marshaling. func (l *ListSubscriptionGroupsResponse) toMap() map[string]any { - structMap := make(map[string]any) - if l.SubscriptionGroups != nil { - structMap["subscription_groups"] = l.SubscriptionGroups - } - if l.Meta != nil { - structMap["meta"] = l.Meta - } - return structMap + structMap := make(map[string]any) + if l.SubscriptionGroups != nil { + structMap["subscription_groups"] = l.SubscriptionGroups + } + if l.Meta != nil { + structMap["meta"] = l.Meta.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsResponse. // It customizes the JSON unmarshaling process for ListSubscriptionGroupsResponse objects. func (l *ListSubscriptionGroupsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionGroups []ListSubscriptionGroupsItem `json:"subscription_groups,omitempty"` - Meta *ListSubscriptionGroupsMeta `json:"meta,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - l.SubscriptionGroups = temp.SubscriptionGroups - l.Meta = temp.Meta - return nil + temp := &struct { + SubscriptionGroups []ListSubscriptionGroupsItem `json:"subscription_groups,omitempty"` + Meta *ListSubscriptionGroupsMeta `json:"meta,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + l.SubscriptionGroups = temp.SubscriptionGroups + l.Meta = temp.Meta + return nil } diff --git a/models/m_errors.go b/models/m_errors.go index 02edd315..87197826 100644 --- a/models/m_errors.go +++ b/models/m_errors.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // Errors represents a Errors struct. type Errors struct { - PerPage []string `json:"per_page,omitempty"` - PricePoint []string `json:"price_point,omitempty"` + PerPage []string `json:"per_page,omitempty"` + PricePoint []string `json:"price_point,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Errors. +// MarshalJSON implements the json.Marshaler interface for Errors. // It customizes the JSON marshaling process for Errors objects. func (e *Errors) MarshalJSON() ( - []byte, - error) { - return json.Marshal(e.toMap()) + []byte, + error) { + return json.Marshal(e.toMap()) } // toMap converts the Errors object to a map representation for JSON marshaling. func (e *Errors) toMap() map[string]any { - structMap := make(map[string]any) - if e.PerPage != nil { - structMap["per_page"] = e.PerPage - } - if e.PricePoint != nil { - structMap["price_point"] = e.PricePoint - } - return structMap + structMap := make(map[string]any) + if e.PerPage != nil { + structMap["per_page"] = e.PerPage + } + if e.PricePoint != nil { + structMap["price_point"] = e.PricePoint + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Errors. +// UnmarshalJSON implements the json.Unmarshaler interface for Errors. // It customizes the JSON unmarshaling process for Errors objects. func (e *Errors) UnmarshalJSON(input []byte) error { - temp := &struct { - PerPage []string `json:"per_page,omitempty"` - PricePoint []string `json:"price_point,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - e.PerPage = temp.PerPage - e.PricePoint = temp.PricePoint - return nil + temp := &struct { + PerPage []string `json:"per_page,omitempty"` + PricePoint []string `json:"price_point,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + e.PerPage = temp.PerPage + e.PricePoint = temp.PricePoint + return nil } diff --git a/models/metadata.go b/models/metadata.go index a204c94e..45393854 100644 --- a/models/metadata.go +++ b/models/metadata.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // Metadata represents a Metadata struct. type Metadata struct { - Id *int `json:"id,omitempty"` - Value *string `json:"value,omitempty"` - ResourceId *int `json:"resource_id,omitempty"` - Name *string `json:"name,omitempty"` - DeletedAt Optional[string] `json:"deleted_at"` - MetafieldId *int `json:"metafield_id,omitempty"` + Id Optional[int] `json:"id"` + Value Optional[string] `json:"value"` + ResourceId Optional[int] `json:"resource_id"` + Name *string `json:"name,omitempty"` + DeletedAt Optional[string] `json:"deleted_at"` + MetafieldId Optional[int] `json:"metafield_id"` } -// MarshalJSON implements the json.Marshaler interface for Metadata. +// MarshalJSON implements the json.Marshaler interface for Metadata. // It customizes the JSON marshaling process for Metadata objects. func (m *Metadata) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the Metadata object to a map representation for JSON marshaling. func (m *Metadata) toMap() map[string]any { - structMap := make(map[string]any) - if m.Id != nil { - structMap["id"] = m.Id - } - if m.Value != nil { - structMap["value"] = m.Value - } - if m.ResourceId != nil { - structMap["resource_id"] = m.ResourceId - } - if m.Name != nil { - structMap["name"] = m.Name - } - if m.DeletedAt.IsValueSet() { - structMap["deleted_at"] = m.DeletedAt.Value() - } - if m.MetafieldId != nil { - structMap["metafield_id"] = m.MetafieldId - } - return structMap + structMap := make(map[string]any) + if m.Id.IsValueSet() { + structMap["id"] = m.Id.Value() + } + if m.Value.IsValueSet() { + structMap["value"] = m.Value.Value() + } + if m.ResourceId.IsValueSet() { + structMap["resource_id"] = m.ResourceId.Value() + } + if m.Name != nil { + structMap["name"] = m.Name + } + if m.DeletedAt.IsValueSet() { + structMap["deleted_at"] = m.DeletedAt.Value() + } + if m.MetafieldId.IsValueSet() { + structMap["metafield_id"] = m.MetafieldId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Metadata. +// UnmarshalJSON implements the json.Unmarshaler interface for Metadata. // It customizes the JSON unmarshaling process for Metadata objects. func (m *Metadata) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Value *string `json:"value,omitempty"` - ResourceId *int `json:"resource_id,omitempty"` - Name *string `json:"name,omitempty"` - DeletedAt Optional[string] `json:"deleted_at"` - MetafieldId *int `json:"metafield_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Id = temp.Id - m.Value = temp.Value - m.ResourceId = temp.ResourceId - m.Name = temp.Name - m.DeletedAt = temp.DeletedAt - m.MetafieldId = temp.MetafieldId - return nil + temp := &struct { + Id Optional[int] `json:"id"` + Value Optional[string] `json:"value"` + ResourceId Optional[int] `json:"resource_id"` + Name *string `json:"name,omitempty"` + DeletedAt Optional[string] `json:"deleted_at"` + MetafieldId Optional[int] `json:"metafield_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Id = temp.Id + m.Value = temp.Value + m.ResourceId = temp.ResourceId + m.Name = temp.Name + m.DeletedAt = temp.DeletedAt + m.MetafieldId = temp.MetafieldId + return nil } diff --git a/models/metafield.go b/models/metafield.go index b8983b25..c729a388 100644 --- a/models/metafield.go +++ b/models/metafield.go @@ -1,74 +1,75 @@ package models import ( - "encoding/json" + "encoding/json" ) // Metafield represents a Metafield struct. type Metafield struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. - Scope *MetafieldScope `json:"scope,omitempty"` - // the amount of subscriptions this metafield has been applied to in Chargify - DataCount *int `json:"data_count,omitempty"` - InputType *string `json:"input_type,omitempty"` - Enum Optional[interface{}] `json:"enum"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. + Scope *MetafieldScope `json:"scope,omitempty"` + // the amount of subscriptions this metafield has been applied to in Chargify + DataCount *int `json:"data_count,omitempty"` + // Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text' + InputType *MetafieldInput `json:"input_type,omitempty"` + Enum Optional[interface{}] `json:"enum"` } -// MarshalJSON implements the json.Marshaler interface for Metafield. +// MarshalJSON implements the json.Marshaler interface for Metafield. // It customizes the JSON marshaling process for Metafield objects. func (m *Metafield) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the Metafield object to a map representation for JSON marshaling. func (m *Metafield) toMap() map[string]any { - structMap := make(map[string]any) - if m.Id != nil { - structMap["id"] = m.Id - } - if m.Name != nil { - structMap["name"] = m.Name - } - if m.Scope != nil { - structMap["scope"] = m.Scope - } - if m.DataCount != nil { - structMap["data_count"] = m.DataCount - } - if m.InputType != nil { - structMap["input_type"] = m.InputType - } - if m.Enum.IsValueSet() { - structMap["enum"] = m.Enum.Value() - } - return structMap + structMap := make(map[string]any) + if m.Id != nil { + structMap["id"] = m.Id + } + if m.Name != nil { + structMap["name"] = m.Name + } + if m.Scope != nil { + structMap["scope"] = m.Scope.toMap() + } + if m.DataCount != nil { + structMap["data_count"] = m.DataCount + } + if m.InputType != nil { + structMap["input_type"] = m.InputType + } + if m.Enum.IsValueSet() { + structMap["enum"] = m.Enum.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Metafield. +// UnmarshalJSON implements the json.Unmarshaler interface for Metafield. // It customizes the JSON unmarshaling process for Metafield objects. func (m *Metafield) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Scope *MetafieldScope `json:"scope,omitempty"` - DataCount *int `json:"data_count,omitempty"` - InputType *string `json:"input_type,omitempty"` - Enum Optional[interface{}] `json:"enum"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Id = temp.Id - m.Name = temp.Name - m.Scope = temp.Scope - m.DataCount = temp.DataCount - m.InputType = temp.InputType - m.Enum = temp.Enum - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Scope *MetafieldScope `json:"scope,omitempty"` + DataCount *int `json:"data_count,omitempty"` + InputType *MetafieldInput `json:"input_type,omitempty"` + Enum Optional[interface{}] `json:"enum"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Id = temp.Id + m.Name = temp.Name + m.Scope = temp.Scope + m.DataCount = temp.DataCount + m.InputType = temp.InputType + m.Enum = temp.Enum + return nil } diff --git a/models/metafield_scope.go b/models/metafield_scope.go index 6c8940ed..1fc20ff1 100644 --- a/models/metafield_scope.go +++ b/models/metafield_scope.go @@ -1,85 +1,85 @@ package models import ( - "encoding/json" + "encoding/json" ) -// MetafieldScope represents a MetafieldScope struct. +// MetafieldScope represents a MetafieldScope struct. // Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. type MetafieldScope struct { - // Include (1) or exclude (0) metafields from the csv export. - Csv *IncludeOption `json:"csv,omitempty"` - // Include (1) or exclude (0) metafields from invoices. - Invoices *IncludeOption `json:"invoices,omitempty"` - // Include (1) or exclude (0) metafields from statements. - Statements *IncludeOption `json:"statements,omitempty"` - // Include (1) or exclude (0) metafields from the portal. - Portal *IncludeOption `json:"portal,omitempty"` - // Include (1) or exclude (0) metafields from being viewable by your ecosystem. - PublicShow *IncludeOption `json:"public_show,omitempty"` - // Include (1) or exclude (0) metafields from being edited by your ecosystem. - PublicEdit *IncludeOption `json:"public_edit,omitempty"` - Hosted []string `json:"hosted,omitempty"` + // Include (1) or exclude (0) metafields from the csv export. + Csv *IncludeOption `json:"csv,omitempty"` + // Include (1) or exclude (0) metafields from invoices. + Invoices *IncludeOption `json:"invoices,omitempty"` + // Include (1) or exclude (0) metafields from statements. + Statements *IncludeOption `json:"statements,omitempty"` + // Include (1) or exclude (0) metafields from the portal. + Portal *IncludeOption `json:"portal,omitempty"` + // Include (1) or exclude (0) metafields from being viewable by your ecosystem. + PublicShow *IncludeOption `json:"public_show,omitempty"` + // Include (1) or exclude (0) metafields from being edited by your ecosystem. + PublicEdit *IncludeOption `json:"public_edit,omitempty"` + Hosted []string `json:"hosted,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MetafieldScope. +// MarshalJSON implements the json.Marshaler interface for MetafieldScope. // It customizes the JSON marshaling process for MetafieldScope objects. func (m *MetafieldScope) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MetafieldScope object to a map representation for JSON marshaling. func (m *MetafieldScope) toMap() map[string]any { - structMap := make(map[string]any) - if m.Csv != nil { - structMap["csv"] = m.Csv - } - if m.Invoices != nil { - structMap["invoices"] = m.Invoices - } - if m.Statements != nil { - structMap["statements"] = m.Statements - } - if m.Portal != nil { - structMap["portal"] = m.Portal - } - if m.PublicShow != nil { - structMap["public_show"] = m.PublicShow - } - if m.PublicEdit != nil { - structMap["public_edit"] = m.PublicEdit - } - if m.Hosted != nil { - structMap["hosted"] = m.Hosted - } - return structMap + structMap := make(map[string]any) + if m.Csv != nil { + structMap["csv"] = m.Csv + } + if m.Invoices != nil { + structMap["invoices"] = m.Invoices + } + if m.Statements != nil { + structMap["statements"] = m.Statements + } + if m.Portal != nil { + structMap["portal"] = m.Portal + } + if m.PublicShow != nil { + structMap["public_show"] = m.PublicShow + } + if m.PublicEdit != nil { + structMap["public_edit"] = m.PublicEdit + } + if m.Hosted != nil { + structMap["hosted"] = m.Hosted + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MetafieldScope. +// UnmarshalJSON implements the json.Unmarshaler interface for MetafieldScope. // It customizes the JSON unmarshaling process for MetafieldScope objects. func (m *MetafieldScope) UnmarshalJSON(input []byte) error { - temp := &struct { - Csv *IncludeOption `json:"csv,omitempty"` - Invoices *IncludeOption `json:"invoices,omitempty"` - Statements *IncludeOption `json:"statements,omitempty"` - Portal *IncludeOption `json:"portal,omitempty"` - PublicShow *IncludeOption `json:"public_show,omitempty"` - PublicEdit *IncludeOption `json:"public_edit,omitempty"` - Hosted []string `json:"hosted,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Csv = temp.Csv - m.Invoices = temp.Invoices - m.Statements = temp.Statements - m.Portal = temp.Portal - m.PublicShow = temp.PublicShow - m.PublicEdit = temp.PublicEdit - m.Hosted = temp.Hosted - return nil + temp := &struct { + Csv *IncludeOption `json:"csv,omitempty"` + Invoices *IncludeOption `json:"invoices,omitempty"` + Statements *IncludeOption `json:"statements,omitempty"` + Portal *IncludeOption `json:"portal,omitempty"` + PublicShow *IncludeOption `json:"public_show,omitempty"` + PublicEdit *IncludeOption `json:"public_edit,omitempty"` + Hosted []string `json:"hosted,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Csv = temp.Csv + m.Invoices = temp.Invoices + m.Statements = temp.Statements + m.Portal = temp.Portal + m.PublicShow = temp.PublicShow + m.PublicEdit = temp.PublicEdit + m.Hosted = temp.Hosted + return nil } diff --git a/models/metered_component.go b/models/metered_component.go index 391a3cfb..074ced69 100644 --- a/models/metered_component.go +++ b/models/metered_component.go @@ -1,161 +1,161 @@ package models import ( - "encoding/json" + "encoding/json" ) // MeteredComponent represents a MeteredComponent struct. type MeteredComponent struct { - // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". - Name string `json:"name"` - // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item - UnitName string `json:"unit_name"` - // A description for the component that will be displayed to the user on the hosted signup page. - Description *string `json:"description,omitempty"` - // 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 '_'. - Handle *string `json:"handle,omitempty"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. - Prices []Price `json:"prices,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice *interface{} `json:"unit_price,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` - // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - // deprecated May 2011 - use unit_price instead - PriceInCents *string `json:"price_in_cents,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". + Name string `json:"name"` + // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item + UnitName string `json:"unit_name"` + // A description for the component that will be displayed to the user on the hosted signup page. + Description *string `json:"description,omitempty"` + // 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 '_'. + Handle *string `json:"handle,omitempty"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. + Prices []Price `json:"prices,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice *interface{} `json:"unit_price,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` + // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + // deprecated May 2011 - use unit_price instead + PriceInCents *string `json:"price_in_cents,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MeteredComponent. +// MarshalJSON implements the json.Marshaler interface for MeteredComponent. // It customizes the JSON marshaling process for MeteredComponent objects. func (m *MeteredComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MeteredComponent object to a map representation for JSON marshaling. func (m *MeteredComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = m.Name - structMap["unit_name"] = m.UnitName - if m.Description != nil { - structMap["description"] = m.Description - } - if m.Handle != nil { - structMap["handle"] = m.Handle - } - if m.Taxable != nil { - structMap["taxable"] = m.Taxable - } - structMap["pricing_scheme"] = m.PricingScheme - if m.Prices != nil { - structMap["prices"] = m.Prices - } - if m.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = m.UpgradeCharge.Value() - } - if m.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = m.DowngradeCredit.Value() - } - if m.PricePoints != nil { - structMap["price_points"] = m.PricePoints - } - if m.UnitPrice != nil { - structMap["unit_price"] = m.UnitPrice - } - if m.TaxCode != nil { - structMap["tax_code"] = m.TaxCode - } - if m.HideDateRangeOnInvoice != nil { - structMap["hide_date_range_on_invoice"] = m.HideDateRangeOnInvoice - } - if m.PriceInCents != nil { - structMap["price_in_cents"] = m.PriceInCents - } - if m.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = m.DisplayOnHostedPage - } - if m.AllowFractionalQuantities != nil { - structMap["allow_fractional_quantities"] = m.AllowFractionalQuantities - } - if m.PublicSignupPageIds != nil { - structMap["public_signup_page_ids"] = m.PublicSignupPageIds - } - if m.Interval != nil { - structMap["interval"] = m.Interval - } - if m.IntervalUnit != nil { - structMap["interval_unit"] = m.IntervalUnit - } - return structMap + structMap := make(map[string]any) + structMap["name"] = m.Name + structMap["unit_name"] = m.UnitName + if m.Description != nil { + structMap["description"] = m.Description + } + if m.Handle != nil { + structMap["handle"] = m.Handle + } + if m.Taxable != nil { + structMap["taxable"] = m.Taxable + } + structMap["pricing_scheme"] = m.PricingScheme + if m.Prices != nil { + structMap["prices"] = m.Prices + } + if m.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = m.UpgradeCharge.Value() + } + if m.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = m.DowngradeCredit.Value() + } + if m.PricePoints != nil { + structMap["price_points"] = m.PricePoints + } + if m.UnitPrice != nil { + structMap["unit_price"] = m.UnitPrice + } + if m.TaxCode != nil { + structMap["tax_code"] = m.TaxCode + } + if m.HideDateRangeOnInvoice != nil { + structMap["hide_date_range_on_invoice"] = m.HideDateRangeOnInvoice + } + if m.PriceInCents != nil { + structMap["price_in_cents"] = m.PriceInCents + } + if m.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = m.DisplayOnHostedPage + } + if m.AllowFractionalQuantities != nil { + structMap["allow_fractional_quantities"] = m.AllowFractionalQuantities + } + if m.PublicSignupPageIds != nil { + structMap["public_signup_page_ids"] = m.PublicSignupPageIds + } + if m.Interval != nil { + structMap["interval"] = m.Interval + } + if m.IntervalUnit != nil { + structMap["interval_unit"] = m.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MeteredComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for MeteredComponent. // It customizes the JSON unmarshaling process for MeteredComponent objects. func (m *MeteredComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - UnitName string `json:"unit_name"` - Description *string `json:"description,omitempty"` - Handle *string `json:"handle,omitempty"` - Taxable *bool `json:"taxable,omitempty"` - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []Price `json:"prices,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - PriceInCents *string `json:"price_in_cents,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Name = temp.Name - m.UnitName = temp.UnitName - m.Description = temp.Description - m.Handle = temp.Handle - m.Taxable = temp.Taxable - m.PricingScheme = temp.PricingScheme - m.Prices = temp.Prices - m.UpgradeCharge = temp.UpgradeCharge - m.DowngradeCredit = temp.DowngradeCredit - m.PricePoints = temp.PricePoints - m.UnitPrice = temp.UnitPrice - m.TaxCode = temp.TaxCode - m.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice - m.PriceInCents = temp.PriceInCents - m.DisplayOnHostedPage = temp.DisplayOnHostedPage - m.AllowFractionalQuantities = temp.AllowFractionalQuantities - m.PublicSignupPageIds = temp.PublicSignupPageIds - m.Interval = temp.Interval - m.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + Name string `json:"name"` + UnitName string `json:"unit_name"` + Description *string `json:"description,omitempty"` + Handle *string `json:"handle,omitempty"` + Taxable *bool `json:"taxable,omitempty"` + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []Price `json:"prices,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + PriceInCents *string `json:"price_in_cents,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Name = temp.Name + m.UnitName = temp.UnitName + m.Description = temp.Description + m.Handle = temp.Handle + m.Taxable = temp.Taxable + m.PricingScheme = temp.PricingScheme + m.Prices = temp.Prices + m.UpgradeCharge = temp.UpgradeCharge + m.DowngradeCredit = temp.DowngradeCredit + m.PricePoints = temp.PricePoints + m.UnitPrice = temp.UnitPrice + m.TaxCode = temp.TaxCode + m.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice + m.PriceInCents = temp.PriceInCents + m.DisplayOnHostedPage = temp.DisplayOnHostedPage + m.AllowFractionalQuantities = temp.AllowFractionalQuantities + m.PublicSignupPageIds = temp.PublicSignupPageIds + m.Interval = temp.Interval + m.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/movement.go b/models/movement.go index b477e74a..c3f74f31 100644 --- a/models/movement.go +++ b/models/movement.go @@ -1,90 +1,90 @@ package models import ( - "encoding/json" + "encoding/json" ) // Movement represents a Movement struct. type Movement struct { - Timestamp *string `json:"timestamp,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - AmountFormatted *string `json:"amount_formatted,omitempty"` - Description *string `json:"description,omitempty"` - Category *string `json:"category,omitempty"` - Breakouts *Breakouts `json:"breakouts,omitempty"` - LineItems []MovementLineItem `json:"line_items,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - SubscriberName *string `json:"subscriber_name,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + AmountFormatted *string `json:"amount_formatted,omitempty"` + Description *string `json:"description,omitempty"` + Category *string `json:"category,omitempty"` + Breakouts *Breakouts `json:"breakouts,omitempty"` + LineItems []MovementLineItem `json:"line_items,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + SubscriberName *string `json:"subscriber_name,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Movement. +// MarshalJSON implements the json.Marshaler interface for Movement. // It customizes the JSON marshaling process for Movement objects. func (m *Movement) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the Movement object to a map representation for JSON marshaling. func (m *Movement) toMap() map[string]any { - structMap := make(map[string]any) - if m.Timestamp != nil { - structMap["timestamp"] = m.Timestamp - } - if m.AmountInCents != nil { - structMap["amount_in_cents"] = m.AmountInCents - } - if m.AmountFormatted != nil { - structMap["amount_formatted"] = m.AmountFormatted - } - if m.Description != nil { - structMap["description"] = m.Description - } - if m.Category != nil { - structMap["category"] = m.Category - } - if m.Breakouts != nil { - structMap["breakouts"] = m.Breakouts - } - if m.LineItems != nil { - structMap["line_items"] = m.LineItems - } - if m.SubscriptionId != nil { - structMap["subscription_id"] = m.SubscriptionId - } - if m.SubscriberName != nil { - structMap["subscriber_name"] = m.SubscriberName - } - return structMap + structMap := make(map[string]any) + if m.Timestamp != nil { + structMap["timestamp"] = m.Timestamp + } + if m.AmountInCents != nil { + structMap["amount_in_cents"] = m.AmountInCents + } + if m.AmountFormatted != nil { + structMap["amount_formatted"] = m.AmountFormatted + } + if m.Description != nil { + structMap["description"] = m.Description + } + if m.Category != nil { + structMap["category"] = m.Category + } + if m.Breakouts != nil { + structMap["breakouts"] = m.Breakouts.toMap() + } + if m.LineItems != nil { + structMap["line_items"] = m.LineItems + } + if m.SubscriptionId != nil { + structMap["subscription_id"] = m.SubscriptionId + } + if m.SubscriberName != nil { + structMap["subscriber_name"] = m.SubscriberName + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Movement. +// UnmarshalJSON implements the json.Unmarshaler interface for Movement. // It customizes the JSON unmarshaling process for Movement objects. func (m *Movement) UnmarshalJSON(input []byte) error { - temp := &struct { - Timestamp *string `json:"timestamp,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - AmountFormatted *string `json:"amount_formatted,omitempty"` - Description *string `json:"description,omitempty"` - Category *string `json:"category,omitempty"` - Breakouts *Breakouts `json:"breakouts,omitempty"` - LineItems []MovementLineItem `json:"line_items,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - SubscriberName *string `json:"subscriber_name,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Timestamp = temp.Timestamp - m.AmountInCents = temp.AmountInCents - m.AmountFormatted = temp.AmountFormatted - m.Description = temp.Description - m.Category = temp.Category - m.Breakouts = temp.Breakouts - m.LineItems = temp.LineItems - m.SubscriptionId = temp.SubscriptionId - m.SubscriberName = temp.SubscriberName - return nil + temp := &struct { + Timestamp *string `json:"timestamp,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + AmountFormatted *string `json:"amount_formatted,omitempty"` + Description *string `json:"description,omitempty"` + Category *string `json:"category,omitempty"` + Breakouts *Breakouts `json:"breakouts,omitempty"` + LineItems []MovementLineItem `json:"line_items,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + SubscriberName *string `json:"subscriber_name,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Timestamp = temp.Timestamp + m.AmountInCents = temp.AmountInCents + m.AmountFormatted = temp.AmountFormatted + m.Description = temp.Description + m.Category = temp.Category + m.Breakouts = temp.Breakouts + m.LineItems = temp.LineItems + m.SubscriptionId = temp.SubscriptionId + m.SubscriberName = temp.SubscriberName + return nil } diff --git a/models/movement_line_item.go b/models/movement_line_item.go index 8029ecb8..dfd92f7e 100644 --- a/models/movement_line_item.go +++ b/models/movement_line_item.go @@ -1,92 +1,92 @@ package models import ( - "encoding/json" + "encoding/json" ) // MovementLineItem represents a MovementLineItem struct. type MovementLineItem struct { - ProductId *int `json:"product_id,omitempty"` - // For Product (or "baseline") line items, this field will have a value of `0`. - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - Name *string `json:"name,omitempty"` - Mrr *int `json:"mrr,omitempty"` - MrrMovements []MRRMovement `json:"mrr_movements,omitempty"` - Quantity *int `json:"quantity,omitempty"` - PrevQuantity *int `json:"prev_quantity,omitempty"` - // When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. - Recurring *bool `json:"recurring,omitempty"` + ProductId *int `json:"product_id,omitempty"` + // For Product (or "baseline") line items, this field will have a value of `0`. + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + Name *string `json:"name,omitempty"` + Mrr *int `json:"mrr,omitempty"` + MrrMovements []MRRMovement `json:"mrr_movements,omitempty"` + Quantity *int `json:"quantity,omitempty"` + PrevQuantity *int `json:"prev_quantity,omitempty"` + // When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. + Recurring *bool `json:"recurring,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MovementLineItem. +// MarshalJSON implements the json.Marshaler interface for MovementLineItem. // It customizes the JSON marshaling process for MovementLineItem objects. func (m *MovementLineItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MovementLineItem object to a map representation for JSON marshaling. func (m *MovementLineItem) toMap() map[string]any { - structMap := make(map[string]any) - if m.ProductId != nil { - structMap["product_id"] = m.ProductId - } - if m.ComponentId != nil { - structMap["component_id"] = m.ComponentId - } - if m.PricePointId != nil { - structMap["price_point_id"] = m.PricePointId - } - if m.Name != nil { - structMap["name"] = m.Name - } - if m.Mrr != nil { - structMap["mrr"] = m.Mrr - } - if m.MrrMovements != nil { - structMap["mrr_movements"] = m.MrrMovements - } - if m.Quantity != nil { - structMap["quantity"] = m.Quantity - } - if m.PrevQuantity != nil { - structMap["prev_quantity"] = m.PrevQuantity - } - if m.Recurring != nil { - structMap["recurring"] = m.Recurring - } - return structMap + structMap := make(map[string]any) + if m.ProductId != nil { + structMap["product_id"] = m.ProductId + } + if m.ComponentId != nil { + structMap["component_id"] = m.ComponentId + } + if m.PricePointId != nil { + structMap["price_point_id"] = m.PricePointId + } + if m.Name != nil { + structMap["name"] = m.Name + } + if m.Mrr != nil { + structMap["mrr"] = m.Mrr + } + if m.MrrMovements != nil { + structMap["mrr_movements"] = m.MrrMovements + } + if m.Quantity != nil { + structMap["quantity"] = m.Quantity + } + if m.PrevQuantity != nil { + structMap["prev_quantity"] = m.PrevQuantity + } + if m.Recurring != nil { + structMap["recurring"] = m.Recurring + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MovementLineItem. +// UnmarshalJSON implements the json.Unmarshaler interface for MovementLineItem. // It customizes the JSON unmarshaling process for MovementLineItem objects. func (m *MovementLineItem) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductId *int `json:"product_id,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - Name *string `json:"name,omitempty"` - Mrr *int `json:"mrr,omitempty"` - MrrMovements []MRRMovement `json:"mrr_movements,omitempty"` - Quantity *int `json:"quantity,omitempty"` - PrevQuantity *int `json:"prev_quantity,omitempty"` - Recurring *bool `json:"recurring,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.ProductId = temp.ProductId - m.ComponentId = temp.ComponentId - m.PricePointId = temp.PricePointId - m.Name = temp.Name - m.Mrr = temp.Mrr - m.MrrMovements = temp.MrrMovements - m.Quantity = temp.Quantity - m.PrevQuantity = temp.PrevQuantity - m.Recurring = temp.Recurring - return nil + temp := &struct { + ProductId *int `json:"product_id,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + Name *string `json:"name,omitempty"` + Mrr *int `json:"mrr,omitempty"` + MrrMovements []MRRMovement `json:"mrr_movements,omitempty"` + Quantity *int `json:"quantity,omitempty"` + PrevQuantity *int `json:"prev_quantity,omitempty"` + Recurring *bool `json:"recurring,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.ProductId = temp.ProductId + m.ComponentId = temp.ComponentId + m.PricePointId = temp.PricePointId + m.Name = temp.Name + m.Mrr = temp.Mrr + m.MrrMovements = temp.MrrMovements + m.Quantity = temp.Quantity + m.PrevQuantity = temp.PrevQuantity + m.Recurring = temp.Recurring + return nil } diff --git a/models/mrr.go b/models/mrr.go index 6bcb4ee3..e9699e5c 100644 --- a/models/mrr.go +++ b/models/mrr.go @@ -1,73 +1,73 @@ package models import ( - "encoding/json" + "encoding/json" ) // MRR represents a MRR struct. type MRR struct { - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - AmountFormatted *string `json:"amount_formatted,omitempty"` - Currency *string `json:"currency,omitempty"` - CurrencySymbol *string `json:"currency_symbol,omitempty"` - Breakouts *Breakouts `json:"breakouts,omitempty"` - // ISO8601 timestamp - AtTime *string `json:"at_time,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + AmountFormatted *string `json:"amount_formatted,omitempty"` + Currency *string `json:"currency,omitempty"` + CurrencySymbol *string `json:"currency_symbol,omitempty"` + Breakouts *Breakouts `json:"breakouts,omitempty"` + // ISO8601 timestamp + AtTime *string `json:"at_time,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MRR. +// MarshalJSON implements the json.Marshaler interface for MRR. // It customizes the JSON marshaling process for MRR objects. func (m *MRR) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MRR object to a map representation for JSON marshaling. func (m *MRR) toMap() map[string]any { - structMap := make(map[string]any) - if m.AmountInCents != nil { - structMap["amount_in_cents"] = m.AmountInCents - } - if m.AmountFormatted != nil { - structMap["amount_formatted"] = m.AmountFormatted - } - if m.Currency != nil { - structMap["currency"] = m.Currency - } - if m.CurrencySymbol != nil { - structMap["currency_symbol"] = m.CurrencySymbol - } - if m.Breakouts != nil { - structMap["breakouts"] = m.Breakouts - } - if m.AtTime != nil { - structMap["at_time"] = m.AtTime - } - return structMap + structMap := make(map[string]any) + if m.AmountInCents != nil { + structMap["amount_in_cents"] = m.AmountInCents + } + if m.AmountFormatted != nil { + structMap["amount_formatted"] = m.AmountFormatted + } + if m.Currency != nil { + structMap["currency"] = m.Currency + } + if m.CurrencySymbol != nil { + structMap["currency_symbol"] = m.CurrencySymbol + } + if m.Breakouts != nil { + structMap["breakouts"] = m.Breakouts.toMap() + } + if m.AtTime != nil { + structMap["at_time"] = m.AtTime + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MRR. +// UnmarshalJSON implements the json.Unmarshaler interface for MRR. // It customizes the JSON unmarshaling process for MRR objects. func (m *MRR) UnmarshalJSON(input []byte) error { - temp := &struct { - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - AmountFormatted *string `json:"amount_formatted,omitempty"` - Currency *string `json:"currency,omitempty"` - CurrencySymbol *string `json:"currency_symbol,omitempty"` - Breakouts *Breakouts `json:"breakouts,omitempty"` - AtTime *string `json:"at_time,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.AmountInCents = temp.AmountInCents - m.AmountFormatted = temp.AmountFormatted - m.Currency = temp.Currency - m.CurrencySymbol = temp.CurrencySymbol - m.Breakouts = temp.Breakouts - m.AtTime = temp.AtTime - return nil + temp := &struct { + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + AmountFormatted *string `json:"amount_formatted,omitempty"` + Currency *string `json:"currency,omitempty"` + CurrencySymbol *string `json:"currency_symbol,omitempty"` + Breakouts *Breakouts `json:"breakouts,omitempty"` + AtTime *string `json:"at_time,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.AmountInCents = temp.AmountInCents + m.AmountFormatted = temp.AmountFormatted + m.Currency = temp.Currency + m.CurrencySymbol = temp.CurrencySymbol + m.Breakouts = temp.Breakouts + m.AtTime = temp.AtTime + return nil } diff --git a/models/mrr_movement.go b/models/mrr_movement.go index ecf4947a..76538e16 100644 --- a/models/mrr_movement.go +++ b/models/mrr_movement.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // MRRMovement represents a MRRMovement struct. type MRRMovement struct { - Amount *int `json:"amount,omitempty"` - Category *string `json:"category,omitempty"` - SubscriberDelta *int `json:"subscriber_delta,omitempty"` - LeadDelta *int `json:"lead_delta,omitempty"` + Amount *int `json:"amount,omitempty"` + Category *string `json:"category,omitempty"` + SubscriberDelta *int `json:"subscriber_delta,omitempty"` + LeadDelta *int `json:"lead_delta,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MRRMovement. +// MarshalJSON implements the json.Marshaler interface for MRRMovement. // It customizes the JSON marshaling process for MRRMovement objects. func (m *MRRMovement) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MRRMovement object to a map representation for JSON marshaling. func (m *MRRMovement) toMap() map[string]any { - structMap := make(map[string]any) - if m.Amount != nil { - structMap["amount"] = m.Amount - } - if m.Category != nil { - structMap["category"] = m.Category - } - if m.SubscriberDelta != nil { - structMap["subscriber_delta"] = m.SubscriberDelta - } - if m.LeadDelta != nil { - structMap["lead_delta"] = m.LeadDelta - } - return structMap + structMap := make(map[string]any) + if m.Amount != nil { + structMap["amount"] = m.Amount + } + if m.Category != nil { + structMap["category"] = m.Category + } + if m.SubscriberDelta != nil { + structMap["subscriber_delta"] = m.SubscriberDelta + } + if m.LeadDelta != nil { + structMap["lead_delta"] = m.LeadDelta + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MRRMovement. +// UnmarshalJSON implements the json.Unmarshaler interface for MRRMovement. // It customizes the JSON unmarshaling process for MRRMovement objects. func (m *MRRMovement) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount *int `json:"amount,omitempty"` - Category *string `json:"category,omitempty"` - SubscriberDelta *int `json:"subscriber_delta,omitempty"` - LeadDelta *int `json:"lead_delta,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Amount = temp.Amount - m.Category = temp.Category - m.SubscriberDelta = temp.SubscriberDelta - m.LeadDelta = temp.LeadDelta - return nil + temp := &struct { + Amount *int `json:"amount,omitempty"` + Category *string `json:"category,omitempty"` + SubscriberDelta *int `json:"subscriber_delta,omitempty"` + LeadDelta *int `json:"lead_delta,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Amount = temp.Amount + m.Category = temp.Category + m.SubscriberDelta = temp.SubscriberDelta + m.LeadDelta = temp.LeadDelta + return nil } diff --git a/models/mrr_response.go b/models/mrr_response.go index 6d12a65d..378dfdee 100644 --- a/models/mrr_response.go +++ b/models/mrr_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // MRRResponse represents a MRRResponse struct. type MRRResponse struct { - Mrr MRR `json:"mrr"` + Mrr MRR `json:"mrr"` } -// MarshalJSON implements the json.Marshaler interface for MRRResponse. +// MarshalJSON implements the json.Marshaler interface for MRRResponse. // It customizes the JSON marshaling process for MRRResponse objects. func (m *MRRResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MRRResponse object to a map representation for JSON marshaling. func (m *MRRResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["mrr"] = m.Mrr - return structMap + structMap := make(map[string]any) + structMap["mrr"] = m.Mrr.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MRRResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for MRRResponse. // It customizes the JSON unmarshaling process for MRRResponse objects. func (m *MRRResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Mrr MRR `json:"mrr"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Mrr = temp.Mrr - return nil + temp := &struct { + Mrr MRR `json:"mrr"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Mrr = temp.Mrr + return nil } diff --git a/models/multi_invoice_payment.go b/models/multi_invoice_payment.go index 8ee4d3b2..66fc2d80 100644 --- a/models/multi_invoice_payment.go +++ b/models/multi_invoice_payment.go @@ -1,63 +1,63 @@ package models import ( - "encoding/json" + "encoding/json" ) // MultiInvoicePayment represents a MultiInvoicePayment struct. type MultiInvoicePayment struct { - // The numeric ID of the transaction. - TransactionId *int `json:"transaction_id,omitempty"` - // Dollar amount of the sum of the paid invoices. - TotalAmount *string `json:"total_amount,omitempty"` - // The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. - CurrencyCode *string `json:"currency_code,omitempty"` - Applications []InvoicePaymentApplication `json:"applications,omitempty"` + // The numeric ID of the transaction. + TransactionId *int `json:"transaction_id,omitempty"` + // Dollar amount of the sum of the paid invoices. + TotalAmount *string `json:"total_amount,omitempty"` + // The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. + CurrencyCode *string `json:"currency_code,omitempty"` + Applications []InvoicePaymentApplication `json:"applications,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for MultiInvoicePayment. +// MarshalJSON implements the json.Marshaler interface for MultiInvoicePayment. // It customizes the JSON marshaling process for MultiInvoicePayment objects. func (m *MultiInvoicePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MultiInvoicePayment object to a map representation for JSON marshaling. func (m *MultiInvoicePayment) toMap() map[string]any { - structMap := make(map[string]any) - if m.TransactionId != nil { - structMap["transaction_id"] = m.TransactionId - } - if m.TotalAmount != nil { - structMap["total_amount"] = m.TotalAmount - } - if m.CurrencyCode != nil { - structMap["currency_code"] = m.CurrencyCode - } - if m.Applications != nil { - structMap["applications"] = m.Applications - } - return structMap + structMap := make(map[string]any) + if m.TransactionId != nil { + structMap["transaction_id"] = m.TransactionId + } + if m.TotalAmount != nil { + structMap["total_amount"] = m.TotalAmount + } + if m.CurrencyCode != nil { + structMap["currency_code"] = m.CurrencyCode + } + if m.Applications != nil { + structMap["applications"] = m.Applications + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePayment. // It customizes the JSON unmarshaling process for MultiInvoicePayment objects. func (m *MultiInvoicePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - TransactionId *int `json:"transaction_id,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CurrencyCode *string `json:"currency_code,omitempty"` - Applications []InvoicePaymentApplication `json:"applications,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.TransactionId = temp.TransactionId - m.TotalAmount = temp.TotalAmount - m.CurrencyCode = temp.CurrencyCode - m.Applications = temp.Applications - return nil + temp := &struct { + TransactionId *int `json:"transaction_id,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CurrencyCode *string `json:"currency_code,omitempty"` + Applications []InvoicePaymentApplication `json:"applications,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.TransactionId = temp.TransactionId + m.TotalAmount = temp.TotalAmount + m.CurrencyCode = temp.CurrencyCode + m.Applications = temp.Applications + return nil } diff --git a/models/multi_invoice_payment_response.go b/models/multi_invoice_payment_response.go index fd5ffcd7..430edd56 100644 --- a/models/multi_invoice_payment_response.go +++ b/models/multi_invoice_payment_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // MultiInvoicePaymentResponse represents a MultiInvoicePaymentResponse struct. type MultiInvoicePaymentResponse struct { - Payment MultiInvoicePayment `json:"payment"` + Payment MultiInvoicePayment `json:"payment"` } -// MarshalJSON implements the json.Marshaler interface for MultiInvoicePaymentResponse. +// MarshalJSON implements the json.Marshaler interface for MultiInvoicePaymentResponse. // It customizes the JSON marshaling process for MultiInvoicePaymentResponse objects. func (m *MultiInvoicePaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(m.toMap()) + []byte, + error) { + return json.Marshal(m.toMap()) } // toMap converts the MultiInvoicePaymentResponse object to a map representation for JSON marshaling. func (m *MultiInvoicePaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment"] = m.Payment - return structMap + structMap := make(map[string]any) + structMap["payment"] = m.Payment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePaymentResponse. // It customizes the JSON unmarshaling process for MultiInvoicePaymentResponse objects. func (m *MultiInvoicePaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Payment MultiInvoicePayment `json:"payment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - m.Payment = temp.Payment - return nil + temp := &struct { + Payment MultiInvoicePayment `json:"payment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + m.Payment = temp.Payment + return nil } diff --git a/models/nested_subscription_group.go b/models/nested_subscription_group.go index 9f83de90..3475fbea 100644 --- a/models/nested_subscription_group.go +++ b/models/nested_subscription_group.go @@ -1,64 +1,64 @@ package models import ( - "encoding/json" + "encoding/json" ) // NestedSubscriptionGroup represents a NestedSubscriptionGroup struct. type NestedSubscriptionGroup struct { - // The UID for the group - Uid *string `json:"uid,omitempty"` - // Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1. - Scheme *int `json:"scheme,omitempty"` - // The subscription ID of the primary within the group. Applicable to scheme 1. - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - // A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. - Primary *bool `json:"primary,omitempty"` + // The UID for the group + Uid *string `json:"uid,omitempty"` + // Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1. + Scheme *int `json:"scheme,omitempty"` + // The subscription ID of the primary within the group. Applicable to scheme 1. + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + // A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. + Primary *bool `json:"primary,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for NestedSubscriptionGroup. +// MarshalJSON implements the json.Marshaler interface for NestedSubscriptionGroup. // It customizes the JSON marshaling process for NestedSubscriptionGroup objects. func (n *NestedSubscriptionGroup) MarshalJSON() ( - []byte, - error) { - return json.Marshal(n.toMap()) + []byte, + error) { + return json.Marshal(n.toMap()) } // toMap converts the NestedSubscriptionGroup object to a map representation for JSON marshaling. func (n *NestedSubscriptionGroup) toMap() map[string]any { - structMap := make(map[string]any) - if n.Uid != nil { - structMap["uid"] = n.Uid - } - if n.Scheme != nil { - structMap["scheme"] = n.Scheme - } - if n.PrimarySubscriptionId != nil { - structMap["primary_subscription_id"] = n.PrimarySubscriptionId - } - if n.Primary != nil { - structMap["primary"] = n.Primary - } - return structMap + structMap := make(map[string]any) + if n.Uid != nil { + structMap["uid"] = n.Uid + } + if n.Scheme != nil { + structMap["scheme"] = n.Scheme + } + if n.PrimarySubscriptionId != nil { + structMap["primary_subscription_id"] = n.PrimarySubscriptionId + } + if n.Primary != nil { + structMap["primary"] = n.Primary + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for NestedSubscriptionGroup. +// UnmarshalJSON implements the json.Unmarshaler interface for NestedSubscriptionGroup. // It customizes the JSON unmarshaling process for NestedSubscriptionGroup objects. func (n *NestedSubscriptionGroup) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - Primary *bool `json:"primary,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - n.Uid = temp.Uid - n.Scheme = temp.Scheme - n.PrimarySubscriptionId = temp.PrimarySubscriptionId - n.Primary = temp.Primary - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + Primary *bool `json:"primary,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + n.Uid = temp.Uid + n.Scheme = temp.Scheme + n.PrimarySubscriptionId = temp.PrimarySubscriptionId + n.Primary = temp.Primary + return nil } diff --git a/models/net_terms.go b/models/net_terms.go index 8394515a..c92373c3 100644 --- a/models/net_terms.go +++ b/models/net_terms.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // NetTerms represents a NetTerms struct. type NetTerms struct { - DefaultNetTerms *int `json:"default_net_terms,omitempty"` - AutomaticNetTerms *int `json:"automatic_net_terms,omitempty"` - RemittanceNetTerms *int `json:"remittance_net_terms,omitempty"` - NetTermsOnRemittanceSignupsEnabled *bool `json:"net_terms_on_remittance_signups_enabled,omitempty"` - CustomNetTermsEnabled *bool `json:"custom_net_terms_enabled,omitempty"` + DefaultNetTerms *int `json:"default_net_terms,omitempty"` + AutomaticNetTerms *int `json:"automatic_net_terms,omitempty"` + RemittanceNetTerms *int `json:"remittance_net_terms,omitempty"` + NetTermsOnRemittanceSignupsEnabled *bool `json:"net_terms_on_remittance_signups_enabled,omitempty"` + CustomNetTermsEnabled *bool `json:"custom_net_terms_enabled,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for NetTerms. +// MarshalJSON implements the json.Marshaler interface for NetTerms. // It customizes the JSON marshaling process for NetTerms objects. func (n *NetTerms) MarshalJSON() ( - []byte, - error) { - return json.Marshal(n.toMap()) + []byte, + error) { + return json.Marshal(n.toMap()) } // toMap converts the NetTerms object to a map representation for JSON marshaling. func (n *NetTerms) toMap() map[string]any { - structMap := make(map[string]any) - if n.DefaultNetTerms != nil { - structMap["default_net_terms"] = n.DefaultNetTerms - } - if n.AutomaticNetTerms != nil { - structMap["automatic_net_terms"] = n.AutomaticNetTerms - } - if n.RemittanceNetTerms != nil { - structMap["remittance_net_terms"] = n.RemittanceNetTerms - } - if n.NetTermsOnRemittanceSignupsEnabled != nil { - structMap["net_terms_on_remittance_signups_enabled"] = n.NetTermsOnRemittanceSignupsEnabled - } - if n.CustomNetTermsEnabled != nil { - structMap["custom_net_terms_enabled"] = n.CustomNetTermsEnabled - } - return structMap + structMap := make(map[string]any) + if n.DefaultNetTerms != nil { + structMap["default_net_terms"] = n.DefaultNetTerms + } + if n.AutomaticNetTerms != nil { + structMap["automatic_net_terms"] = n.AutomaticNetTerms + } + if n.RemittanceNetTerms != nil { + structMap["remittance_net_terms"] = n.RemittanceNetTerms + } + if n.NetTermsOnRemittanceSignupsEnabled != nil { + structMap["net_terms_on_remittance_signups_enabled"] = n.NetTermsOnRemittanceSignupsEnabled + } + if n.CustomNetTermsEnabled != nil { + structMap["custom_net_terms_enabled"] = n.CustomNetTermsEnabled + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for NetTerms. +// UnmarshalJSON implements the json.Unmarshaler interface for NetTerms. // It customizes the JSON unmarshaling process for NetTerms objects. func (n *NetTerms) UnmarshalJSON(input []byte) error { - temp := &struct { - DefaultNetTerms *int `json:"default_net_terms,omitempty"` - AutomaticNetTerms *int `json:"automatic_net_terms,omitempty"` - RemittanceNetTerms *int `json:"remittance_net_terms,omitempty"` - NetTermsOnRemittanceSignupsEnabled *bool `json:"net_terms_on_remittance_signups_enabled,omitempty"` - CustomNetTermsEnabled *bool `json:"custom_net_terms_enabled,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - n.DefaultNetTerms = temp.DefaultNetTerms - n.AutomaticNetTerms = temp.AutomaticNetTerms - n.RemittanceNetTerms = temp.RemittanceNetTerms - n.NetTermsOnRemittanceSignupsEnabled = temp.NetTermsOnRemittanceSignupsEnabled - n.CustomNetTermsEnabled = temp.CustomNetTermsEnabled - return nil + temp := &struct { + DefaultNetTerms *int `json:"default_net_terms,omitempty"` + AutomaticNetTerms *int `json:"automatic_net_terms,omitempty"` + RemittanceNetTerms *int `json:"remittance_net_terms,omitempty"` + NetTermsOnRemittanceSignupsEnabled *bool `json:"net_terms_on_remittance_signups_enabled,omitempty"` + CustomNetTermsEnabled *bool `json:"custom_net_terms_enabled,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + n.DefaultNetTerms = temp.DefaultNetTerms + n.AutomaticNetTerms = temp.AutomaticNetTerms + n.RemittanceNetTerms = temp.RemittanceNetTerms + n.NetTermsOnRemittanceSignupsEnabled = temp.NetTermsOnRemittanceSignupsEnabled + n.CustomNetTermsEnabled = temp.CustomNetTermsEnabled + return nil } diff --git a/models/offer.go b/models/offer.go index a52eb9f2..191dc8af 100644 --- a/models/offer.go +++ b/models/offer.go @@ -1,150 +1,150 @@ package models import ( - "encoding/json" + "encoding/json" ) // Offer represents a Offer struct. type Offer struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - ProductFamilyId *int `json:"product_family_id,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductRevisableNumber *int `json:"product_revisable_number,omitempty"` - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - Description Optional[string] `json:"description"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - ArchivedAt Optional[string] `json:"archived_at"` - OfferItems []OfferItem `json:"offer_items,omitempty"` - OfferDiscounts []OfferDiscount `json:"offer_discounts,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductPricePointName *string `json:"product_price_point_name,omitempty"` - ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` - OfferSignupPages []OfferSignupPage `json:"offer_signup_pages,omitempty"` + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + ProductFamilyId *int `json:"product_family_id,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductRevisableNumber *int `json:"product_revisable_number,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + Description Optional[string] `json:"description"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + ArchivedAt Optional[string] `json:"archived_at"` + OfferItems []OfferItem `json:"offer_items,omitempty"` + OfferDiscounts []OfferDiscount `json:"offer_discounts,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductPricePointName *string `json:"product_price_point_name,omitempty"` + ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` + OfferSignupPages []OfferSignupPage `json:"offer_signup_pages,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Offer. +// MarshalJSON implements the json.Marshaler interface for Offer. // It customizes the JSON marshaling process for Offer objects. func (o *Offer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the Offer object to a map representation for JSON marshaling. func (o *Offer) toMap() map[string]any { - structMap := make(map[string]any) - if o.Id != nil { - structMap["id"] = o.Id - } - if o.SiteId != nil { - structMap["site_id"] = o.SiteId - } - if o.ProductFamilyId != nil { - structMap["product_family_id"] = o.ProductFamilyId - } - if o.ProductId != nil { - structMap["product_id"] = o.ProductId - } - if o.ProductPricePointId != nil { - structMap["product_price_point_id"] = o.ProductPricePointId - } - if o.ProductRevisableNumber != nil { - structMap["product_revisable_number"] = o.ProductRevisableNumber - } - if o.Name != nil { - structMap["name"] = o.Name - } - if o.Handle != nil { - structMap["handle"] = o.Handle - } - if o.Description.IsValueSet() { - structMap["description"] = o.Description.Value() - } - if o.CreatedAt != nil { - structMap["created_at"] = o.CreatedAt - } - if o.UpdatedAt != nil { - structMap["updated_at"] = o.UpdatedAt - } - if o.ArchivedAt.IsValueSet() { - structMap["archived_at"] = o.ArchivedAt.Value() - } - if o.OfferItems != nil { - structMap["offer_items"] = o.OfferItems - } - if o.OfferDiscounts != nil { - structMap["offer_discounts"] = o.OfferDiscounts - } - if o.ProductFamilyName != nil { - structMap["product_family_name"] = o.ProductFamilyName - } - if o.ProductName != nil { - structMap["product_name"] = o.ProductName - } - if o.ProductPricePointName != nil { - structMap["product_price_point_name"] = o.ProductPricePointName - } - if o.ProductPriceInCents != nil { - structMap["product_price_in_cents"] = o.ProductPriceInCents - } - if o.OfferSignupPages != nil { - structMap["offer_signup_pages"] = o.OfferSignupPages - } - return structMap + structMap := make(map[string]any) + if o.Id != nil { + structMap["id"] = o.Id + } + if o.SiteId != nil { + structMap["site_id"] = o.SiteId + } + if o.ProductFamilyId != nil { + structMap["product_family_id"] = o.ProductFamilyId + } + if o.ProductId != nil { + structMap["product_id"] = o.ProductId + } + if o.ProductPricePointId != nil { + structMap["product_price_point_id"] = o.ProductPricePointId + } + if o.ProductRevisableNumber != nil { + structMap["product_revisable_number"] = o.ProductRevisableNumber + } + if o.Name != nil { + structMap["name"] = o.Name + } + if o.Handle != nil { + structMap["handle"] = o.Handle + } + if o.Description.IsValueSet() { + structMap["description"] = o.Description.Value() + } + if o.CreatedAt != nil { + structMap["created_at"] = o.CreatedAt + } + if o.UpdatedAt != nil { + structMap["updated_at"] = o.UpdatedAt + } + if o.ArchivedAt.IsValueSet() { + structMap["archived_at"] = o.ArchivedAt.Value() + } + if o.OfferItems != nil { + structMap["offer_items"] = o.OfferItems + } + if o.OfferDiscounts != nil { + structMap["offer_discounts"] = o.OfferDiscounts + } + if o.ProductFamilyName != nil { + structMap["product_family_name"] = o.ProductFamilyName + } + if o.ProductName != nil { + structMap["product_name"] = o.ProductName + } + if o.ProductPricePointName != nil { + structMap["product_price_point_name"] = o.ProductPricePointName + } + if o.ProductPriceInCents != nil { + structMap["product_price_in_cents"] = o.ProductPriceInCents + } + if o.OfferSignupPages != nil { + structMap["offer_signup_pages"] = o.OfferSignupPages + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Offer. +// UnmarshalJSON implements the json.Unmarshaler interface for Offer. // It customizes the JSON unmarshaling process for Offer objects. func (o *Offer) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - ProductFamilyId *int `json:"product_family_id,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductRevisableNumber *int `json:"product_revisable_number,omitempty"` - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - Description Optional[string] `json:"description"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - ArchivedAt Optional[string] `json:"archived_at"` - OfferItems []OfferItem `json:"offer_items,omitempty"` - OfferDiscounts []OfferDiscount `json:"offer_discounts,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductPricePointName *string `json:"product_price_point_name,omitempty"` - ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` - OfferSignupPages []OfferSignupPage `json:"offer_signup_pages,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Id = temp.Id - o.SiteId = temp.SiteId - o.ProductFamilyId = temp.ProductFamilyId - o.ProductId = temp.ProductId - o.ProductPricePointId = temp.ProductPricePointId - o.ProductRevisableNumber = temp.ProductRevisableNumber - o.Name = temp.Name - o.Handle = temp.Handle - o.Description = temp.Description - o.CreatedAt = temp.CreatedAt - o.UpdatedAt = temp.UpdatedAt - o.ArchivedAt = temp.ArchivedAt - o.OfferItems = temp.OfferItems - o.OfferDiscounts = temp.OfferDiscounts - o.ProductFamilyName = temp.ProductFamilyName - o.ProductName = temp.ProductName - o.ProductPricePointName = temp.ProductPricePointName - o.ProductPriceInCents = temp.ProductPriceInCents - o.OfferSignupPages = temp.OfferSignupPages - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + ProductFamilyId *int `json:"product_family_id,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductRevisableNumber *int `json:"product_revisable_number,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + Description Optional[string] `json:"description"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + ArchivedAt Optional[string] `json:"archived_at"` + OfferItems []OfferItem `json:"offer_items,omitempty"` + OfferDiscounts []OfferDiscount `json:"offer_discounts,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductPricePointName *string `json:"product_price_point_name,omitempty"` + ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` + OfferSignupPages []OfferSignupPage `json:"offer_signup_pages,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Id = temp.Id + o.SiteId = temp.SiteId + o.ProductFamilyId = temp.ProductFamilyId + o.ProductId = temp.ProductId + o.ProductPricePointId = temp.ProductPricePointId + o.ProductRevisableNumber = temp.ProductRevisableNumber + o.Name = temp.Name + o.Handle = temp.Handle + o.Description = temp.Description + o.CreatedAt = temp.CreatedAt + o.UpdatedAt = temp.UpdatedAt + o.ArchivedAt = temp.ArchivedAt + o.OfferItems = temp.OfferItems + o.OfferDiscounts = temp.OfferDiscounts + o.ProductFamilyName = temp.ProductFamilyName + o.ProductName = temp.ProductName + o.ProductPricePointName = temp.ProductPricePointName + o.ProductPriceInCents = temp.ProductPriceInCents + o.OfferSignupPages = temp.OfferSignupPages + return nil } diff --git a/models/offer_discount.go b/models/offer_discount.go index 3f3cd4da..58ae2035 100644 --- a/models/offer_discount.go +++ b/models/offer_discount.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // OfferDiscount represents a OfferDiscount struct. type OfferDiscount struct { - CouponCode *string `json:"coupon_code,omitempty"` - CouponId *int `json:"coupon_id,omitempty"` - CouponName *string `json:"coupon_name,omitempty"` + CouponCode *string `json:"coupon_code,omitempty"` + CouponId *int `json:"coupon_id,omitempty"` + CouponName *string `json:"coupon_name,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OfferDiscount. +// MarshalJSON implements the json.Marshaler interface for OfferDiscount. // It customizes the JSON marshaling process for OfferDiscount objects. func (o *OfferDiscount) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OfferDiscount object to a map representation for JSON marshaling. func (o *OfferDiscount) toMap() map[string]any { - structMap := make(map[string]any) - if o.CouponCode != nil { - structMap["coupon_code"] = o.CouponCode - } - if o.CouponId != nil { - structMap["coupon_id"] = o.CouponId - } - if o.CouponName != nil { - structMap["coupon_name"] = o.CouponName - } - return structMap + structMap := make(map[string]any) + if o.CouponCode != nil { + structMap["coupon_code"] = o.CouponCode + } + if o.CouponId != nil { + structMap["coupon_id"] = o.CouponId + } + if o.CouponName != nil { + structMap["coupon_name"] = o.CouponName + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OfferDiscount. +// UnmarshalJSON implements the json.Unmarshaler interface for OfferDiscount. // It customizes the JSON unmarshaling process for OfferDiscount objects. func (o *OfferDiscount) UnmarshalJSON(input []byte) error { - temp := &struct { - CouponCode *string `json:"coupon_code,omitempty"` - CouponId *int `json:"coupon_id,omitempty"` - CouponName *string `json:"coupon_name,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.CouponCode = temp.CouponCode - o.CouponId = temp.CouponId - o.CouponName = temp.CouponName - return nil + temp := &struct { + CouponCode *string `json:"coupon_code,omitempty"` + CouponId *int `json:"coupon_id,omitempty"` + CouponName *string `json:"coupon_name,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.CouponCode = temp.CouponCode + o.CouponId = temp.CouponId + o.CouponName = temp.CouponName + return nil } diff --git a/models/offer_item.go b/models/offer_item.go index 4950a1e1..e8b15399 100644 --- a/models/offer_item.go +++ b/models/offer_item.go @@ -1,98 +1,98 @@ package models import ( - "encoding/json" + "encoding/json" ) // OfferItem represents a OfferItem struct. type OfferItem struct { - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - StartingQuantity *string `json:"starting_quantity,omitempty"` - Editable *bool `json:"editable,omitempty"` - ComponentUnitPrice *string `json:"component_unit_price,omitempty"` - ComponentName *string `json:"component_name,omitempty"` - PricePointName *string `json:"price_point_name,omitempty"` - CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + StartingQuantity *string `json:"starting_quantity,omitempty"` + Editable *bool `json:"editable,omitempty"` + ComponentUnitPrice *string `json:"component_unit_price,omitempty"` + ComponentName *string `json:"component_name,omitempty"` + PricePointName *string `json:"price_point_name,omitempty"` + CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OfferItem. +// MarshalJSON implements the json.Marshaler interface for OfferItem. // It customizes the JSON marshaling process for OfferItem objects. func (o *OfferItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OfferItem object to a map representation for JSON marshaling. func (o *OfferItem) toMap() map[string]any { - structMap := make(map[string]any) - if o.ComponentId != nil { - structMap["component_id"] = o.ComponentId - } - if o.PricePointId != nil { - structMap["price_point_id"] = o.PricePointId - } - if o.StartingQuantity != nil { - structMap["starting_quantity"] = o.StartingQuantity - } - if o.Editable != nil { - structMap["editable"] = o.Editable - } - if o.ComponentUnitPrice != nil { - structMap["component_unit_price"] = o.ComponentUnitPrice - } - if o.ComponentName != nil { - structMap["component_name"] = o.ComponentName - } - if o.PricePointName != nil { - structMap["price_point_name"] = o.PricePointName - } - if o.CurrencyPrices != nil { - structMap["currency_prices"] = o.CurrencyPrices - } - if o.Interval != nil { - structMap["interval"] = o.Interval - } - if o.IntervalUnit != nil { - structMap["interval_unit"] = o.IntervalUnit - } - return structMap + structMap := make(map[string]any) + if o.ComponentId != nil { + structMap["component_id"] = o.ComponentId + } + if o.PricePointId != nil { + structMap["price_point_id"] = o.PricePointId + } + if o.StartingQuantity != nil { + structMap["starting_quantity"] = o.StartingQuantity + } + if o.Editable != nil { + structMap["editable"] = o.Editable + } + if o.ComponentUnitPrice != nil { + structMap["component_unit_price"] = o.ComponentUnitPrice + } + if o.ComponentName != nil { + structMap["component_name"] = o.ComponentName + } + if o.PricePointName != nil { + structMap["price_point_name"] = o.PricePointName + } + if o.CurrencyPrices != nil { + structMap["currency_prices"] = o.CurrencyPrices + } + if o.Interval != nil { + structMap["interval"] = o.Interval + } + if o.IntervalUnit != nil { + structMap["interval_unit"] = o.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OfferItem. +// UnmarshalJSON implements the json.Unmarshaler interface for OfferItem. // It customizes the JSON unmarshaling process for OfferItem objects. func (o *OfferItem) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - StartingQuantity *string `json:"starting_quantity,omitempty"` - Editable *bool `json:"editable,omitempty"` - ComponentUnitPrice *string `json:"component_unit_price,omitempty"` - ComponentName *string `json:"component_name,omitempty"` - PricePointName *string `json:"price_point_name,omitempty"` - CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.ComponentId = temp.ComponentId - o.PricePointId = temp.PricePointId - o.StartingQuantity = temp.StartingQuantity - o.Editable = temp.Editable - o.ComponentUnitPrice = temp.ComponentUnitPrice - o.ComponentName = temp.ComponentName - o.PricePointName = temp.PricePointName - o.CurrencyPrices = temp.CurrencyPrices - o.Interval = temp.Interval - o.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + StartingQuantity *string `json:"starting_quantity,omitempty"` + Editable *bool `json:"editable,omitempty"` + ComponentUnitPrice *string `json:"component_unit_price,omitempty"` + ComponentName *string `json:"component_name,omitempty"` + PricePointName *string `json:"price_point_name,omitempty"` + CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.ComponentId = temp.ComponentId + o.PricePointId = temp.PricePointId + o.StartingQuantity = temp.StartingQuantity + o.Editable = temp.Editable + o.ComponentUnitPrice = temp.ComponentUnitPrice + o.ComponentName = temp.ComponentName + o.PricePointName = temp.PricePointName + o.CurrencyPrices = temp.CurrencyPrices + o.Interval = temp.Interval + o.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/offer_response.go b/models/offer_response.go index 63a35695..dc1949b3 100644 --- a/models/offer_response.go +++ b/models/offer_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // OfferResponse represents a OfferResponse struct. type OfferResponse struct { - Offer *Offer `json:"offer,omitempty"` + Offer *Offer `json:"offer,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OfferResponse. +// MarshalJSON implements the json.Marshaler interface for OfferResponse. // It customizes the JSON marshaling process for OfferResponse objects. func (o *OfferResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OfferResponse object to a map representation for JSON marshaling. func (o *OfferResponse) toMap() map[string]any { - structMap := make(map[string]any) - if o.Offer != nil { - structMap["offer"] = o.Offer - } - return structMap + structMap := make(map[string]any) + if o.Offer != nil { + structMap["offer"] = o.Offer.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OfferResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for OfferResponse. // It customizes the JSON unmarshaling process for OfferResponse objects. func (o *OfferResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Offer *Offer `json:"offer,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Offer = temp.Offer - return nil + temp := &struct { + Offer *Offer `json:"offer,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Offer = temp.Offer + return nil } diff --git a/models/offer_signup_page.go b/models/offer_signup_page.go index f515d48c..850ee541 100644 --- a/models/offer_signup_page.go +++ b/models/offer_signup_page.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // OfferSignupPage represents a OfferSignupPage struct. type OfferSignupPage struct { - Id *int `json:"id,omitempty"` - Nickname *string `json:"nickname,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ReturnUrl *string `json:"return_url,omitempty"` - ReturnParams *string `json:"return_params,omitempty"` - Url *string `json:"url,omitempty"` + Id *int `json:"id,omitempty"` + Nickname *string `json:"nickname,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ReturnUrl *string `json:"return_url,omitempty"` + ReturnParams *string `json:"return_params,omitempty"` + Url *string `json:"url,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OfferSignupPage. +// MarshalJSON implements the json.Marshaler interface for OfferSignupPage. // It customizes the JSON marshaling process for OfferSignupPage objects. func (o *OfferSignupPage) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OfferSignupPage object to a map representation for JSON marshaling. func (o *OfferSignupPage) toMap() map[string]any { - structMap := make(map[string]any) - if o.Id != nil { - structMap["id"] = o.Id - } - if o.Nickname != nil { - structMap["nickname"] = o.Nickname - } - if o.Enabled != nil { - structMap["enabled"] = o.Enabled - } - if o.ReturnUrl != nil { - structMap["return_url"] = o.ReturnUrl - } - if o.ReturnParams != nil { - structMap["return_params"] = o.ReturnParams - } - if o.Url != nil { - structMap["url"] = o.Url - } - return structMap + structMap := make(map[string]any) + if o.Id != nil { + structMap["id"] = o.Id + } + if o.Nickname != nil { + structMap["nickname"] = o.Nickname + } + if o.Enabled != nil { + structMap["enabled"] = o.Enabled + } + if o.ReturnUrl != nil { + structMap["return_url"] = o.ReturnUrl + } + if o.ReturnParams != nil { + structMap["return_params"] = o.ReturnParams + } + if o.Url != nil { + structMap["url"] = o.Url + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OfferSignupPage. +// UnmarshalJSON implements the json.Unmarshaler interface for OfferSignupPage. // It customizes the JSON unmarshaling process for OfferSignupPage objects. func (o *OfferSignupPage) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Nickname *string `json:"nickname,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - ReturnUrl *string `json:"return_url,omitempty"` - ReturnParams *string `json:"return_params,omitempty"` - Url *string `json:"url,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Id = temp.Id - o.Nickname = temp.Nickname - o.Enabled = temp.Enabled - o.ReturnUrl = temp.ReturnUrl - o.ReturnParams = temp.ReturnParams - o.Url = temp.Url - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Nickname *string `json:"nickname,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + ReturnUrl *string `json:"return_url,omitempty"` + ReturnParams *string `json:"return_params,omitempty"` + Url *string `json:"url,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Id = temp.Id + o.Nickname = temp.Nickname + o.Enabled = temp.Enabled + o.ReturnUrl = temp.ReturnUrl + o.ReturnParams = temp.ReturnParams + o.Url = temp.Url + return nil } diff --git a/models/on_off_component.go b/models/on_off_component.go index e0e8113b..eef1977e 100644 --- a/models/on_off_component.go +++ b/models/on_off_component.go @@ -1,151 +1,151 @@ package models import ( - "encoding/json" + "encoding/json" ) // OnOffComponent represents a OnOffComponent struct. type OnOffComponent struct { - // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". - Name string `json:"name"` - // A description for the component that will be displayed to the user on the hosted signup page. - Description *string `json:"description,omitempty"` - // 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 '_'. - Handle *string `json:"handle,omitempty"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. - Prices []Price `json:"prices,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice *interface{} `json:"unit_price,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` - // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - // deprecated May 2011 - use unit_price instead - PriceInCents *string `json:"price_in_cents,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". + Name string `json:"name"` + // A description for the component that will be displayed to the user on the hosted signup page. + Description *string `json:"description,omitempty"` + // 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 '_'. + Handle *string `json:"handle,omitempty"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. + Prices []Price `json:"prices,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice *interface{} `json:"unit_price,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` + // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + // deprecated May 2011 - use unit_price instead + PriceInCents *string `json:"price_in_cents,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OnOffComponent. +// MarshalJSON implements the json.Marshaler interface for OnOffComponent. // It customizes the JSON marshaling process for OnOffComponent objects. func (o *OnOffComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OnOffComponent object to a map representation for JSON marshaling. func (o *OnOffComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = o.Name - if o.Description != nil { - structMap["description"] = o.Description - } - if o.Handle != nil { - structMap["handle"] = o.Handle - } - if o.Taxable != nil { - structMap["taxable"] = o.Taxable - } - if o.Prices != nil { - structMap["prices"] = o.Prices - } - if o.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = o.UpgradeCharge.Value() - } - if o.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = o.DowngradeCredit.Value() - } - if o.PricePoints != nil { - structMap["price_points"] = o.PricePoints - } - if o.UnitPrice != nil { - structMap["unit_price"] = o.UnitPrice - } - if o.TaxCode != nil { - structMap["tax_code"] = o.TaxCode - } - if o.HideDateRangeOnInvoice != nil { - structMap["hide_date_range_on_invoice"] = o.HideDateRangeOnInvoice - } - if o.PriceInCents != nil { - structMap["price_in_cents"] = o.PriceInCents - } - if o.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = o.DisplayOnHostedPage - } - if o.AllowFractionalQuantities != nil { - structMap["allow_fractional_quantities"] = o.AllowFractionalQuantities - } - if o.PublicSignupPageIds != nil { - structMap["public_signup_page_ids"] = o.PublicSignupPageIds - } - if o.Interval != nil { - structMap["interval"] = o.Interval - } - if o.IntervalUnit != nil { - structMap["interval_unit"] = o.IntervalUnit - } - return structMap + structMap := make(map[string]any) + structMap["name"] = o.Name + if o.Description != nil { + structMap["description"] = o.Description + } + if o.Handle != nil { + structMap["handle"] = o.Handle + } + if o.Taxable != nil { + structMap["taxable"] = o.Taxable + } + if o.Prices != nil { + structMap["prices"] = o.Prices + } + if o.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = o.UpgradeCharge.Value() + } + if o.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = o.DowngradeCredit.Value() + } + if o.PricePoints != nil { + structMap["price_points"] = o.PricePoints + } + if o.UnitPrice != nil { + structMap["unit_price"] = o.UnitPrice + } + if o.TaxCode != nil { + structMap["tax_code"] = o.TaxCode + } + if o.HideDateRangeOnInvoice != nil { + structMap["hide_date_range_on_invoice"] = o.HideDateRangeOnInvoice + } + if o.PriceInCents != nil { + structMap["price_in_cents"] = o.PriceInCents + } + if o.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = o.DisplayOnHostedPage + } + if o.AllowFractionalQuantities != nil { + structMap["allow_fractional_quantities"] = o.AllowFractionalQuantities + } + if o.PublicSignupPageIds != nil { + structMap["public_signup_page_ids"] = o.PublicSignupPageIds + } + if o.Interval != nil { + structMap["interval"] = o.Interval + } + if o.IntervalUnit != nil { + structMap["interval_unit"] = o.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OnOffComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for OnOffComponent. // It customizes the JSON unmarshaling process for OnOffComponent objects. func (o *OnOffComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Handle *string `json:"handle,omitempty"` - Taxable *bool `json:"taxable,omitempty"` - Prices []Price `json:"prices,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - PriceInCents *string `json:"price_in_cents,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Name = temp.Name - o.Description = temp.Description - o.Handle = temp.Handle - o.Taxable = temp.Taxable - o.Prices = temp.Prices - o.UpgradeCharge = temp.UpgradeCharge - o.DowngradeCredit = temp.DowngradeCredit - o.PricePoints = temp.PricePoints - o.UnitPrice = temp.UnitPrice - o.TaxCode = temp.TaxCode - o.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice - o.PriceInCents = temp.PriceInCents - o.DisplayOnHostedPage = temp.DisplayOnHostedPage - o.AllowFractionalQuantities = temp.AllowFractionalQuantities - o.PublicSignupPageIds = temp.PublicSignupPageIds - o.Interval = temp.Interval - o.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Handle *string `json:"handle,omitempty"` + Taxable *bool `json:"taxable,omitempty"` + Prices []Price `json:"prices,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + PriceInCents *string `json:"price_in_cents,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Name = temp.Name + o.Description = temp.Description + o.Handle = temp.Handle + o.Taxable = temp.Taxable + o.Prices = temp.Prices + o.UpgradeCharge = temp.UpgradeCharge + o.DowngradeCredit = temp.DowngradeCredit + o.PricePoints = temp.PricePoints + o.UnitPrice = temp.UnitPrice + o.TaxCode = temp.TaxCode + o.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice + o.PriceInCents = temp.PriceInCents + o.DisplayOnHostedPage = temp.DisplayOnHostedPage + o.AllowFractionalQuantities = temp.AllowFractionalQuantities + o.PublicSignupPageIds = temp.PublicSignupPageIds + o.Interval = temp.Interval + o.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/organization_address.go b/models/organization_address.go index 409d2b13..ecc68f66 100644 --- a/models/organization_address.go +++ b/models/organization_address.go @@ -1,84 +1,84 @@ package models import ( - "encoding/json" + "encoding/json" ) // OrganizationAddress represents a OrganizationAddress struct. type OrganizationAddress struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` - Name Optional[string] `json:"name"` - Phone Optional[string] `json:"phone"` + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` + Name Optional[string] `json:"name"` + Phone Optional[string] `json:"phone"` } -// MarshalJSON implements the json.Marshaler interface for OrganizationAddress. +// MarshalJSON implements the json.Marshaler interface for OrganizationAddress. // It customizes the JSON marshaling process for OrganizationAddress objects. func (o *OrganizationAddress) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OrganizationAddress object to a map representation for JSON marshaling. func (o *OrganizationAddress) toMap() map[string]any { - structMap := make(map[string]any) - if o.Street.IsValueSet() { - structMap["street"] = o.Street.Value() - } - if o.Line2.IsValueSet() { - structMap["line2"] = o.Line2.Value() - } - if o.City.IsValueSet() { - structMap["city"] = o.City.Value() - } - if o.State.IsValueSet() { - structMap["state"] = o.State.Value() - } - if o.Zip.IsValueSet() { - structMap["zip"] = o.Zip.Value() - } - if o.Country.IsValueSet() { - structMap["country"] = o.Country.Value() - } - if o.Name.IsValueSet() { - structMap["name"] = o.Name.Value() - } - if o.Phone.IsValueSet() { - structMap["phone"] = o.Phone.Value() - } - return structMap + structMap := make(map[string]any) + if o.Street.IsValueSet() { + structMap["street"] = o.Street.Value() + } + if o.Line2.IsValueSet() { + structMap["line2"] = o.Line2.Value() + } + if o.City.IsValueSet() { + structMap["city"] = o.City.Value() + } + if o.State.IsValueSet() { + structMap["state"] = o.State.Value() + } + if o.Zip.IsValueSet() { + structMap["zip"] = o.Zip.Value() + } + if o.Country.IsValueSet() { + structMap["country"] = o.Country.Value() + } + if o.Name.IsValueSet() { + structMap["name"] = o.Name.Value() + } + if o.Phone.IsValueSet() { + structMap["phone"] = o.Phone.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OrganizationAddress. +// UnmarshalJSON implements the json.Unmarshaler interface for OrganizationAddress. // It customizes the JSON unmarshaling process for OrganizationAddress objects. func (o *OrganizationAddress) UnmarshalJSON(input []byte) error { - temp := &struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` - Name Optional[string] `json:"name"` - Phone Optional[string] `json:"phone"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Street = temp.Street - o.Line2 = temp.Line2 - o.City = temp.City - o.State = temp.State - o.Zip = temp.Zip - o.Country = temp.Country - o.Name = temp.Name - o.Phone = temp.Phone - return nil + temp := &struct { + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` + Name Optional[string] `json:"name"` + Phone Optional[string] `json:"phone"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Street = temp.Street + o.Line2 = temp.Line2 + o.City = temp.City + o.State = temp.State + o.Zip = temp.Zip + o.Country = temp.Country + o.Name = temp.Name + o.Phone = temp.Phone + return nil } diff --git a/models/origin_invoice.go b/models/origin_invoice.go index 9c9752d2..6a3346e3 100644 --- a/models/origin_invoice.go +++ b/models/origin_invoice.go @@ -1,50 +1,50 @@ package models import ( - "encoding/json" + "encoding/json" ) // OriginInvoice represents a OriginInvoice struct. type OriginInvoice struct { - // The UID of the invoice serving as an origin invoice. - Uid *string `json:"uid,omitempty"` - // The number of the invoice serving as an origin invoice. - Number *string `json:"number,omitempty"` + // The UID of the invoice serving as an origin invoice. + Uid *string `json:"uid,omitempty"` + // The number of the invoice serving as an origin invoice. + Number *string `json:"number,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OriginInvoice. +// MarshalJSON implements the json.Marshaler interface for OriginInvoice. // It customizes the JSON marshaling process for OriginInvoice objects. func (o *OriginInvoice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OriginInvoice object to a map representation for JSON marshaling. func (o *OriginInvoice) toMap() map[string]any { - structMap := make(map[string]any) - if o.Uid != nil { - structMap["uid"] = o.Uid - } - if o.Number != nil { - structMap["number"] = o.Number - } - return structMap + structMap := make(map[string]any) + if o.Uid != nil { + structMap["uid"] = o.Uid + } + if o.Number != nil { + structMap["number"] = o.Number + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OriginInvoice. +// UnmarshalJSON implements the json.Unmarshaler interface for OriginInvoice. // It customizes the JSON unmarshaling process for OriginInvoice objects. func (o *OriginInvoice) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Number *string `json:"number,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Uid = temp.Uid - o.Number = temp.Number - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Number *string `json:"number,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Uid = temp.Uid + o.Number = temp.Number + return nil } diff --git a/models/overage_pricing.go b/models/overage_pricing.go index 91bf2798..3b5c8032 100644 --- a/models/overage_pricing.go +++ b/models/overage_pricing.go @@ -1,47 +1,47 @@ package models import ( - "encoding/json" + "encoding/json" ) // OveragePricing represents a OveragePricing struct. type OveragePricing struct { - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []Price `json:"prices,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []Price `json:"prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OveragePricing. +// MarshalJSON implements the json.Marshaler interface for OveragePricing. // It customizes the JSON marshaling process for OveragePricing objects. func (o *OveragePricing) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OveragePricing object to a map representation for JSON marshaling. func (o *OveragePricing) toMap() map[string]any { - structMap := make(map[string]any) - structMap["pricing_scheme"] = o.PricingScheme - if o.Prices != nil { - structMap["prices"] = o.Prices - } - return structMap + structMap := make(map[string]any) + structMap["pricing_scheme"] = o.PricingScheme + if o.Prices != nil { + structMap["prices"] = o.Prices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OveragePricing. +// UnmarshalJSON implements the json.Unmarshaler interface for OveragePricing. // It customizes the JSON unmarshaling process for OveragePricing objects. func (o *OveragePricing) UnmarshalJSON(input []byte) error { - temp := &struct { - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []Price `json:"prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.PricingScheme = temp.PricingScheme - o.Prices = temp.Prices - return nil + temp := &struct { + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []Price `json:"prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.PricingScheme = temp.PricingScheme + o.Prices = temp.Prices + return nil } diff --git a/models/override_subscription.go b/models/override_subscription.go index 488b4ddb..23861d0c 100644 --- a/models/override_subscription.go +++ b/models/override_subscription.go @@ -1,97 +1,97 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // OverrideSubscription represents a OverrideSubscription struct. type OverrideSubscription struct { - // Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. - ActivatedAt *time.Time `json:"activated_at,omitempty"` - // Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. - CanceledAt *time.Time `json:"canceled_at,omitempty"` - // Can be used to record a reason for the original cancellation. - CancellationMessage *string `json:"cancellation_message,omitempty"` - // 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. - ExpiresAt *time.Time `json:"expires_at,omitempty"` - // 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. - CurrentPeriodStartsAt *time.Time `json:"current_period_starts_at,omitempty"` + // Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. + ActivatedAt *time.Time `json:"activated_at,omitempty"` + // Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. + CanceledAt *time.Time `json:"canceled_at,omitempty"` + // Can be used to record a reason for the original cancellation. + CancellationMessage *string `json:"cancellation_message,omitempty"` + // 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. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // 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. + CurrentPeriodStartsAt *time.Time `json:"current_period_starts_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for OverrideSubscription. +// MarshalJSON implements the json.Marshaler interface for OverrideSubscription. // It customizes the JSON marshaling process for OverrideSubscription objects. func (o *OverrideSubscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OverrideSubscription object to a map representation for JSON marshaling. func (o *OverrideSubscription) toMap() map[string]any { - structMap := make(map[string]any) - if o.ActivatedAt != nil { - structMap["activated_at"] = o.ActivatedAt.Format(time.RFC3339) - } - if o.CanceledAt != nil { - structMap["canceled_at"] = o.CanceledAt.Format(time.RFC3339) - } - if o.CancellationMessage != nil { - structMap["cancellation_message"] = o.CancellationMessage - } - if o.ExpiresAt != nil { - structMap["expires_at"] = o.ExpiresAt.Format(time.RFC3339) - } - if o.CurrentPeriodStartsAt != nil { - structMap["current_period_starts_at"] = o.CurrentPeriodStartsAt.Format(time.RFC3339) - } - return structMap + structMap := make(map[string]any) + if o.ActivatedAt != nil { + structMap["activated_at"] = o.ActivatedAt.Format(time.RFC3339) + } + if o.CanceledAt != nil { + structMap["canceled_at"] = o.CanceledAt.Format(time.RFC3339) + } + if o.CancellationMessage != nil { + structMap["cancellation_message"] = o.CancellationMessage + } + if o.ExpiresAt != nil { + structMap["expires_at"] = o.ExpiresAt.Format(time.RFC3339) + } + if o.CurrentPeriodStartsAt != nil { + structMap["current_period_starts_at"] = o.CurrentPeriodStartsAt.Format(time.RFC3339) + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscription. +// UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscription. // It customizes the JSON unmarshaling process for OverrideSubscription objects. func (o *OverrideSubscription) UnmarshalJSON(input []byte) error { - temp := &struct { - ActivatedAt *string `json:"activated_at,omitempty"` - CanceledAt *string `json:"canceled_at,omitempty"` - CancellationMessage *string `json:"cancellation_message,omitempty"` - ExpiresAt *string `json:"expires_at,omitempty"` - CurrentPeriodStartsAt *string `json:"current_period_starts_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - if temp.ActivatedAt != nil { - ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) - if err != nil { - log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) - } - o.ActivatedAt = &ActivatedAtVal - } - if temp.CanceledAt != nil { - CanceledAtVal, err := time.Parse(time.RFC3339, *temp.CanceledAt) - if err != nil { - log.Fatalf("Cannot Parse canceled_at as % s format.", time.RFC3339) - } - o.CanceledAt = &CanceledAtVal - } - o.CancellationMessage = temp.CancellationMessage - if temp.ExpiresAt != nil { - ExpiresAtVal, err := time.Parse(time.RFC3339, *temp.ExpiresAt) - if err != nil { - log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) - } - o.ExpiresAt = &ExpiresAtVal - } - if temp.CurrentPeriodStartsAt != nil { - CurrentPeriodStartsAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodStartsAt) - if err != nil { - log.Fatalf("Cannot Parse current_period_starts_at as % s format.", time.RFC3339) - } - o.CurrentPeriodStartsAt = &CurrentPeriodStartsAtVal - } - return nil + temp := &struct { + ActivatedAt *string `json:"activated_at,omitempty"` + CanceledAt *string `json:"canceled_at,omitempty"` + CancellationMessage *string `json:"cancellation_message,omitempty"` + ExpiresAt *string `json:"expires_at,omitempty"` + CurrentPeriodStartsAt *string `json:"current_period_starts_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + if temp.ActivatedAt != nil { + ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) + if err != nil { + log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) + } + o.ActivatedAt = &ActivatedAtVal + } + if temp.CanceledAt != nil { + CanceledAtVal, err := time.Parse(time.RFC3339, *temp.CanceledAt) + if err != nil { + log.Fatalf("Cannot Parse canceled_at as % s format.", time.RFC3339) + } + o.CanceledAt = &CanceledAtVal + } + o.CancellationMessage = temp.CancellationMessage + if temp.ExpiresAt != nil { + ExpiresAtVal, err := time.Parse(time.RFC3339, *temp.ExpiresAt) + if err != nil { + log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) + } + o.ExpiresAt = &ExpiresAtVal + } + if temp.CurrentPeriodStartsAt != nil { + CurrentPeriodStartsAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodStartsAt) + if err != nil { + log.Fatalf("Cannot Parse current_period_starts_at as % s format.", time.RFC3339) + } + o.CurrentPeriodStartsAt = &CurrentPeriodStartsAtVal + } + return nil } diff --git a/models/override_subscription_request.go b/models/override_subscription_request.go index 123a8aae..f38bf34b 100644 --- a/models/override_subscription_request.go +++ b/models/override_subscription_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // OverrideSubscriptionRequest represents a OverrideSubscriptionRequest struct. type OverrideSubscriptionRequest struct { - Subscription OverrideSubscription `json:"subscription"` + Subscription OverrideSubscription `json:"subscription"` } -// MarshalJSON implements the json.Marshaler interface for OverrideSubscriptionRequest. +// MarshalJSON implements the json.Marshaler interface for OverrideSubscriptionRequest. // It customizes the JSON marshaling process for OverrideSubscriptionRequest objects. func (o *OverrideSubscriptionRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(o.toMap()) + []byte, + error) { + return json.Marshal(o.toMap()) } // toMap converts the OverrideSubscriptionRequest object to a map representation for JSON marshaling. func (o *OverrideSubscriptionRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription"] = o.Subscription - return structMap + structMap := make(map[string]any) + structMap["subscription"] = o.Subscription.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscriptionRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscriptionRequest. // It customizes the JSON unmarshaling process for OverrideSubscriptionRequest objects. func (o *OverrideSubscriptionRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscription OverrideSubscription `json:"subscription"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - o.Subscription = temp.Subscription - return nil + temp := &struct { + Subscription OverrideSubscription `json:"subscription"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + o.Subscription = temp.Subscription + return nil } diff --git a/models/paginated_metadata.go b/models/paginated_metadata.go index 04b779fa..c61969d3 100644 --- a/models/paginated_metadata.go +++ b/models/paginated_metadata.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // PaginatedMetadata represents a PaginatedMetadata struct. type PaginatedMetadata struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` - Metadata []Metadata `json:"metadata,omitempty"` + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` + Metadata []Metadata `json:"metadata,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PaginatedMetadata. +// MarshalJSON implements the json.Marshaler interface for PaginatedMetadata. // It customizes the JSON marshaling process for PaginatedMetadata objects. func (p *PaginatedMetadata) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PaginatedMetadata object to a map representation for JSON marshaling. func (p *PaginatedMetadata) toMap() map[string]any { - structMap := make(map[string]any) - if p.TotalCount != nil { - structMap["total_count"] = p.TotalCount - } - if p.CurrentPage != nil { - structMap["current_page"] = p.CurrentPage - } - if p.TotalPages != nil { - structMap["total_pages"] = p.TotalPages - } - if p.PerPage != nil { - structMap["per_page"] = p.PerPage - } - if p.Metadata != nil { - structMap["metadata"] = p.Metadata - } - return structMap + structMap := make(map[string]any) + if p.TotalCount != nil { + structMap["total_count"] = p.TotalCount + } + if p.CurrentPage != nil { + structMap["current_page"] = p.CurrentPage + } + if p.TotalPages != nil { + structMap["total_pages"] = p.TotalPages + } + if p.PerPage != nil { + structMap["per_page"] = p.PerPage + } + if p.Metadata != nil { + structMap["metadata"] = p.Metadata + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PaginatedMetadata. +// UnmarshalJSON implements the json.Unmarshaler interface for PaginatedMetadata. // It customizes the JSON unmarshaling process for PaginatedMetadata objects. func (p *PaginatedMetadata) UnmarshalJSON(input []byte) error { - temp := &struct { - TotalCount *int `json:"total_count,omitempty"` - CurrentPage *int `json:"current_page,omitempty"` - TotalPages *int `json:"total_pages,omitempty"` - PerPage *int `json:"per_page,omitempty"` - Metadata []Metadata `json:"metadata,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.TotalCount = temp.TotalCount - p.CurrentPage = temp.CurrentPage - p.TotalPages = temp.TotalPages - p.PerPage = temp.PerPage - p.Metadata = temp.Metadata - return nil + temp := &struct { + TotalCount *int `json:"total_count,omitempty"` + CurrentPage *int `json:"current_page,omitempty"` + TotalPages *int `json:"total_pages,omitempty"` + PerPage *int `json:"per_page,omitempty"` + Metadata []Metadata `json:"metadata,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.TotalCount = temp.TotalCount + p.CurrentPage = temp.CurrentPage + p.TotalPages = temp.TotalPages + p.PerPage = temp.PerPage + p.Metadata = temp.Metadata + return nil } diff --git a/models/pause_request.go b/models/pause_request.go index 016618b1..883aa1e4 100644 --- a/models/pause_request.go +++ b/models/pause_request.go @@ -1,43 +1,43 @@ package models import ( - "encoding/json" + "encoding/json" ) -// PauseRequest represents a PauseRequest struct. +// PauseRequest represents a PauseRequest struct. // Allows to pause a Subscription type PauseRequest struct { - Hold *AutoResume `json:"hold,omitempty"` + Hold *AutoResume `json:"hold,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PauseRequest. +// MarshalJSON implements the json.Marshaler interface for PauseRequest. // It customizes the JSON marshaling process for PauseRequest objects. func (p *PauseRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PauseRequest object to a map representation for JSON marshaling. func (p *PauseRequest) toMap() map[string]any { - structMap := make(map[string]any) - if p.Hold != nil { - structMap["hold"] = p.Hold - } - return structMap + structMap := make(map[string]any) + if p.Hold != nil { + structMap["hold"] = p.Hold.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PauseRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for PauseRequest. // It customizes the JSON unmarshaling process for PauseRequest objects. func (p *PauseRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Hold *AutoResume `json:"hold,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Hold = temp.Hold - return nil + temp := &struct { + Hold *AutoResume `json:"hold,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Hold = temp.Hold + return nil } diff --git a/models/payer_attributes.go b/models/payer_attributes.go index 21a5b526..4a2830cb 100644 --- a/models/payer_attributes.go +++ b/models/payer_attributes.go @@ -1,145 +1,145 @@ package models import ( - "encoding/json" + "encoding/json" ) // PayerAttributes represents a PayerAttributes struct. type PayerAttributes struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails *string `json:"cc_emails,omitempty"` - Organization *string `json:"organization,omitempty"` - Reference *string `json:"reference,omitempty"` - Address *string `json:"address,omitempty"` - Address2 *string `json:"address_2,omitempty"` - City *string `json:"city,omitempty"` - State *string `json:"state,omitempty"` - Zip *string `json:"zip,omitempty"` - Country *string `json:"country,omitempty"` - Phone *string `json:"phone,omitempty"` - Locale *string `json:"locale,omitempty"` - VatNumber *string `json:"vat_number,omitempty"` - TaxExempt *string `json:"tax_exempt,omitempty"` - TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` - // (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. - Metafields map[string]string `json:"metafields,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails *string `json:"cc_emails,omitempty"` + Organization *string `json:"organization,omitempty"` + Reference *string `json:"reference,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address_2,omitempty"` + City *string `json:"city,omitempty"` + State *string `json:"state,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Phone *string `json:"phone,omitempty"` + Locale *string `json:"locale,omitempty"` + VatNumber *string `json:"vat_number,omitempty"` + TaxExempt *string `json:"tax_exempt,omitempty"` + TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` + // (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. + Metafields map[string]string `json:"metafields,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PayerAttributes. +// MarshalJSON implements the json.Marshaler interface for PayerAttributes. // It customizes the JSON marshaling process for PayerAttributes objects. func (p *PayerAttributes) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PayerAttributes object to a map representation for JSON marshaling. func (p *PayerAttributes) toMap() map[string]any { - structMap := make(map[string]any) - if p.FirstName != nil { - structMap["first_name"] = p.FirstName - } - if p.LastName != nil { - structMap["last_name"] = p.LastName - } - if p.Email != nil { - structMap["email"] = p.Email - } - if p.CcEmails != nil { - structMap["cc_emails"] = p.CcEmails - } - if p.Organization != nil { - structMap["organization"] = p.Organization - } - if p.Reference != nil { - structMap["reference"] = p.Reference - } - if p.Address != nil { - structMap["address"] = p.Address - } - if p.Address2 != nil { - structMap["address_2"] = p.Address2 - } - if p.City != nil { - structMap["city"] = p.City - } - if p.State != nil { - structMap["state"] = p.State - } - if p.Zip != nil { - structMap["zip"] = p.Zip - } - if p.Country != nil { - structMap["country"] = p.Country - } - if p.Phone != nil { - structMap["phone"] = p.Phone - } - if p.Locale != nil { - structMap["locale"] = p.Locale - } - if p.VatNumber != nil { - structMap["vat_number"] = p.VatNumber - } - if p.TaxExempt != nil { - structMap["tax_exempt"] = p.TaxExempt - } - if p.TaxExemptReason != nil { - structMap["tax_exempt_reason"] = p.TaxExemptReason - } - if p.Metafields != nil { - structMap["metafields"] = p.Metafields - } - return structMap + structMap := make(map[string]any) + if p.FirstName != nil { + structMap["first_name"] = p.FirstName + } + if p.LastName != nil { + structMap["last_name"] = p.LastName + } + if p.Email != nil { + structMap["email"] = p.Email + } + if p.CcEmails != nil { + structMap["cc_emails"] = p.CcEmails + } + if p.Organization != nil { + structMap["organization"] = p.Organization + } + if p.Reference != nil { + structMap["reference"] = p.Reference + } + if p.Address != nil { + structMap["address"] = p.Address + } + if p.Address2 != nil { + structMap["address_2"] = p.Address2 + } + if p.City != nil { + structMap["city"] = p.City + } + if p.State != nil { + structMap["state"] = p.State + } + if p.Zip != nil { + structMap["zip"] = p.Zip + } + if p.Country != nil { + structMap["country"] = p.Country + } + if p.Phone != nil { + structMap["phone"] = p.Phone + } + if p.Locale != nil { + structMap["locale"] = p.Locale + } + if p.VatNumber != nil { + structMap["vat_number"] = p.VatNumber + } + if p.TaxExempt != nil { + structMap["tax_exempt"] = p.TaxExempt + } + if p.TaxExemptReason != nil { + structMap["tax_exempt_reason"] = p.TaxExemptReason + } + if p.Metafields != nil { + structMap["metafields"] = p.Metafields + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PayerAttributes. +// UnmarshalJSON implements the json.Unmarshaler interface for PayerAttributes. // It customizes the JSON unmarshaling process for PayerAttributes objects. func (p *PayerAttributes) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails *string `json:"cc_emails,omitempty"` - Organization *string `json:"organization,omitempty"` - Reference *string `json:"reference,omitempty"` - Address *string `json:"address,omitempty"` - Address2 *string `json:"address_2,omitempty"` - City *string `json:"city,omitempty"` - State *string `json:"state,omitempty"` - Zip *string `json:"zip,omitempty"` - Country *string `json:"country,omitempty"` - Phone *string `json:"phone,omitempty"` - Locale *string `json:"locale,omitempty"` - VatNumber *string `json:"vat_number,omitempty"` - TaxExempt *string `json:"tax_exempt,omitempty"` - TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` - Metafields map[string]string `json:"metafields,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.FirstName = temp.FirstName - p.LastName = temp.LastName - p.Email = temp.Email - p.CcEmails = temp.CcEmails - p.Organization = temp.Organization - p.Reference = temp.Reference - p.Address = temp.Address - p.Address2 = temp.Address2 - p.City = temp.City - p.State = temp.State - p.Zip = temp.Zip - p.Country = temp.Country - p.Phone = temp.Phone - p.Locale = temp.Locale - p.VatNumber = temp.VatNumber - p.TaxExempt = temp.TaxExempt - p.TaxExemptReason = temp.TaxExemptReason - p.Metafields = temp.Metafields - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails *string `json:"cc_emails,omitempty"` + Organization *string `json:"organization,omitempty"` + Reference *string `json:"reference,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address_2,omitempty"` + City *string `json:"city,omitempty"` + State *string `json:"state,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Phone *string `json:"phone,omitempty"` + Locale *string `json:"locale,omitempty"` + VatNumber *string `json:"vat_number,omitempty"` + TaxExempt *string `json:"tax_exempt,omitempty"` + TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` + Metafields map[string]string `json:"metafields,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.FirstName = temp.FirstName + p.LastName = temp.LastName + p.Email = temp.Email + p.CcEmails = temp.CcEmails + p.Organization = temp.Organization + p.Reference = temp.Reference + p.Address = temp.Address + p.Address2 = temp.Address2 + p.City = temp.City + p.State = temp.State + p.Zip = temp.Zip + p.Country = temp.Country + p.Phone = temp.Phone + p.Locale = temp.Locale + p.VatNumber = temp.VatNumber + p.TaxExempt = temp.TaxExempt + p.TaxExemptReason = temp.TaxExemptReason + p.Metafields = temp.Metafields + return nil } diff --git a/models/payer_error.go b/models/payer_error.go index 6d362c95..8bf6455b 100644 --- a/models/payer_error.go +++ b/models/payer_error.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // PayerError represents a PayerError struct. type PayerError struct { - LastName []string `json:"last_name,omitempty"` - FirstName []string `json:"first_name,omitempty"` - Email []string `json:"email,omitempty"` + LastName []string `json:"last_name,omitempty"` + FirstName []string `json:"first_name,omitempty"` + Email []string `json:"email,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PayerError. +// MarshalJSON implements the json.Marshaler interface for PayerError. // It customizes the JSON marshaling process for PayerError objects. func (p *PayerError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PayerError object to a map representation for JSON marshaling. func (p *PayerError) toMap() map[string]any { - structMap := make(map[string]any) - if p.LastName != nil { - structMap["last_name"] = p.LastName - } - if p.FirstName != nil { - structMap["first_name"] = p.FirstName - } - if p.Email != nil { - structMap["email"] = p.Email - } - return structMap + structMap := make(map[string]any) + if p.LastName != nil { + structMap["last_name"] = p.LastName + } + if p.FirstName != nil { + structMap["first_name"] = p.FirstName + } + if p.Email != nil { + structMap["email"] = p.Email + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PayerError. +// UnmarshalJSON implements the json.Unmarshaler interface for PayerError. // It customizes the JSON unmarshaling process for PayerError objects. func (p *PayerError) UnmarshalJSON(input []byte) error { - temp := &struct { - LastName []string `json:"last_name,omitempty"` - FirstName []string `json:"first_name,omitempty"` - Email []string `json:"email,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.LastName = temp.LastName - p.FirstName = temp.FirstName - p.Email = temp.Email - return nil + temp := &struct { + LastName []string `json:"last_name,omitempty"` + FirstName []string `json:"first_name,omitempty"` + Email []string `json:"email,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.LastName = temp.LastName + p.FirstName = temp.FirstName + p.Email = temp.Email + return nil } diff --git a/models/payment.go b/models/payment.go index 52b3d3a8..3e3e4249 100644 --- a/models/payment.go +++ b/models/payment.go @@ -1,64 +1,64 @@ package models import ( - "encoding/json" + "encoding/json" ) // Payment represents a Payment struct. type Payment struct { - // The uid of the paid invoice - InvoiceUid *string `json:"invoice_uid,omitempty"` - // The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. - Status *InvoiceStatus `json:"status,omitempty"` - // The remaining due amount on the invoice - DueAmount *string `json:"due_amount,omitempty"` - // The total amount paid on this invoice (including any prior payments) - PaidAmount *string `json:"paid_amount,omitempty"` + // The uid of the paid invoice + InvoiceUid *string `json:"invoice_uid,omitempty"` + // The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. + Status *InvoiceStatus `json:"status,omitempty"` + // The remaining due amount on the invoice + DueAmount *string `json:"due_amount,omitempty"` + // The total amount paid on this invoice (including any prior payments) + PaidAmount *string `json:"paid_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Payment. +// MarshalJSON implements the json.Marshaler interface for Payment. // It customizes the JSON marshaling process for Payment objects. func (p *Payment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the Payment object to a map representation for JSON marshaling. func (p *Payment) toMap() map[string]any { - structMap := make(map[string]any) - if p.InvoiceUid != nil { - structMap["invoice_uid"] = p.InvoiceUid - } - if p.Status != nil { - structMap["status"] = p.Status - } - if p.DueAmount != nil { - structMap["due_amount"] = p.DueAmount - } - if p.PaidAmount != nil { - structMap["paid_amount"] = p.PaidAmount - } - return structMap + structMap := make(map[string]any) + if p.InvoiceUid != nil { + structMap["invoice_uid"] = p.InvoiceUid + } + if p.Status != nil { + structMap["status"] = p.Status + } + if p.DueAmount != nil { + structMap["due_amount"] = p.DueAmount + } + if p.PaidAmount != nil { + structMap["paid_amount"] = p.PaidAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Payment. +// UnmarshalJSON implements the json.Unmarshaler interface for Payment. // It customizes the JSON unmarshaling process for Payment objects. func (p *Payment) UnmarshalJSON(input []byte) error { - temp := &struct { - InvoiceUid *string `json:"invoice_uid,omitempty"` - Status *InvoiceStatus `json:"status,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.InvoiceUid = temp.InvoiceUid - p.Status = temp.Status - p.DueAmount = temp.DueAmount - p.PaidAmount = temp.PaidAmount - return nil + temp := &struct { + InvoiceUid *string `json:"invoice_uid,omitempty"` + Status *InvoiceStatus `json:"status,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.InvoiceUid = temp.InvoiceUid + p.Status = temp.Status + p.DueAmount = temp.DueAmount + p.PaidAmount = temp.PaidAmount + return nil } diff --git a/models/payment_for_allocation.go b/models/payment_for_allocation.go index 298708a6..7d049c0e 100644 --- a/models/payment_for_allocation.go +++ b/models/payment_for_allocation.go @@ -1,61 +1,61 @@ package models import ( - "encoding/json" + "encoding/json" ) -// PaymentForAllocation represents a PaymentForAllocation struct. +// PaymentForAllocation represents a PaymentForAllocation struct. // Information for captured payment, if applicable type PaymentForAllocation struct { - Id *int `json:"id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Success *bool `json:"success,omitempty"` - Memo *string `json:"memo,omitempty"` + Id *int `json:"id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Success *bool `json:"success,omitempty"` + Memo *string `json:"memo,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PaymentForAllocation. +// MarshalJSON implements the json.Marshaler interface for PaymentForAllocation. // It customizes the JSON marshaling process for PaymentForAllocation objects. func (p *PaymentForAllocation) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PaymentForAllocation object to a map representation for JSON marshaling. func (p *PaymentForAllocation) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.AmountInCents != nil { - structMap["amount_in_cents"] = p.AmountInCents - } - if p.Success != nil { - structMap["success"] = p.Success - } - if p.Memo != nil { - structMap["memo"] = p.Memo - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.AmountInCents != nil { + structMap["amount_in_cents"] = p.AmountInCents + } + if p.Success != nil { + structMap["success"] = p.Success + } + if p.Memo != nil { + structMap["memo"] = p.Memo + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PaymentForAllocation. +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentForAllocation. // It customizes the JSON unmarshaling process for PaymentForAllocation objects. func (p *PaymentForAllocation) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Success *bool `json:"success,omitempty"` - Memo *string `json:"memo,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.AmountInCents = temp.AmountInCents - p.Success = temp.Success - p.Memo = temp.Memo - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Success *bool `json:"success,omitempty"` + Memo *string `json:"memo,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.AmountInCents = temp.AmountInCents + p.Success = temp.Success + p.Memo = temp.Memo + return nil } diff --git a/models/payment_method_apple_pay.go b/models/payment_method_apple_pay.go new file mode 100644 index 00000000..3062b36f --- /dev/null +++ b/models/payment_method_apple_pay.go @@ -0,0 +1,40 @@ +package models + +import ( + "encoding/json" +) + +// PaymentMethodApplePay represents a PaymentMethodApplePay struct. +type PaymentMethodApplePay struct { + Type InvoiceEventPaymentMethod `json:"type"` +} + +// MarshalJSON implements the json.Marshaler interface for PaymentMethodApplePay. +// It customizes the JSON marshaling process for PaymentMethodApplePay objects. +func (p *PaymentMethodApplePay) MarshalJSON() ( + []byte, + error) { + return json.Marshal(p.toMap()) +} + +// toMap converts the PaymentMethodApplePay object to a map representation for JSON marshaling. +func (p *PaymentMethodApplePay) toMap() map[string]any { + structMap := make(map[string]any) + structMap["type"] = p.Type + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodApplePay. +// It customizes the JSON unmarshaling process for PaymentMethodApplePay objects. +func (p *PaymentMethodApplePay) UnmarshalJSON(input []byte) error { + temp := &struct { + Type InvoiceEventPaymentMethod `json:"type"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Type = temp.Type + return nil +} diff --git a/models/payment_method_bank_account.go b/models/payment_method_bank_account.go new file mode 100644 index 00000000..3a9d783a --- /dev/null +++ b/models/payment_method_bank_account.go @@ -0,0 +1,48 @@ +package models + +import ( + "encoding/json" +) + +// PaymentMethodBankAccount represents a PaymentMethodBankAccount struct. +type PaymentMethodBankAccount struct { + MaskedAccountNumber string `json:"masked_account_number"` + MaskedRoutingNumber string `json:"masked_routing_number"` + Type InvoiceEventPaymentMethod `json:"type"` +} + +// MarshalJSON implements the json.Marshaler interface for PaymentMethodBankAccount. +// It customizes the JSON marshaling process for PaymentMethodBankAccount objects. +func (p *PaymentMethodBankAccount) MarshalJSON() ( + []byte, + error) { + return json.Marshal(p.toMap()) +} + +// toMap converts the PaymentMethodBankAccount object to a map representation for JSON marshaling. +func (p *PaymentMethodBankAccount) toMap() map[string]any { + structMap := make(map[string]any) + structMap["masked_account_number"] = p.MaskedAccountNumber + structMap["masked_routing_number"] = p.MaskedRoutingNumber + structMap["type"] = p.Type + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodBankAccount. +// It customizes the JSON unmarshaling process for PaymentMethodBankAccount objects. +func (p *PaymentMethodBankAccount) UnmarshalJSON(input []byte) error { + temp := &struct { + MaskedAccountNumber string `json:"masked_account_number"` + MaskedRoutingNumber string `json:"masked_routing_number"` + Type InvoiceEventPaymentMethod `json:"type"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.MaskedAccountNumber = temp.MaskedAccountNumber + p.MaskedRoutingNumber = temp.MaskedRoutingNumber + p.Type = temp.Type + return nil +} diff --git a/models/payment_method_credit_card.go b/models/payment_method_credit_card.go new file mode 100644 index 00000000..9998a267 --- /dev/null +++ b/models/payment_method_credit_card.go @@ -0,0 +1,60 @@ +package models + +import ( + "encoding/json" +) + +// PaymentMethodCreditCard represents a PaymentMethodCreditCard struct. +type PaymentMethodCreditCard struct { + CardBrand string `json:"card_brand"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber string `json:"masked_card_number"` + Type InvoiceEventPaymentMethod `json:"type"` +} + +// MarshalJSON implements the json.Marshaler interface for PaymentMethodCreditCard. +// It customizes the JSON marshaling process for PaymentMethodCreditCard objects. +func (p *PaymentMethodCreditCard) MarshalJSON() ( + []byte, + error) { + return json.Marshal(p.toMap()) +} + +// toMap converts the PaymentMethodCreditCard object to a map representation for JSON marshaling. +func (p *PaymentMethodCreditCard) toMap() map[string]any { + structMap := make(map[string]any) + structMap["card_brand"] = p.CardBrand + if p.CardExpiration != nil { + structMap["card_expiration"] = p.CardExpiration + } + if p.LastFour.IsValueSet() { + structMap["last_four"] = p.LastFour.Value() + } + structMap["masked_card_number"] = p.MaskedCardNumber + structMap["type"] = p.Type + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodCreditCard. +// It customizes the JSON unmarshaling process for PaymentMethodCreditCard objects. +func (p *PaymentMethodCreditCard) UnmarshalJSON(input []byte) error { + temp := &struct { + CardBrand string `json:"card_brand"` + CardExpiration *string `json:"card_expiration,omitempty"` + LastFour Optional[string] `json:"last_four"` + MaskedCardNumber string `json:"masked_card_number"` + Type InvoiceEventPaymentMethod `json:"type"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.CardBrand = temp.CardBrand + p.CardExpiration = temp.CardExpiration + p.LastFour = temp.LastFour + p.MaskedCardNumber = temp.MaskedCardNumber + p.Type = temp.Type + return nil +} diff --git a/models/payment_method_external.go b/models/payment_method_external.go new file mode 100644 index 00000000..8859bc58 --- /dev/null +++ b/models/payment_method_external.go @@ -0,0 +1,52 @@ +package models + +import ( + "encoding/json" +) + +// PaymentMethodExternal represents a PaymentMethodExternal struct. +type PaymentMethodExternal struct { + Details *string `json:"details"` + Kind string `json:"kind"` + Memo *string `json:"memo"` + Type InvoiceEventPaymentMethod `json:"type"` +} + +// MarshalJSON implements the json.Marshaler interface for PaymentMethodExternal. +// It customizes the JSON marshaling process for PaymentMethodExternal objects. +func (p *PaymentMethodExternal) MarshalJSON() ( + []byte, + error) { + return json.Marshal(p.toMap()) +} + +// toMap converts the PaymentMethodExternal object to a map representation for JSON marshaling. +func (p *PaymentMethodExternal) toMap() map[string]any { + structMap := make(map[string]any) + structMap["details"] = p.Details + structMap["kind"] = p.Kind + structMap["memo"] = p.Memo + structMap["type"] = p.Type + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodExternal. +// It customizes the JSON unmarshaling process for PaymentMethodExternal objects. +func (p *PaymentMethodExternal) UnmarshalJSON(input []byte) error { + temp := &struct { + Details *string `json:"details"` + Kind string `json:"kind"` + Memo *string `json:"memo"` + Type InvoiceEventPaymentMethod `json:"type"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Details = temp.Details + p.Kind = temp.Kind + p.Memo = temp.Memo + p.Type = temp.Type + return nil +} diff --git a/models/payment_method_nested_data.go b/models/payment_method_nested_data.go deleted file mode 100644 index 78810e21..00000000 --- a/models/payment_method_nested_data.go +++ /dev/null @@ -1,103 +0,0 @@ -package models - -import ( - "encoding/json" -) - -// PaymentMethodNestedData represents a PaymentMethodNestedData struct. -// A nested data structure detailing the method of payment -type PaymentMethodNestedData struct { - Type *string `json:"type,omitempty"` - MaskedAccountNumber *string `json:"masked_account_number,omitempty"` - MaskedRoutingNumber *string `json:"masked_routing_number,omitempty"` - CardBrand *string `json:"card_brand,omitempty"` - CardExpiration *string `json:"card_expiration,omitempty"` - LastFour Optional[string] `json:"last_four"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - Details *string `json:"details,omitempty"` - Kind *string `json:"kind,omitempty"` - Memo *string `json:"memo,omitempty"` - Email *string `json:"email,omitempty"` -} - -// MarshalJSON implements the json.Marshaler interface for PaymentMethodNestedData. -// It customizes the JSON marshaling process for PaymentMethodNestedData objects. -func (p *PaymentMethodNestedData) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) -} - -// toMap converts the PaymentMethodNestedData object to a map representation for JSON marshaling. -func (p *PaymentMethodNestedData) toMap() map[string]any { - structMap := make(map[string]any) - if p.Type != nil { - structMap["type"] = p.Type - } - if p.MaskedAccountNumber != nil { - structMap["masked_account_number"] = p.MaskedAccountNumber - } - if p.MaskedRoutingNumber != nil { - structMap["masked_routing_number"] = p.MaskedRoutingNumber - } - if p.CardBrand != nil { - structMap["card_brand"] = p.CardBrand - } - if p.CardExpiration != nil { - structMap["card_expiration"] = p.CardExpiration - } - if p.LastFour.IsValueSet() { - structMap["last_four"] = p.LastFour.Value() - } - if p.MaskedCardNumber != nil { - structMap["masked_card_number"] = p.MaskedCardNumber - } - if p.Details != nil { - structMap["details"] = p.Details - } - if p.Kind != nil { - structMap["kind"] = p.Kind - } - if p.Memo != nil { - structMap["memo"] = p.Memo - } - if p.Email != nil { - structMap["email"] = p.Email - } - return structMap -} - -// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodNestedData. -// It customizes the JSON unmarshaling process for PaymentMethodNestedData objects. -func (p *PaymentMethodNestedData) UnmarshalJSON(input []byte) error { - temp := &struct { - Type *string `json:"type,omitempty"` - MaskedAccountNumber *string `json:"masked_account_number,omitempty"` - MaskedRoutingNumber *string `json:"masked_routing_number,omitempty"` - CardBrand *string `json:"card_brand,omitempty"` - CardExpiration *string `json:"card_expiration,omitempty"` - LastFour Optional[string] `json:"last_four"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - Details *string `json:"details,omitempty"` - Kind *string `json:"kind,omitempty"` - Memo *string `json:"memo,omitempty"` - Email *string `json:"email,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Type = temp.Type - p.MaskedAccountNumber = temp.MaskedAccountNumber - p.MaskedRoutingNumber = temp.MaskedRoutingNumber - p.CardBrand = temp.CardBrand - p.CardExpiration = temp.CardExpiration - p.LastFour = temp.LastFour - p.MaskedCardNumber = temp.MaskedCardNumber - p.Details = temp.Details - p.Kind = temp.Kind - p.Memo = temp.Memo - p.Email = temp.Email - return nil -} diff --git a/models/payment_method_paypal.go b/models/payment_method_paypal.go new file mode 100644 index 00000000..fd62b709 --- /dev/null +++ b/models/payment_method_paypal.go @@ -0,0 +1,44 @@ +package models + +import ( + "encoding/json" +) + +// PaymentMethodPaypal represents a PaymentMethodPaypal struct. +type PaymentMethodPaypal struct { + Email string `json:"email"` + Type InvoiceEventPaymentMethod `json:"type"` +} + +// MarshalJSON implements the json.Marshaler interface for PaymentMethodPaypal. +// It customizes the JSON marshaling process for PaymentMethodPaypal objects. +func (p *PaymentMethodPaypal) MarshalJSON() ( + []byte, + error) { + return json.Marshal(p.toMap()) +} + +// toMap converts the PaymentMethodPaypal object to a map representation for JSON marshaling. +func (p *PaymentMethodPaypal) toMap() map[string]any { + structMap := make(map[string]any) + structMap["email"] = p.Email + structMap["type"] = p.Type + return structMap +} + +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodPaypal. +// It customizes the JSON unmarshaling process for PaymentMethodPaypal objects. +func (p *PaymentMethodPaypal) UnmarshalJSON(input []byte) error { + temp := &struct { + Email string `json:"email"` + Type InvoiceEventPaymentMethod `json:"type"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Email = temp.Email + p.Type = temp.Type + return nil +} diff --git a/models/payment_profile_attributes.go b/models/payment_profile_attributes.go index 6ce267ad..034b57e4 100644 --- a/models/payment_profile_attributes.go +++ b/models/payment_profile_attributes.go @@ -1,207 +1,207 @@ package models import ( - "encoding/json" + "encoding/json" ) -// PaymentProfileAttributes represents a PaymentProfileAttributes struct. +// PaymentProfileAttributes represents a PaymentProfileAttributes struct. // alias to credit_card_attributes type PaymentProfileAttributes struct { - // (Optional) Token received after sending billing informations using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) - ChargifyToken *string `json:"chargify_token,omitempty"` - Id *int `json:"id,omitempty"` - PaymentType *string `json:"payment_type,omitempty"` - // (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. - FirstName *string `json:"first_name,omitempty"` - // (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - // The full credit card number (string representation, i.e. 5424000000000015) - FullNumber *string `json:"full_number,omitempty"` - // (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. - CardType *CardType `json:"card_type,omitempty"` - // (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 - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - // (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 - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - // (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. - BillingAddress *string `json:"billing_address,omitempty"` - // (Optional) Second line of the customer’s billing address i.e. Apt. 100 - BillingAddress2 Optional[string] `json:"billing_address_2"` - // (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. - BillingCity *string `json:"billing_city,omitempty"` - // (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. - BillingState *string `json:"billing_state,omitempty"` - // (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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. - BillingCountry *string `json:"billing_country,omitempty"` - // (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. - BillingZip *string `json:"billing_zip,omitempty"` - // (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - // (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile - VaultToken *string `json:"vault_token,omitempty"` - // (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 - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaypalEmail *string `json:"paypal_email,omitempty"` - // (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) - PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` - // (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. - GatewayHandle *string `json:"gateway_handle,omitempty"` - // (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. - Cvv *string `json:"cvv,omitempty"` - // (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. - LastFour *string `json:"last_four,omitempty"` + // (Optional) Token received after sending billing informations using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + ChargifyToken *string `json:"chargify_token,omitempty"` + Id *int `json:"id,omitempty"` + PaymentType *string `json:"payment_type,omitempty"` + // (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. + FirstName *string `json:"first_name,omitempty"` + // (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + // The full credit card number (string representation, i.e. 5424000000000015) + FullNumber *string `json:"full_number,omitempty"` + // (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. + CardType *CardType `json:"card_type,omitempty"` + // (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 + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + // (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 + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + // (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. + BillingAddress *string `json:"billing_address,omitempty"` + // (Optional) Second line of the customer’s billing address i.e. Apt. 100 + BillingAddress2 Optional[string] `json:"billing_address_2"` + // (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. + BillingCity *string `json:"billing_city,omitempty"` + // (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. + BillingState *string `json:"billing_state,omitempty"` + // (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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. + BillingCountry *string `json:"billing_country,omitempty"` + // (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. + BillingZip *string `json:"billing_zip,omitempty"` + // (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + // (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile + VaultToken *string `json:"vault_token,omitempty"` + // (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 + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaypalEmail *string `json:"paypal_email,omitempty"` + // (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) + PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` + // (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. + GatewayHandle *string `json:"gateway_handle,omitempty"` + // (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. + Cvv *string `json:"cvv,omitempty"` + // (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. + LastFour *string `json:"last_four,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PaymentProfileAttributes. +// MarshalJSON implements the json.Marshaler interface for PaymentProfileAttributes. // It customizes the JSON marshaling process for PaymentProfileAttributes objects. func (p *PaymentProfileAttributes) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PaymentProfileAttributes object to a map representation for JSON marshaling. func (p *PaymentProfileAttributes) toMap() map[string]any { - structMap := make(map[string]any) - if p.ChargifyToken != nil { - structMap["chargify_token"] = p.ChargifyToken - } - if p.Id != nil { - structMap["id"] = p.Id - } - if p.PaymentType != nil { - structMap["payment_type"] = p.PaymentType - } - if p.FirstName != nil { - structMap["first_name"] = p.FirstName - } - if p.LastName != nil { - structMap["last_name"] = p.LastName - } - if p.MaskedCardNumber != nil { - structMap["masked_card_number"] = p.MaskedCardNumber - } - if p.FullNumber != nil { - structMap["full_number"] = p.FullNumber - } - if p.CardType != nil { - structMap["card_type"] = p.CardType - } - if p.ExpirationMonth != nil { - structMap["expiration_month"] = p.ExpirationMonth - } - if p.ExpirationYear != nil { - structMap["expiration_year"] = p.ExpirationYear - } - if p.BillingAddress != nil { - structMap["billing_address"] = p.BillingAddress - } - if p.BillingAddress2.IsValueSet() { - structMap["billing_address_2"] = p.BillingAddress2.Value() - } - if p.BillingCity != nil { - structMap["billing_city"] = p.BillingCity - } - if p.BillingState != nil { - structMap["billing_state"] = p.BillingState - } - if p.BillingCountry != nil { - structMap["billing_country"] = p.BillingCountry - } - if p.BillingZip != nil { - structMap["billing_zip"] = p.BillingZip - } - if p.CurrentVault != nil { - structMap["current_vault"] = p.CurrentVault - } - if p.VaultToken != nil { - structMap["vault_token"] = p.VaultToken - } - if p.CustomerVaultToken != nil { - structMap["customer_vault_token"] = p.CustomerVaultToken - } - if p.CustomerId != nil { - structMap["customer_id"] = p.CustomerId - } - if p.PaypalEmail != nil { - structMap["paypal_email"] = p.PaypalEmail - } - if p.PaymentMethodNonce != nil { - structMap["payment_method_nonce"] = p.PaymentMethodNonce - } - if p.GatewayHandle != nil { - structMap["gateway_handle"] = p.GatewayHandle - } - if p.Cvv != nil { - structMap["cvv"] = p.Cvv - } - if p.LastFour != nil { - structMap["last_four"] = p.LastFour - } - return structMap + structMap := make(map[string]any) + if p.ChargifyToken != nil { + structMap["chargify_token"] = p.ChargifyToken + } + if p.Id != nil { + structMap["id"] = p.Id + } + if p.PaymentType != nil { + structMap["payment_type"] = p.PaymentType + } + if p.FirstName != nil { + structMap["first_name"] = p.FirstName + } + if p.LastName != nil { + structMap["last_name"] = p.LastName + } + if p.MaskedCardNumber != nil { + structMap["masked_card_number"] = p.MaskedCardNumber + } + if p.FullNumber != nil { + structMap["full_number"] = p.FullNumber + } + if p.CardType != nil { + structMap["card_type"] = p.CardType + } + if p.ExpirationMonth != nil { + structMap["expiration_month"] = p.ExpirationMonth + } + if p.ExpirationYear != nil { + structMap["expiration_year"] = p.ExpirationYear + } + if p.BillingAddress != nil { + structMap["billing_address"] = p.BillingAddress + } + if p.BillingAddress2.IsValueSet() { + structMap["billing_address_2"] = p.BillingAddress2.Value() + } + if p.BillingCity != nil { + structMap["billing_city"] = p.BillingCity + } + if p.BillingState != nil { + structMap["billing_state"] = p.BillingState + } + if p.BillingCountry != nil { + structMap["billing_country"] = p.BillingCountry + } + if p.BillingZip != nil { + structMap["billing_zip"] = p.BillingZip + } + if p.CurrentVault != nil { + structMap["current_vault"] = p.CurrentVault + } + if p.VaultToken != nil { + structMap["vault_token"] = p.VaultToken + } + if p.CustomerVaultToken != nil { + structMap["customer_vault_token"] = p.CustomerVaultToken + } + if p.CustomerId != nil { + structMap["customer_id"] = p.CustomerId + } + if p.PaypalEmail != nil { + structMap["paypal_email"] = p.PaypalEmail + } + if p.PaymentMethodNonce != nil { + structMap["payment_method_nonce"] = p.PaymentMethodNonce + } + if p.GatewayHandle != nil { + structMap["gateway_handle"] = p.GatewayHandle + } + if p.Cvv != nil { + structMap["cvv"] = p.Cvv + } + if p.LastFour != nil { + structMap["last_four"] = p.LastFour + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileAttributes. +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileAttributes. // It customizes the JSON unmarshaling process for PaymentProfileAttributes objects. func (p *PaymentProfileAttributes) UnmarshalJSON(input []byte) error { - temp := &struct { - ChargifyToken *string `json:"chargify_token,omitempty"` - Id *int `json:"id,omitempty"` - PaymentType *string `json:"payment_type,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - FullNumber *string `json:"full_number,omitempty"` - CardType *CardType `json:"card_type,omitempty"` - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingAddress2 Optional[string] `json:"billing_address_2"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - VaultToken *string `json:"vault_token,omitempty"` - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaypalEmail *string `json:"paypal_email,omitempty"` - PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` - Cvv *string `json:"cvv,omitempty"` - LastFour *string `json:"last_four,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.ChargifyToken = temp.ChargifyToken - p.Id = temp.Id - p.PaymentType = temp.PaymentType - p.FirstName = temp.FirstName - p.LastName = temp.LastName - p.MaskedCardNumber = temp.MaskedCardNumber - p.FullNumber = temp.FullNumber - p.CardType = temp.CardType - p.ExpirationMonth = temp.ExpirationMonth - p.ExpirationYear = temp.ExpirationYear - p.BillingAddress = temp.BillingAddress - p.BillingAddress2 = temp.BillingAddress2 - p.BillingCity = temp.BillingCity - p.BillingState = temp.BillingState - p.BillingCountry = temp.BillingCountry - p.BillingZip = temp.BillingZip - p.CurrentVault = temp.CurrentVault - p.VaultToken = temp.VaultToken - p.CustomerVaultToken = temp.CustomerVaultToken - p.CustomerId = temp.CustomerId - p.PaypalEmail = temp.PaypalEmail - p.PaymentMethodNonce = temp.PaymentMethodNonce - p.GatewayHandle = temp.GatewayHandle - p.Cvv = temp.Cvv - p.LastFour = temp.LastFour - return nil + temp := &struct { + ChargifyToken *string `json:"chargify_token,omitempty"` + Id *int `json:"id,omitempty"` + PaymentType *string `json:"payment_type,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + FullNumber *string `json:"full_number,omitempty"` + CardType *CardType `json:"card_type,omitempty"` + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingAddress2 Optional[string] `json:"billing_address_2"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + VaultToken *string `json:"vault_token,omitempty"` + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaypalEmail *string `json:"paypal_email,omitempty"` + PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` + Cvv *string `json:"cvv,omitempty"` + LastFour *string `json:"last_four,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.ChargifyToken = temp.ChargifyToken + p.Id = temp.Id + p.PaymentType = temp.PaymentType + p.FirstName = temp.FirstName + p.LastName = temp.LastName + p.MaskedCardNumber = temp.MaskedCardNumber + p.FullNumber = temp.FullNumber + p.CardType = temp.CardType + p.ExpirationMonth = temp.ExpirationMonth + p.ExpirationYear = temp.ExpirationYear + p.BillingAddress = temp.BillingAddress + p.BillingAddress2 = temp.BillingAddress2 + p.BillingCity = temp.BillingCity + p.BillingState = temp.BillingState + p.BillingCountry = temp.BillingCountry + p.BillingZip = temp.BillingZip + p.CurrentVault = temp.CurrentVault + p.VaultToken = temp.VaultToken + p.CustomerVaultToken = temp.CustomerVaultToken + p.CustomerId = temp.CustomerId + p.PaypalEmail = temp.PaypalEmail + p.PaymentMethodNonce = temp.PaymentMethodNonce + p.GatewayHandle = temp.GatewayHandle + p.Cvv = temp.Cvv + p.LastFour = temp.LastFour + return nil } diff --git a/models/payment_profile_response.go b/models/payment_profile_response.go index e8185b00..910e903d 100644 --- a/models/payment_profile_response.go +++ b/models/payment_profile_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // PaymentProfileResponse represents a PaymentProfileResponse struct. type PaymentProfileResponse struct { - PaymentProfile interface{} `json:"payment_profile"` + PaymentProfile interface{} `json:"payment_profile"` } -// MarshalJSON implements the json.Marshaler interface for PaymentProfileResponse. +// MarshalJSON implements the json.Marshaler interface for PaymentProfileResponse. // It customizes the JSON marshaling process for PaymentProfileResponse objects. func (p *PaymentProfileResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PaymentProfileResponse object to a map representation for JSON marshaling. func (p *PaymentProfileResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment_profile"] = p.PaymentProfile - return structMap + structMap := make(map[string]any) + structMap["payment_profile"] = p.PaymentProfile + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileResponse. // It customizes the JSON unmarshaling process for PaymentProfileResponse objects. func (p *PaymentProfileResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PaymentProfile interface{} `json:"payment_profile"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PaymentProfile = temp.PaymentProfile - return nil + temp := &struct { + PaymentProfile interface{} `json:"payment_profile"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PaymentProfile = temp.PaymentProfile + return nil } diff --git a/models/payment_response.go b/models/payment_response.go index f9c24a91..66f0bc73 100644 --- a/models/payment_response.go +++ b/models/payment_response.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // PaymentResponse represents a PaymentResponse struct. type PaymentResponse struct { - PaidInvoices []Payment `json:"paid_invoices,omitempty"` - Prepayment *InvoicePrePayment `json:"prepayment,omitempty"` + PaidInvoices []Payment `json:"paid_invoices,omitempty"` + Prepayment *InvoicePrePayment `json:"prepayment,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PaymentResponse. +// MarshalJSON implements the json.Marshaler interface for PaymentResponse. // It customizes the JSON marshaling process for PaymentResponse objects. func (p *PaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PaymentResponse object to a map representation for JSON marshaling. func (p *PaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - if p.PaidInvoices != nil { - structMap["paid_invoices"] = p.PaidInvoices - } - if p.Prepayment != nil { - structMap["prepayment"] = p.Prepayment - } - return structMap + structMap := make(map[string]any) + if p.PaidInvoices != nil { + structMap["paid_invoices"] = p.PaidInvoices + } + if p.Prepayment != nil { + structMap["prepayment"] = p.Prepayment.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for PaymentResponse. // It customizes the JSON unmarshaling process for PaymentResponse objects. func (p *PaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PaidInvoices []Payment `json:"paid_invoices,omitempty"` - Prepayment *InvoicePrePayment `json:"prepayment,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PaidInvoices = temp.PaidInvoices - p.Prepayment = temp.Prepayment - return nil + temp := &struct { + PaidInvoices []Payment `json:"paid_invoices,omitempty"` + Prepayment *InvoicePrePayment `json:"prepayment,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PaidInvoices = temp.PaidInvoices + p.Prepayment = temp.Prepayment + return nil } diff --git a/models/portal_management_link.go b/models/portal_management_link.go index ad85b698..0bfcdcb3 100644 --- a/models/portal_management_link.go +++ b/models/portal_management_link.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // PortalManagementLink represents a PortalManagementLink struct. type PortalManagementLink struct { - Url *string `json:"url,omitempty"` - FetchCount *int `json:"fetch_count,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - NewLinkAvailableAt *string `json:"new_link_available_at,omitempty"` - ExpiresAt *string `json:"expires_at,omitempty"` - LastInviteSentAt Optional[string] `json:"last_invite_sent_at"` + Url *string `json:"url,omitempty"` + FetchCount *int `json:"fetch_count,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + NewLinkAvailableAt *string `json:"new_link_available_at,omitempty"` + ExpiresAt *string `json:"expires_at,omitempty"` + LastInviteSentAt Optional[string] `json:"last_invite_sent_at"` } -// MarshalJSON implements the json.Marshaler interface for PortalManagementLink. +// MarshalJSON implements the json.Marshaler interface for PortalManagementLink. // It customizes the JSON marshaling process for PortalManagementLink objects. func (p *PortalManagementLink) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PortalManagementLink object to a map representation for JSON marshaling. func (p *PortalManagementLink) toMap() map[string]any { - structMap := make(map[string]any) - if p.Url != nil { - structMap["url"] = p.Url - } - if p.FetchCount != nil { - structMap["fetch_count"] = p.FetchCount - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt - } - if p.NewLinkAvailableAt != nil { - structMap["new_link_available_at"] = p.NewLinkAvailableAt - } - if p.ExpiresAt != nil { - structMap["expires_at"] = p.ExpiresAt - } - if p.LastInviteSentAt.IsValueSet() { - structMap["last_invite_sent_at"] = p.LastInviteSentAt.Value() - } - return structMap + structMap := make(map[string]any) + if p.Url != nil { + structMap["url"] = p.Url + } + if p.FetchCount != nil { + structMap["fetch_count"] = p.FetchCount + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt + } + if p.NewLinkAvailableAt != nil { + structMap["new_link_available_at"] = p.NewLinkAvailableAt + } + if p.ExpiresAt != nil { + structMap["expires_at"] = p.ExpiresAt + } + if p.LastInviteSentAt.IsValueSet() { + structMap["last_invite_sent_at"] = p.LastInviteSentAt.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PortalManagementLink. +// UnmarshalJSON implements the json.Unmarshaler interface for PortalManagementLink. // It customizes the JSON unmarshaling process for PortalManagementLink objects. func (p *PortalManagementLink) UnmarshalJSON(input []byte) error { - temp := &struct { - Url *string `json:"url,omitempty"` - FetchCount *int `json:"fetch_count,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - NewLinkAvailableAt *string `json:"new_link_available_at,omitempty"` - ExpiresAt *string `json:"expires_at,omitempty"` - LastInviteSentAt Optional[string] `json:"last_invite_sent_at"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Url = temp.Url - p.FetchCount = temp.FetchCount - p.CreatedAt = temp.CreatedAt - p.NewLinkAvailableAt = temp.NewLinkAvailableAt - p.ExpiresAt = temp.ExpiresAt - p.LastInviteSentAt = temp.LastInviteSentAt - return nil + temp := &struct { + Url *string `json:"url,omitempty"` + FetchCount *int `json:"fetch_count,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + NewLinkAvailableAt *string `json:"new_link_available_at,omitempty"` + ExpiresAt *string `json:"expires_at,omitempty"` + LastInviteSentAt Optional[string] `json:"last_invite_sent_at"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Url = temp.Url + p.FetchCount = temp.FetchCount + p.CreatedAt = temp.CreatedAt + p.NewLinkAvailableAt = temp.NewLinkAvailableAt + p.ExpiresAt = temp.ExpiresAt + p.LastInviteSentAt = temp.LastInviteSentAt + return nil } diff --git a/models/prepaid_component_price_point.go b/models/prepaid_component_price_point.go index 80512e9a..59532c00 100644 --- a/models/prepaid_component_price_point.go +++ b/models/prepaid_component_price_point.go @@ -1,67 +1,67 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaidComponentPricePoint represents a PrepaidComponentPricePoint struct. type PrepaidComponentPricePoint struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PrepaidComponentPricePoint. +// MarshalJSON implements the json.Marshaler interface for PrepaidComponentPricePoint. // It customizes the JSON marshaling process for PrepaidComponentPricePoint objects. func (p *PrepaidComponentPricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaidComponentPricePoint object to a map representation for JSON marshaling. func (p *PrepaidComponentPricePoint) toMap() map[string]any { - structMap := make(map[string]any) - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Handle != nil { - structMap["handle"] = p.Handle - } - if p.PricingScheme != nil { - structMap["pricing_scheme"] = p.PricingScheme - } - if p.Prices != nil { - structMap["prices"] = p.Prices - } - if p.OveragePricing != nil { - structMap["overage_pricing"] = p.OveragePricing - } - return structMap + structMap := make(map[string]any) + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Handle != nil { + structMap["handle"] = p.Handle + } + if p.PricingScheme != nil { + structMap["pricing_scheme"] = p.PricingScheme + } + if p.Prices != nil { + structMap["prices"] = p.Prices + } + if p.OveragePricing != nil { + structMap["overage_pricing"] = p.OveragePricing.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidComponentPricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidComponentPricePoint. // It customizes the JSON unmarshaling process for PrepaidComponentPricePoint objects. func (p *PrepaidComponentPricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Name = temp.Name - p.Handle = temp.Handle - p.PricingScheme = temp.PricingScheme - p.Prices = temp.Prices - p.OveragePricing = temp.OveragePricing - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Name = temp.Name + p.Handle = temp.Handle + p.PricingScheme = temp.PricingScheme + p.Prices = temp.Prices + p.OveragePricing = temp.OveragePricing + return nil } diff --git a/models/prepaid_configuration.go b/models/prepaid_configuration.go index d061bf99..757233da 100644 --- a/models/prepaid_configuration.go +++ b/models/prepaid_configuration.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaidConfiguration represents a PrepaidConfiguration struct. type PrepaidConfiguration struct { - Id *int `json:"id,omitempty"` - InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` - ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` - AutoReplenish *bool `json:"auto_replenish,omitempty"` - ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` + Id *int `json:"id,omitempty"` + InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` + ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` + AutoReplenish *bool `json:"auto_replenish,omitempty"` + ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PrepaidConfiguration. +// MarshalJSON implements the json.Marshaler interface for PrepaidConfiguration. // It customizes the JSON marshaling process for PrepaidConfiguration objects. func (p *PrepaidConfiguration) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaidConfiguration object to a map representation for JSON marshaling. func (p *PrepaidConfiguration) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.InitialFundingAmountInCents != nil { - structMap["initial_funding_amount_in_cents"] = p.InitialFundingAmountInCents - } - if p.ReplenishToAmountInCents != nil { - structMap["replenish_to_amount_in_cents"] = p.ReplenishToAmountInCents - } - if p.AutoReplenish != nil { - structMap["auto_replenish"] = p.AutoReplenish - } - if p.ReplenishThresholdAmountInCents != nil { - structMap["replenish_threshold_amount_in_cents"] = p.ReplenishThresholdAmountInCents - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.InitialFundingAmountInCents != nil { + structMap["initial_funding_amount_in_cents"] = p.InitialFundingAmountInCents + } + if p.ReplenishToAmountInCents != nil { + structMap["replenish_to_amount_in_cents"] = p.ReplenishToAmountInCents + } + if p.AutoReplenish != nil { + structMap["auto_replenish"] = p.AutoReplenish + } + if p.ReplenishThresholdAmountInCents != nil { + structMap["replenish_threshold_amount_in_cents"] = p.ReplenishThresholdAmountInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfiguration. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfiguration. // It customizes the JSON unmarshaling process for PrepaidConfiguration objects. func (p *PrepaidConfiguration) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` - ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` - AutoReplenish *bool `json:"auto_replenish,omitempty"` - ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.InitialFundingAmountInCents = temp.InitialFundingAmountInCents - p.ReplenishToAmountInCents = temp.ReplenishToAmountInCents - p.AutoReplenish = temp.AutoReplenish - p.ReplenishThresholdAmountInCents = temp.ReplenishThresholdAmountInCents - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` + ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` + AutoReplenish *bool `json:"auto_replenish,omitempty"` + ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.InitialFundingAmountInCents = temp.InitialFundingAmountInCents + p.ReplenishToAmountInCents = temp.ReplenishToAmountInCents + p.AutoReplenish = temp.AutoReplenish + p.ReplenishThresholdAmountInCents = temp.ReplenishThresholdAmountInCents + return nil } diff --git a/models/prepaid_configuration_response.go b/models/prepaid_configuration_response.go index 73ae4fb1..92dd6637 100644 --- a/models/prepaid_configuration_response.go +++ b/models/prepaid_configuration_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaidConfigurationResponse represents a PrepaidConfigurationResponse struct. type PrepaidConfigurationResponse struct { - PrepaidConfiguration PrepaidConfiguration `json:"prepaid_configuration"` + PrepaidConfiguration PrepaidConfiguration `json:"prepaid_configuration"` } -// MarshalJSON implements the json.Marshaler interface for PrepaidConfigurationResponse. +// MarshalJSON implements the json.Marshaler interface for PrepaidConfigurationResponse. // It customizes the JSON marshaling process for PrepaidConfigurationResponse objects. func (p *PrepaidConfigurationResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaidConfigurationResponse object to a map representation for JSON marshaling. func (p *PrepaidConfigurationResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepaid_configuration"] = p.PrepaidConfiguration - return structMap + structMap := make(map[string]any) + structMap["prepaid_configuration"] = p.PrepaidConfiguration.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfigurationResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfigurationResponse. // It customizes the JSON unmarshaling process for PrepaidConfigurationResponse objects. func (p *PrepaidConfigurationResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PrepaidConfiguration PrepaidConfiguration `json:"prepaid_configuration"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PrepaidConfiguration = temp.PrepaidConfiguration - return nil + temp := &struct { + PrepaidConfiguration PrepaidConfiguration `json:"prepaid_configuration"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PrepaidConfiguration = temp.PrepaidConfiguration + return nil } diff --git a/models/prepaid_usage_component.go b/models/prepaid_usage_component.go index 55d1f5ed..4e4d2846 100644 --- a/models/prepaid_usage_component.go +++ b/models/prepaid_usage_component.go @@ -1,184 +1,184 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaidUsageComponent represents a PrepaidUsageComponent struct. type PrepaidUsageComponent struct { - // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". - Name string `json:"name"` - // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item - UnitName *string `json:"unit_name,omitempty"` - // A description for the component that will be displayed to the user on the hosted signup page. - Description *string `json:"description,omitempty"` - // 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 '_'. - Handle *string `json:"handle,omitempty"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. - Prices []Price `json:"prices,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []PrepaidComponentPricePoint `json:"price_points,omitempty"` - // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice *interface{} `json:"unit_price,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` - // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - // deprecated May 2011 - use unit_price instead - PriceInCents *string `json:"price_in_cents,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` - // Boolean which controls whether or not remaining units should be rolled over to the next period - RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` - // Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period - RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` - // (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire - ExpirationInterval *float64 `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". + Name string `json:"name"` + // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item + UnitName *string `json:"unit_name,omitempty"` + // A description for the component that will be displayed to the user on the hosted signup page. + Description *string `json:"description,omitempty"` + // 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 '_'. + Handle *string `json:"handle,omitempty"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. + Prices []Price `json:"prices,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []PrepaidComponentPricePoint `json:"price_points,omitempty"` + // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice *interface{} `json:"unit_price,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` + // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + // deprecated May 2011 - use unit_price instead + PriceInCents *string `json:"price_in_cents,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + // Boolean which controls whether or not remaining units should be rolled over to the next period + RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` + // Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period + RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` + // (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire + ExpirationInterval *float64 `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PrepaidUsageComponent. +// MarshalJSON implements the json.Marshaler interface for PrepaidUsageComponent. // It customizes the JSON marshaling process for PrepaidUsageComponent objects. func (p *PrepaidUsageComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaidUsageComponent object to a map representation for JSON marshaling. func (p *PrepaidUsageComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = p.Name - if p.UnitName != nil { - structMap["unit_name"] = p.UnitName - } - if p.Description != nil { - structMap["description"] = p.Description - } - if p.Handle != nil { - structMap["handle"] = p.Handle - } - if p.Taxable != nil { - structMap["taxable"] = p.Taxable - } - if p.PricingScheme != nil { - structMap["pricing_scheme"] = p.PricingScheme - } - if p.Prices != nil { - structMap["prices"] = p.Prices - } - if p.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = p.UpgradeCharge.Value() - } - if p.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = p.DowngradeCredit.Value() - } - if p.PricePoints != nil { - structMap["price_points"] = p.PricePoints - } - if p.UnitPrice != nil { - structMap["unit_price"] = p.UnitPrice - } - if p.TaxCode != nil { - structMap["tax_code"] = p.TaxCode - } - if p.HideDateRangeOnInvoice != nil { - structMap["hide_date_range_on_invoice"] = p.HideDateRangeOnInvoice - } - if p.PriceInCents != nil { - structMap["price_in_cents"] = p.PriceInCents - } - if p.OveragePricing != nil { - structMap["overage_pricing"] = p.OveragePricing - } - if p.RolloverPrepaidRemainder != nil { - structMap["rollover_prepaid_remainder"] = p.RolloverPrepaidRemainder - } - if p.RenewPrepaidAllocation != nil { - structMap["renew_prepaid_allocation"] = p.RenewPrepaidAllocation - } - if p.ExpirationInterval != nil { - structMap["expiration_interval"] = p.ExpirationInterval - } - if p.ExpirationIntervalUnit != nil { - structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit - } - if p.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = p.DisplayOnHostedPage - } - if p.AllowFractionalQuantities != nil { - structMap["allow_fractional_quantities"] = p.AllowFractionalQuantities - } - if p.PublicSignupPageIds != nil { - structMap["public_signup_page_ids"] = p.PublicSignupPageIds - } - return structMap + structMap := make(map[string]any) + structMap["name"] = p.Name + if p.UnitName != nil { + structMap["unit_name"] = p.UnitName + } + if p.Description != nil { + structMap["description"] = p.Description + } + if p.Handle != nil { + structMap["handle"] = p.Handle + } + if p.Taxable != nil { + structMap["taxable"] = p.Taxable + } + if p.PricingScheme != nil { + structMap["pricing_scheme"] = p.PricingScheme + } + if p.Prices != nil { + structMap["prices"] = p.Prices + } + if p.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = p.UpgradeCharge.Value() + } + if p.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = p.DowngradeCredit.Value() + } + if p.PricePoints != nil { + structMap["price_points"] = p.PricePoints + } + if p.UnitPrice != nil { + structMap["unit_price"] = p.UnitPrice + } + if p.TaxCode != nil { + structMap["tax_code"] = p.TaxCode + } + if p.HideDateRangeOnInvoice != nil { + structMap["hide_date_range_on_invoice"] = p.HideDateRangeOnInvoice + } + if p.PriceInCents != nil { + structMap["price_in_cents"] = p.PriceInCents + } + if p.OveragePricing != nil { + structMap["overage_pricing"] = p.OveragePricing.toMap() + } + if p.RolloverPrepaidRemainder != nil { + structMap["rollover_prepaid_remainder"] = p.RolloverPrepaidRemainder + } + if p.RenewPrepaidAllocation != nil { + structMap["renew_prepaid_allocation"] = p.RenewPrepaidAllocation + } + if p.ExpirationInterval != nil { + structMap["expiration_interval"] = p.ExpirationInterval + } + if p.ExpirationIntervalUnit != nil { + structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit + } + if p.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = p.DisplayOnHostedPage + } + if p.AllowFractionalQuantities != nil { + structMap["allow_fractional_quantities"] = p.AllowFractionalQuantities + } + if p.PublicSignupPageIds != nil { + structMap["public_signup_page_ids"] = p.PublicSignupPageIds + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidUsageComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaidUsageComponent. // It customizes the JSON unmarshaling process for PrepaidUsageComponent objects. func (p *PrepaidUsageComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - UnitName *string `json:"unit_name,omitempty"` - Description *string `json:"description,omitempty"` - Handle *string `json:"handle,omitempty"` - Taxable *bool `json:"taxable,omitempty"` - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []PrepaidComponentPricePoint `json:"price_points,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - PriceInCents *string `json:"price_in_cents,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` - RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` - RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` - ExpirationInterval *float64 `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Name = temp.Name - p.UnitName = temp.UnitName - p.Description = temp.Description - p.Handle = temp.Handle - p.Taxable = temp.Taxable - p.PricingScheme = temp.PricingScheme - p.Prices = temp.Prices - p.UpgradeCharge = temp.UpgradeCharge - p.DowngradeCredit = temp.DowngradeCredit - p.PricePoints = temp.PricePoints - p.UnitPrice = temp.UnitPrice - p.TaxCode = temp.TaxCode - p.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice - p.PriceInCents = temp.PriceInCents - p.OveragePricing = temp.OveragePricing - p.RolloverPrepaidRemainder = temp.RolloverPrepaidRemainder - p.RenewPrepaidAllocation = temp.RenewPrepaidAllocation - p.ExpirationInterval = temp.ExpirationInterval - p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - p.DisplayOnHostedPage = temp.DisplayOnHostedPage - p.AllowFractionalQuantities = temp.AllowFractionalQuantities - p.PublicSignupPageIds = temp.PublicSignupPageIds - return nil + temp := &struct { + Name string `json:"name"` + UnitName *string `json:"unit_name,omitempty"` + Description *string `json:"description,omitempty"` + Handle *string `json:"handle,omitempty"` + Taxable *bool `json:"taxable,omitempty"` + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []PrepaidComponentPricePoint `json:"price_points,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + PriceInCents *string `json:"price_in_cents,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` + RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` + ExpirationInterval *float64 `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Name = temp.Name + p.UnitName = temp.UnitName + p.Description = temp.Description + p.Handle = temp.Handle + p.Taxable = temp.Taxable + p.PricingScheme = temp.PricingScheme + p.Prices = temp.Prices + p.UpgradeCharge = temp.UpgradeCharge + p.DowngradeCredit = temp.DowngradeCredit + p.PricePoints = temp.PricePoints + p.UnitPrice = temp.UnitPrice + p.TaxCode = temp.TaxCode + p.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice + p.PriceInCents = temp.PriceInCents + p.OveragePricing = temp.OveragePricing + p.RolloverPrepaidRemainder = temp.RolloverPrepaidRemainder + p.RenewPrepaidAllocation = temp.RenewPrepaidAllocation + p.ExpirationInterval = temp.ExpirationInterval + p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + p.DisplayOnHostedPage = temp.DisplayOnHostedPage + p.AllowFractionalQuantities = temp.AllowFractionalQuantities + p.PublicSignupPageIds = temp.PublicSignupPageIds + return nil } diff --git a/models/prepayment.go b/models/prepayment.go index 58de537f..28db0000 100644 --- a/models/prepayment.go +++ b/models/prepayment.go @@ -1,83 +1,83 @@ package models import ( - "encoding/json" + "encoding/json" ) // Prepayment represents a Prepayment struct. type Prepayment struct { - Id int `json:"id"` - SubscriptionId int `json:"subscription_id"` - AmountInCents int64 `json:"amount_in_cents"` - RemainingAmountInCents int64 `json:"remaining_amount_in_cents"` - RefundedAmountInCents *int64 `json:"refunded_amount_in_cents,omitempty"` - Details *string `json:"details,omitempty"` - External bool `json:"external"` - Memo string `json:"memo"` - // The payment type of the prepayment. - PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` - CreatedAt string `json:"created_at"` + Id int `json:"id"` + SubscriptionId int `json:"subscription_id"` + AmountInCents int64 `json:"amount_in_cents"` + RemainingAmountInCents int64 `json:"remaining_amount_in_cents"` + RefundedAmountInCents *int64 `json:"refunded_amount_in_cents,omitempty"` + Details *string `json:"details,omitempty"` + External bool `json:"external"` + Memo string `json:"memo"` + // The payment type of the prepayment. + PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` + CreatedAt string `json:"created_at"` } -// MarshalJSON implements the json.Marshaler interface for Prepayment. +// MarshalJSON implements the json.Marshaler interface for Prepayment. // It customizes the JSON marshaling process for Prepayment objects. func (p *Prepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the Prepayment object to a map representation for JSON marshaling. func (p *Prepayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["id"] = p.Id - structMap["subscription_id"] = p.SubscriptionId - structMap["amount_in_cents"] = p.AmountInCents - structMap["remaining_amount_in_cents"] = p.RemainingAmountInCents - if p.RefundedAmountInCents != nil { - structMap["refunded_amount_in_cents"] = p.RefundedAmountInCents - } - if p.Details != nil { - structMap["details"] = p.Details - } - structMap["external"] = p.External - structMap["memo"] = p.Memo - if p.PaymentType != nil { - structMap["payment_type"] = p.PaymentType - } - structMap["created_at"] = p.CreatedAt - return structMap + structMap := make(map[string]any) + structMap["id"] = p.Id + structMap["subscription_id"] = p.SubscriptionId + structMap["amount_in_cents"] = p.AmountInCents + structMap["remaining_amount_in_cents"] = p.RemainingAmountInCents + if p.RefundedAmountInCents != nil { + structMap["refunded_amount_in_cents"] = p.RefundedAmountInCents + } + if p.Details != nil { + structMap["details"] = p.Details + } + structMap["external"] = p.External + structMap["memo"] = p.Memo + if p.PaymentType != nil { + structMap["payment_type"] = p.PaymentType + } + structMap["created_at"] = p.CreatedAt + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Prepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for Prepayment. // It customizes the JSON unmarshaling process for Prepayment objects. func (p *Prepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Id int `json:"id"` - SubscriptionId int `json:"subscription_id"` - AmountInCents int64 `json:"amount_in_cents"` - RemainingAmountInCents int64 `json:"remaining_amount_in_cents"` - RefundedAmountInCents *int64 `json:"refunded_amount_in_cents,omitempty"` - Details *string `json:"details,omitempty"` - External bool `json:"external"` - Memo string `json:"memo"` - PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` - CreatedAt string `json:"created_at"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.SubscriptionId = temp.SubscriptionId - p.AmountInCents = temp.AmountInCents - p.RemainingAmountInCents = temp.RemainingAmountInCents - p.RefundedAmountInCents = temp.RefundedAmountInCents - p.Details = temp.Details - p.External = temp.External - p.Memo = temp.Memo - p.PaymentType = temp.PaymentType - p.CreatedAt = temp.CreatedAt - return nil + temp := &struct { + Id int `json:"id"` + SubscriptionId int `json:"subscription_id"` + AmountInCents int64 `json:"amount_in_cents"` + RemainingAmountInCents int64 `json:"remaining_amount_in_cents"` + RefundedAmountInCents *int64 `json:"refunded_amount_in_cents,omitempty"` + Details *string `json:"details,omitempty"` + External bool `json:"external"` + Memo string `json:"memo"` + PaymentType *PrepaymentMethod `json:"payment_type,omitempty"` + CreatedAt string `json:"created_at"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.SubscriptionId = temp.SubscriptionId + p.AmountInCents = temp.AmountInCents + p.RemainingAmountInCents = temp.RemainingAmountInCents + p.RefundedAmountInCents = temp.RefundedAmountInCents + p.Details = temp.Details + p.External = temp.External + p.Memo = temp.Memo + p.PaymentType = temp.PaymentType + p.CreatedAt = temp.CreatedAt + return nil } diff --git a/models/prepayment_aggregated_error.go b/models/prepayment_aggregated_error.go index 8ffb9133..56a09066 100644 --- a/models/prepayment_aggregated_error.go +++ b/models/prepayment_aggregated_error.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaymentAggregatedError represents a PrepaymentAggregatedError struct. type PrepaymentAggregatedError struct { - AmountInCents []string `json:"amount_in_cents,omitempty"` - Base []string `json:"base,omitempty"` - External []string `json:"external,omitempty"` + AmountInCents []string `json:"amount_in_cents,omitempty"` + Base []string `json:"base,omitempty"` + External []string `json:"external,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PrepaymentAggregatedError. +// MarshalJSON implements the json.Marshaler interface for PrepaymentAggregatedError. // It customizes the JSON marshaling process for PrepaymentAggregatedError objects. func (p *PrepaymentAggregatedError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaymentAggregatedError object to a map representation for JSON marshaling. func (p *PrepaymentAggregatedError) toMap() map[string]any { - structMap := make(map[string]any) - if p.AmountInCents != nil { - structMap["amount_in_cents"] = p.AmountInCents - } - if p.Base != nil { - structMap["base"] = p.Base - } - if p.External != nil { - structMap["external"] = p.External - } - return structMap + structMap := make(map[string]any) + if p.AmountInCents != nil { + structMap["amount_in_cents"] = p.AmountInCents + } + if p.Base != nil { + structMap["base"] = p.Base + } + if p.External != nil { + structMap["external"] = p.External + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentAggregatedError. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentAggregatedError. // It customizes the JSON unmarshaling process for PrepaymentAggregatedError objects. func (p *PrepaymentAggregatedError) UnmarshalJSON(input []byte) error { - temp := &struct { - AmountInCents []string `json:"amount_in_cents,omitempty"` - Base []string `json:"base,omitempty"` - External []string `json:"external,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.AmountInCents = temp.AmountInCents - p.Base = temp.Base - p.External = temp.External - return nil + temp := &struct { + AmountInCents []string `json:"amount_in_cents,omitempty"` + Base []string `json:"base,omitempty"` + External []string `json:"external,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.AmountInCents = temp.AmountInCents + p.Base = temp.Base + p.External = temp.External + return nil } diff --git a/models/prepayment_response.go b/models/prepayment_response.go index 63211159..7a4349c9 100644 --- a/models/prepayment_response.go +++ b/models/prepayment_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaymentResponse represents a PrepaymentResponse struct. type PrepaymentResponse struct { - Prepayment Prepayment `json:"prepayment"` + Prepayment Prepayment `json:"prepayment"` } -// MarshalJSON implements the json.Marshaler interface for PrepaymentResponse. +// MarshalJSON implements the json.Marshaler interface for PrepaymentResponse. // It customizes the JSON marshaling process for PrepaymentResponse objects. func (p *PrepaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaymentResponse object to a map representation for JSON marshaling. func (p *PrepaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayment"] = p.Prepayment - return structMap + structMap := make(map[string]any) + structMap["prepayment"] = p.Prepayment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentResponse. // It customizes the JSON unmarshaling process for PrepaymentResponse objects. func (p *PrepaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayment Prepayment `json:"prepayment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Prepayment = temp.Prepayment - return nil + temp := &struct { + Prepayment Prepayment `json:"prepayment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Prepayment = temp.Prepayment + return nil } diff --git a/models/prepayments_response.go b/models/prepayments_response.go index 1ddcb67f..9e0d219b 100644 --- a/models/prepayments_response.go +++ b/models/prepayments_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // PrepaymentsResponse represents a PrepaymentsResponse struct. type PrepaymentsResponse struct { - Prepayments []Prepayment `json:"prepayments,omitempty"` + Prepayments []Prepayment `json:"prepayments,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PrepaymentsResponse. +// MarshalJSON implements the json.Marshaler interface for PrepaymentsResponse. // It customizes the JSON marshaling process for PrepaymentsResponse objects. func (p *PrepaymentsResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PrepaymentsResponse object to a map representation for JSON marshaling. func (p *PrepaymentsResponse) toMap() map[string]any { - structMap := make(map[string]any) - if p.Prepayments != nil { - structMap["prepayments"] = p.Prepayments - } - return structMap + structMap := make(map[string]any) + if p.Prepayments != nil { + structMap["prepayments"] = p.Prepayments + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentsResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentsResponse. // It customizes the JSON unmarshaling process for PrepaymentsResponse objects. func (p *PrepaymentsResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayments []Prepayment `json:"prepayments,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Prepayments = temp.Prepayments - return nil + temp := &struct { + Prepayments []Prepayment `json:"prepayments,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Prepayments = temp.Prepayments + return nil } diff --git a/models/preview_allocations_request.go b/models/preview_allocations_request.go index c4198f24..7770a312 100644 --- a/models/preview_allocations_request.go +++ b/models/preview_allocations_request.go @@ -1,71 +1,71 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // PreviewAllocationsRequest represents a PreviewAllocationsRequest struct. type PreviewAllocationsRequest struct { - Allocations []CreateAllocation `json:"allocations"` - // To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. - EffectiveProrationDate *time.Time `json:"effective_proration_date,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + Allocations []CreateAllocation `json:"allocations"` + // To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported. + EffectiveProrationDate *time.Time `json:"effective_proration_date,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` } -// MarshalJSON implements the json.Marshaler interface for PreviewAllocationsRequest. +// MarshalJSON implements the json.Marshaler interface for PreviewAllocationsRequest. // It customizes the JSON marshaling process for PreviewAllocationsRequest objects. func (p *PreviewAllocationsRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PreviewAllocationsRequest object to a map representation for JSON marshaling. func (p *PreviewAllocationsRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["allocations"] = p.Allocations - if p.EffectiveProrationDate != nil { - structMap["effective_proration_date"] = p.EffectiveProrationDate.Format(DEFAULT_DATE) - } - if p.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = p.UpgradeCharge.Value() - } - if p.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = p.DowngradeCredit.Value() - } - return structMap + structMap := make(map[string]any) + structMap["allocations"] = p.Allocations + if p.EffectiveProrationDate != nil { + structMap["effective_proration_date"] = p.EffectiveProrationDate.Format(DEFAULT_DATE) + } + if p.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = p.UpgradeCharge.Value() + } + if p.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = p.DowngradeCredit.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PreviewAllocationsRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for PreviewAllocationsRequest. // It customizes the JSON unmarshaling process for PreviewAllocationsRequest objects. func (p *PreviewAllocationsRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Allocations []CreateAllocation `json:"allocations"` - EffectiveProrationDate *string `json:"effective_proration_date,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Allocations = temp.Allocations - if temp.EffectiveProrationDate != nil { - EffectiveProrationDateVal, err := time.Parse(DEFAULT_DATE, *temp.EffectiveProrationDate) - if err != nil { - log.Fatalf("Cannot Parse effective_proration_date as % s format.", DEFAULT_DATE) - } - p.EffectiveProrationDate = &EffectiveProrationDateVal - } - p.UpgradeCharge = temp.UpgradeCharge - p.DowngradeCredit = temp.DowngradeCredit - return nil + temp := &struct { + Allocations []CreateAllocation `json:"allocations"` + EffectiveProrationDate *string `json:"effective_proration_date,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Allocations = temp.Allocations + if temp.EffectiveProrationDate != nil { + EffectiveProrationDateVal, err := time.Parse(DEFAULT_DATE, *temp.EffectiveProrationDate) + if err != nil { + log.Fatalf("Cannot Parse effective_proration_date as % s format.", DEFAULT_DATE) + } + p.EffectiveProrationDate = &EffectiveProrationDateVal + } + p.UpgradeCharge = temp.UpgradeCharge + p.DowngradeCredit = temp.DowngradeCredit + return nil } diff --git a/models/price.go b/models/price.go index 4e8bc36b..e6387e16 100644 --- a/models/price.go +++ b/models/price.go @@ -1,51 +1,51 @@ package models import ( - "encoding/json" + "encoding/json" ) // Price represents a Price struct. type Price struct { - StartingQuantity interface{} `json:"starting_quantity"` - EndingQuantity Optional[interface{}] `json:"ending_quantity"` - // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice interface{} `json:"unit_price"` + StartingQuantity interface{} `json:"starting_quantity"` + EndingQuantity Optional[interface{}] `json:"ending_quantity"` + // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice interface{} `json:"unit_price"` } -// MarshalJSON implements the json.Marshaler interface for Price. +// MarshalJSON implements the json.Marshaler interface for Price. // It customizes the JSON marshaling process for Price objects. func (p *Price) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the Price object to a map representation for JSON marshaling. func (p *Price) toMap() map[string]any { - structMap := make(map[string]any) - structMap["starting_quantity"] = p.StartingQuantity - if p.EndingQuantity.IsValueSet() { - structMap["ending_quantity"] = p.EndingQuantity.Value() - } - structMap["unit_price"] = p.UnitPrice - return structMap + structMap := make(map[string]any) + structMap["starting_quantity"] = p.StartingQuantity + if p.EndingQuantity.IsValueSet() { + structMap["ending_quantity"] = p.EndingQuantity.Value() + } + structMap["unit_price"] = p.UnitPrice + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Price. +// UnmarshalJSON implements the json.Unmarshaler interface for Price. // It customizes the JSON unmarshaling process for Price objects. func (p *Price) UnmarshalJSON(input []byte) error { - temp := &struct { - StartingQuantity interface{} `json:"starting_quantity"` - EndingQuantity Optional[interface{}] `json:"ending_quantity"` - UnitPrice interface{} `json:"unit_price"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.StartingQuantity = temp.StartingQuantity - p.EndingQuantity = temp.EndingQuantity - p.UnitPrice = temp.UnitPrice - return nil + temp := &struct { + StartingQuantity interface{} `json:"starting_quantity"` + EndingQuantity Optional[interface{}] `json:"ending_quantity"` + UnitPrice interface{} `json:"unit_price"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.StartingQuantity = temp.StartingQuantity + p.EndingQuantity = temp.EndingQuantity + p.UnitPrice = temp.UnitPrice + return nil } diff --git a/models/price_point.go b/models/price_point.go index 60976b4d..d4145545 100644 --- a/models/price_point.go +++ b/models/price_point.go @@ -1,122 +1,122 @@ package models import ( - "encoding/json" + "encoding/json" ) // PricePoint represents a PricePoint struct. type PricePoint struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - // 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. - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - // Whether or not the price point includes tax - TaxIncluded *bool `json:"tax_included,omitempty"` - // 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 `json:"interval,omitempty"` - // A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` - // Boolean which controls whether or not remaining units should be rolled over to the next period - RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` - // Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period - RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` - // (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire - ExpirationInterval *float64 `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + // 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. + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + // Whether or not the price point includes tax + TaxIncluded *bool `json:"tax_included,omitempty"` + // 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 `json:"interval,omitempty"` + // A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + // Boolean which controls whether or not remaining units should be rolled over to the next period + RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` + // Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period + RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` + // (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire + ExpirationInterval *float64 `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PricePoint. +// MarshalJSON implements the json.Marshaler interface for PricePoint. // It customizes the JSON marshaling process for PricePoint objects. func (p *PricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PricePoint object to a map representation for JSON marshaling. func (p *PricePoint) toMap() map[string]any { - structMap := make(map[string]any) - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Handle != nil { - structMap["handle"] = p.Handle - } - if p.PricingScheme != nil { - structMap["pricing_scheme"] = p.PricingScheme - } - if p.Prices != nil { - structMap["prices"] = p.Prices - } - if p.UseSiteExchangeRate != nil { - structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate - } - if p.TaxIncluded != nil { - structMap["tax_included"] = p.TaxIncluded - } - if p.Interval != nil { - structMap["interval"] = p.Interval - } - if p.IntervalUnit != nil { - structMap["interval_unit"] = p.IntervalUnit - } - if p.OveragePricing != nil { - structMap["overage_pricing"] = p.OveragePricing - } - if p.RolloverPrepaidRemainder != nil { - structMap["rollover_prepaid_remainder"] = p.RolloverPrepaidRemainder - } - if p.RenewPrepaidAllocation != nil { - structMap["renew_prepaid_allocation"] = p.RenewPrepaidAllocation - } - if p.ExpirationInterval != nil { - structMap["expiration_interval"] = p.ExpirationInterval - } - if p.ExpirationIntervalUnit != nil { - structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit - } - return structMap + structMap := make(map[string]any) + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Handle != nil { + structMap["handle"] = p.Handle + } + if p.PricingScheme != nil { + structMap["pricing_scheme"] = p.PricingScheme + } + if p.Prices != nil { + structMap["prices"] = p.Prices + } + if p.UseSiteExchangeRate != nil { + structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate + } + if p.TaxIncluded != nil { + structMap["tax_included"] = p.TaxIncluded + } + if p.Interval != nil { + structMap["interval"] = p.Interval + } + if p.IntervalUnit != nil { + structMap["interval_unit"] = p.IntervalUnit + } + if p.OveragePricing != nil { + structMap["overage_pricing"] = p.OveragePricing.toMap() + } + if p.RolloverPrepaidRemainder != nil { + structMap["rollover_prepaid_remainder"] = p.RolloverPrepaidRemainder + } + if p.RenewPrepaidAllocation != nil { + structMap["renew_prepaid_allocation"] = p.RenewPrepaidAllocation + } + if p.ExpirationInterval != nil { + structMap["expiration_interval"] = p.ExpirationInterval + } + if p.ExpirationIntervalUnit != nil { + structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for PricePoint. // It customizes the JSON unmarshaling process for PricePoint objects. func (p *PricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - TaxIncluded *bool `json:"tax_included,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` - RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` - RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` - ExpirationInterval *float64 `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Name = temp.Name - p.Handle = temp.Handle - p.PricingScheme = temp.PricingScheme - p.Prices = temp.Prices - p.UseSiteExchangeRate = temp.UseSiteExchangeRate - p.TaxIncluded = temp.TaxIncluded - p.Interval = temp.Interval - p.IntervalUnit = temp.IntervalUnit - p.OveragePricing = temp.OveragePricing - p.RolloverPrepaidRemainder = temp.RolloverPrepaidRemainder - p.RenewPrepaidAllocation = temp.RenewPrepaidAllocation - p.ExpirationInterval = temp.ExpirationInterval - p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + TaxIncluded *bool `json:"tax_included,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + OveragePricing *OveragePricing `json:"overage_pricing,omitempty"` + RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"` + RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"` + ExpirationInterval *float64 `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Name = temp.Name + p.Handle = temp.Handle + p.PricingScheme = temp.PricingScheme + p.Prices = temp.Prices + p.UseSiteExchangeRate = temp.UseSiteExchangeRate + p.TaxIncluded = temp.TaxIncluded + p.Interval = temp.Interval + p.IntervalUnit = temp.IntervalUnit + p.OveragePricing = temp.OveragePricing + p.RolloverPrepaidRemainder = temp.RolloverPrepaidRemainder + p.RenewPrepaidAllocation = temp.RenewPrepaidAllocation + p.ExpirationInterval = temp.ExpirationInterval + p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + return nil } diff --git a/models/product.go b/models/product.go index ec13c3d9..8bf5aa35 100644 --- a/models/product.go +++ b/models/product.go @@ -1,310 +1,310 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // Product represents a Product struct. type Product struct { - Id *int `json:"id,omitempty"` - // The product name - Name *string `json:"name,omitempty"` - // The product API handle - Handle Optional[string] `json:"handle"` - // The product description - Description Optional[string] `json:"description"` - // E.g. Internal ID or SKU Number - AccountingCode Optional[string] `json:"accounting_code"` - // Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. - RequestCreditCard *bool `json:"request_credit_card,omitempty"` - // 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 - ExpirationInterval Optional[int] `json:"expiration_interval"` - // A string representing the trial interval unit for this product, either month or day - ExpirationIntervalUnit Optional[ExtendedIntervalUnit] `json:"expiration_interval_unit"` - // Timestamp indicating when this product was created - CreatedAt *time.Time `json:"created_at,omitempty"` - // Timestamp indicating when this product was last updated - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // The product price, in integer cents - PriceInCents *int64 `json:"price_in_cents,omitempty"` - // 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 `json:"interval,omitempty"` - // A string representing the interval unit for this product, either month or day - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - // The up front charge you have specified. - InitialChargeInCents Optional[int64] `json:"initial_charge_in_cents"` - // The price of the trial period for a subscription to this product, in integer cents. - TrialPriceInCents Optional[int64] `json:"trial_price_in_cents"` - // 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 - TrialInterval Optional[int] `json:"trial_interval"` - // A string representing the trial interval unit for this product, either month or day - TrialIntervalUnit Optional[IntervalUnit] `json:"trial_interval_unit"` - // Timestamp indicating when this product was archived - ArchivedAt Optional[time.Time] `json:"archived_at"` - // Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. - RequireCreditCard *bool `json:"require_credit_card,omitempty"` - ReturnParams Optional[string] `json:"return_params"` - Taxable *bool `json:"taxable,omitempty"` - // The url to which a customer will be returned after a successful account update - UpdateReturnUrl Optional[string] `json:"update_return_url"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - // The version of the product - VersionNumber *int `json:"version_number,omitempty"` - // 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) - UpdateReturnParams Optional[string] `json:"update_return_params"` - ProductFamily *ProductFamily `json:"product_family,omitempty"` - PublicSignupPages []PublicSignupPage `json:"public_signup_pages,omitempty"` - ProductPricePointName *string `json:"product_price_point_name,omitempty"` - // A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product. - RequestBillingAddress *bool `json:"request_billing_address,omitempty"` - // A boolean indicating whether a billing address is required to add a payment profile, especially at signup. - RequireBillingAddress *bool `json:"require_billing_address,omitempty"` - // A boolean indicating whether a shipping address is required for the customer, especially at signup. - RequireShippingAddress *bool `json:"require_shipping_address,omitempty"` - // A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode Optional[string] `json:"tax_code"` - DefaultProductPricePointId *int `json:"default_product_price_point_id,omitempty"` - UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` - // One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other - ItemCategory Optional[string] `json:"item_category"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointHandle Optional[string] `json:"product_price_point_handle"` + Id *int `json:"id,omitempty"` + // The product name + Name *string `json:"name,omitempty"` + // The product API handle + Handle Optional[string] `json:"handle"` + // The product description + Description Optional[string] `json:"description"` + // E.g. Internal ID or SKU Number + AccountingCode Optional[string] `json:"accounting_code"` + // Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page. + RequestCreditCard *bool `json:"request_credit_card,omitempty"` + // 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 + ExpirationInterval Optional[int] `json:"expiration_interval"` + // A string representing the trial interval unit for this product, either month or day + ExpirationIntervalUnit Optional[ExtendedIntervalUnit] `json:"expiration_interval_unit"` + // Timestamp indicating when this product was created + CreatedAt *time.Time `json:"created_at,omitempty"` + // Timestamp indicating when this product was last updated + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // The product price, in integer cents + PriceInCents *int64 `json:"price_in_cents,omitempty"` + // 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 `json:"interval,omitempty"` + // A string representing the interval unit for this product, either month or day + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // The up front charge you have specified. + InitialChargeInCents Optional[int64] `json:"initial_charge_in_cents"` + // The price of the trial period for a subscription to this product, in integer cents. + TrialPriceInCents Optional[int64] `json:"trial_price_in_cents"` + // 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 + TrialInterval Optional[int] `json:"trial_interval"` + // A string representing the trial interval unit for this product, either month or day + TrialIntervalUnit Optional[IntervalUnit] `json:"trial_interval_unit"` + // Timestamp indicating when this product was archived + ArchivedAt Optional[time.Time] `json:"archived_at"` + // Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. + RequireCreditCard *bool `json:"require_credit_card,omitempty"` + ReturnParams Optional[string] `json:"return_params"` + Taxable *bool `json:"taxable,omitempty"` + // The url to which a customer will be returned after a successful account update + UpdateReturnUrl Optional[string] `json:"update_return_url"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + // The version of the product + VersionNumber *int `json:"version_number,omitempty"` + // 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) + UpdateReturnParams Optional[string] `json:"update_return_params"` + ProductFamily *ProductFamily `json:"product_family,omitempty"` + PublicSignupPages []PublicSignupPage `json:"public_signup_pages,omitempty"` + ProductPricePointName *string `json:"product_price_point_name,omitempty"` + // A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product. + RequestBillingAddress *bool `json:"request_billing_address,omitempty"` + // A boolean indicating whether a billing address is required to add a payment profile, especially at signup. + RequireBillingAddress *bool `json:"require_billing_address,omitempty"` + // A boolean indicating whether a shipping address is required for the customer, especially at signup. + RequireShippingAddress *bool `json:"require_shipping_address,omitempty"` + // A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode Optional[string] `json:"tax_code"` + DefaultProductPricePointId *int `json:"default_product_price_point_id,omitempty"` + UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` + // One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other + ItemCategory Optional[string] `json:"item_category"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointHandle Optional[string] `json:"product_price_point_handle"` } -// MarshalJSON implements the json.Marshaler interface for Product. +// MarshalJSON implements the json.Marshaler interface for Product. // It customizes the JSON marshaling process for Product objects. func (p *Product) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the Product object to a map representation for JSON marshaling. func (p *Product) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Handle.IsValueSet() { - structMap["handle"] = p.Handle.Value() - } - if p.Description.IsValueSet() { - structMap["description"] = p.Description.Value() - } - if p.AccountingCode.IsValueSet() { - structMap["accounting_code"] = p.AccountingCode.Value() - } - if p.RequestCreditCard != nil { - structMap["request_credit_card"] = p.RequestCreditCard - } - if p.ExpirationInterval.IsValueSet() { - structMap["expiration_interval"] = p.ExpirationInterval.Value() - } - if p.ExpirationIntervalUnit.IsValueSet() { - structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit.Value() - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt.Format(time.RFC3339) - } - if p.UpdatedAt != nil { - structMap["updated_at"] = p.UpdatedAt.Format(time.RFC3339) - } - if p.PriceInCents != nil { - structMap["price_in_cents"] = p.PriceInCents - } - if p.Interval != nil { - structMap["interval"] = p.Interval - } - if p.IntervalUnit != nil { - structMap["interval_unit"] = p.IntervalUnit - } - if p.InitialChargeInCents.IsValueSet() { - structMap["initial_charge_in_cents"] = p.InitialChargeInCents.Value() - } - if p.TrialPriceInCents.IsValueSet() { - structMap["trial_price_in_cents"] = p.TrialPriceInCents.Value() - } - if p.TrialInterval.IsValueSet() { - structMap["trial_interval"] = p.TrialInterval.Value() - } - if p.TrialIntervalUnit.IsValueSet() { - structMap["trial_interval_unit"] = p.TrialIntervalUnit.Value() - } - if p.ArchivedAt.IsValueSet() { - var ArchivedAtVal *string = nil - if p.ArchivedAt.Value() != nil { - val := p.ArchivedAt.Value().Format(time.RFC3339) - ArchivedAtVal = &val - } - structMap["archived_at"] = ArchivedAtVal - } - if p.RequireCreditCard != nil { - structMap["require_credit_card"] = p.RequireCreditCard - } - if p.ReturnParams.IsValueSet() { - structMap["return_params"] = p.ReturnParams.Value() - } - if p.Taxable != nil { - structMap["taxable"] = p.Taxable - } - if p.UpdateReturnUrl.IsValueSet() { - structMap["update_return_url"] = p.UpdateReturnUrl.Value() - } - if p.InitialChargeAfterTrial != nil { - structMap["initial_charge_after_trial"] = p.InitialChargeAfterTrial - } - if p.VersionNumber != nil { - structMap["version_number"] = p.VersionNumber - } - if p.UpdateReturnParams.IsValueSet() { - structMap["update_return_params"] = p.UpdateReturnParams.Value() - } - if p.ProductFamily != nil { - structMap["product_family"] = p.ProductFamily - } - if p.PublicSignupPages != nil { - structMap["public_signup_pages"] = p.PublicSignupPages - } - if p.ProductPricePointName != nil { - structMap["product_price_point_name"] = p.ProductPricePointName - } - if p.RequestBillingAddress != nil { - structMap["request_billing_address"] = p.RequestBillingAddress - } - if p.RequireBillingAddress != nil { - structMap["require_billing_address"] = p.RequireBillingAddress - } - if p.RequireShippingAddress != nil { - structMap["require_shipping_address"] = p.RequireShippingAddress - } - if p.TaxCode.IsValueSet() { - structMap["tax_code"] = p.TaxCode.Value() - } - if p.DefaultProductPricePointId != nil { - structMap["default_product_price_point_id"] = p.DefaultProductPricePointId - } - if p.UseSiteExchangeRate.IsValueSet() { - structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate.Value() - } - if p.ItemCategory.IsValueSet() { - structMap["item_category"] = p.ItemCategory.Value() - } - if p.ProductPricePointId != nil { - structMap["product_price_point_id"] = p.ProductPricePointId - } - if p.ProductPricePointHandle.IsValueSet() { - structMap["product_price_point_handle"] = p.ProductPricePointHandle.Value() - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Handle.IsValueSet() { + structMap["handle"] = p.Handle.Value() + } + if p.Description.IsValueSet() { + structMap["description"] = p.Description.Value() + } + if p.AccountingCode.IsValueSet() { + structMap["accounting_code"] = p.AccountingCode.Value() + } + if p.RequestCreditCard != nil { + structMap["request_credit_card"] = p.RequestCreditCard + } + if p.ExpirationInterval.IsValueSet() { + structMap["expiration_interval"] = p.ExpirationInterval.Value() + } + if p.ExpirationIntervalUnit.IsValueSet() { + structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit.Value() + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt.Format(time.RFC3339) + } + if p.UpdatedAt != nil { + structMap["updated_at"] = p.UpdatedAt.Format(time.RFC3339) + } + if p.PriceInCents != nil { + structMap["price_in_cents"] = p.PriceInCents + } + if p.Interval != nil { + structMap["interval"] = p.Interval + } + if p.IntervalUnit != nil { + structMap["interval_unit"] = p.IntervalUnit + } + if p.InitialChargeInCents.IsValueSet() { + structMap["initial_charge_in_cents"] = p.InitialChargeInCents.Value() + } + if p.TrialPriceInCents.IsValueSet() { + structMap["trial_price_in_cents"] = p.TrialPriceInCents.Value() + } + if p.TrialInterval.IsValueSet() { + structMap["trial_interval"] = p.TrialInterval.Value() + } + if p.TrialIntervalUnit.IsValueSet() { + structMap["trial_interval_unit"] = p.TrialIntervalUnit.Value() + } + if p.ArchivedAt.IsValueSet() { + var ArchivedAtVal *string = nil + if p.ArchivedAt.Value() != nil { + val := p.ArchivedAt.Value().Format(time.RFC3339) + ArchivedAtVal = &val + } + structMap["archived_at"] = ArchivedAtVal + } + if p.RequireCreditCard != nil { + structMap["require_credit_card"] = p.RequireCreditCard + } + if p.ReturnParams.IsValueSet() { + structMap["return_params"] = p.ReturnParams.Value() + } + if p.Taxable != nil { + structMap["taxable"] = p.Taxable + } + if p.UpdateReturnUrl.IsValueSet() { + structMap["update_return_url"] = p.UpdateReturnUrl.Value() + } + if p.InitialChargeAfterTrial != nil { + structMap["initial_charge_after_trial"] = p.InitialChargeAfterTrial + } + if p.VersionNumber != nil { + structMap["version_number"] = p.VersionNumber + } + if p.UpdateReturnParams.IsValueSet() { + structMap["update_return_params"] = p.UpdateReturnParams.Value() + } + if p.ProductFamily != nil { + structMap["product_family"] = p.ProductFamily.toMap() + } + if p.PublicSignupPages != nil { + structMap["public_signup_pages"] = p.PublicSignupPages + } + if p.ProductPricePointName != nil { + structMap["product_price_point_name"] = p.ProductPricePointName + } + if p.RequestBillingAddress != nil { + structMap["request_billing_address"] = p.RequestBillingAddress + } + if p.RequireBillingAddress != nil { + structMap["require_billing_address"] = p.RequireBillingAddress + } + if p.RequireShippingAddress != nil { + structMap["require_shipping_address"] = p.RequireShippingAddress + } + if p.TaxCode.IsValueSet() { + structMap["tax_code"] = p.TaxCode.Value() + } + if p.DefaultProductPricePointId != nil { + structMap["default_product_price_point_id"] = p.DefaultProductPricePointId + } + if p.UseSiteExchangeRate.IsValueSet() { + structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate.Value() + } + if p.ItemCategory.IsValueSet() { + structMap["item_category"] = p.ItemCategory.Value() + } + if p.ProductPricePointId != nil { + structMap["product_price_point_id"] = p.ProductPricePointId + } + if p.ProductPricePointHandle.IsValueSet() { + structMap["product_price_point_handle"] = p.ProductPricePointHandle.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Product. +// UnmarshalJSON implements the json.Unmarshaler interface for Product. // It customizes the JSON unmarshaling process for Product objects. func (p *Product) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Handle Optional[string] `json:"handle"` - Description Optional[string] `json:"description"` - AccountingCode Optional[string] `json:"accounting_code"` - RequestCreditCard *bool `json:"request_credit_card,omitempty"` - ExpirationInterval Optional[int] `json:"expiration_interval"` - ExpirationIntervalUnit Optional[ExtendedIntervalUnit] `json:"expiration_interval_unit"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - PriceInCents *int64 `json:"price_in_cents,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - InitialChargeInCents Optional[int64] `json:"initial_charge_in_cents"` - TrialPriceInCents Optional[int64] `json:"trial_price_in_cents"` - TrialInterval Optional[int] `json:"trial_interval"` - TrialIntervalUnit Optional[IntervalUnit] `json:"trial_interval_unit"` - ArchivedAt Optional[string] `json:"archived_at"` - RequireCreditCard *bool `json:"require_credit_card,omitempty"` - ReturnParams Optional[string] `json:"return_params"` - Taxable *bool `json:"taxable,omitempty"` - UpdateReturnUrl Optional[string] `json:"update_return_url"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - VersionNumber *int `json:"version_number,omitempty"` - UpdateReturnParams Optional[string] `json:"update_return_params"` - ProductFamily *ProductFamily `json:"product_family,omitempty"` - PublicSignupPages []PublicSignupPage `json:"public_signup_pages,omitempty"` - ProductPricePointName *string `json:"product_price_point_name,omitempty"` - RequestBillingAddress *bool `json:"request_billing_address,omitempty"` - RequireBillingAddress *bool `json:"require_billing_address,omitempty"` - RequireShippingAddress *bool `json:"require_shipping_address,omitempty"` - TaxCode Optional[string] `json:"tax_code"` - DefaultProductPricePointId *int `json:"default_product_price_point_id,omitempty"` - UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` - ItemCategory Optional[string] `json:"item_category"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointHandle Optional[string] `json:"product_price_point_handle"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.Name = temp.Name - p.Handle = temp.Handle - p.Description = temp.Description - p.AccountingCode = temp.AccountingCode - p.RequestCreditCard = temp.RequestCreditCard - p.ExpirationInterval = temp.ExpirationInterval - p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - p.CreatedAt = &CreatedAtVal - } - if temp.UpdatedAt != nil { - UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) - if err != nil { - log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) - } - p.UpdatedAt = &UpdatedAtVal - } - p.PriceInCents = temp.PriceInCents - p.Interval = temp.Interval - p.IntervalUnit = temp.IntervalUnit - p.InitialChargeInCents = temp.InitialChargeInCents - p.TrialPriceInCents = temp.TrialPriceInCents - p.TrialInterval = temp.TrialInterval - p.TrialIntervalUnit = temp.TrialIntervalUnit - p.ArchivedAt.ShouldSetValue(temp.ArchivedAt.IsValueSet()) - if temp.ArchivedAt.Value() != nil { - ArchivedAtVal, err := time.Parse(time.RFC3339, (*temp.ArchivedAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse archived_at as % s format.", time.RFC3339) - } - p.ArchivedAt.SetValue(&ArchivedAtVal) - } - p.RequireCreditCard = temp.RequireCreditCard - p.ReturnParams = temp.ReturnParams - p.Taxable = temp.Taxable - p.UpdateReturnUrl = temp.UpdateReturnUrl - p.InitialChargeAfterTrial = temp.InitialChargeAfterTrial - p.VersionNumber = temp.VersionNumber - p.UpdateReturnParams = temp.UpdateReturnParams - p.ProductFamily = temp.ProductFamily - p.PublicSignupPages = temp.PublicSignupPages - p.ProductPricePointName = temp.ProductPricePointName - p.RequestBillingAddress = temp.RequestBillingAddress - p.RequireBillingAddress = temp.RequireBillingAddress - p.RequireShippingAddress = temp.RequireShippingAddress - p.TaxCode = temp.TaxCode - p.DefaultProductPricePointId = temp.DefaultProductPricePointId - p.UseSiteExchangeRate = temp.UseSiteExchangeRate - p.ItemCategory = temp.ItemCategory - p.ProductPricePointId = temp.ProductPricePointId - p.ProductPricePointHandle = temp.ProductPricePointHandle - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Handle Optional[string] `json:"handle"` + Description Optional[string] `json:"description"` + AccountingCode Optional[string] `json:"accounting_code"` + RequestCreditCard *bool `json:"request_credit_card,omitempty"` + ExpirationInterval Optional[int] `json:"expiration_interval"` + ExpirationIntervalUnit Optional[ExtendedIntervalUnit] `json:"expiration_interval_unit"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + PriceInCents *int64 `json:"price_in_cents,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + InitialChargeInCents Optional[int64] `json:"initial_charge_in_cents"` + TrialPriceInCents Optional[int64] `json:"trial_price_in_cents"` + TrialInterval Optional[int] `json:"trial_interval"` + TrialIntervalUnit Optional[IntervalUnit] `json:"trial_interval_unit"` + ArchivedAt Optional[string] `json:"archived_at"` + RequireCreditCard *bool `json:"require_credit_card,omitempty"` + ReturnParams Optional[string] `json:"return_params"` + Taxable *bool `json:"taxable,omitempty"` + UpdateReturnUrl Optional[string] `json:"update_return_url"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + VersionNumber *int `json:"version_number,omitempty"` + UpdateReturnParams Optional[string] `json:"update_return_params"` + ProductFamily *ProductFamily `json:"product_family,omitempty"` + PublicSignupPages []PublicSignupPage `json:"public_signup_pages,omitempty"` + ProductPricePointName *string `json:"product_price_point_name,omitempty"` + RequestBillingAddress *bool `json:"request_billing_address,omitempty"` + RequireBillingAddress *bool `json:"require_billing_address,omitempty"` + RequireShippingAddress *bool `json:"require_shipping_address,omitempty"` + TaxCode Optional[string] `json:"tax_code"` + DefaultProductPricePointId *int `json:"default_product_price_point_id,omitempty"` + UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` + ItemCategory Optional[string] `json:"item_category"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointHandle Optional[string] `json:"product_price_point_handle"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.Name = temp.Name + p.Handle = temp.Handle + p.Description = temp.Description + p.AccountingCode = temp.AccountingCode + p.RequestCreditCard = temp.RequestCreditCard + p.ExpirationInterval = temp.ExpirationInterval + p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + p.CreatedAt = &CreatedAtVal + } + if temp.UpdatedAt != nil { + UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) + if err != nil { + log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) + } + p.UpdatedAt = &UpdatedAtVal + } + p.PriceInCents = temp.PriceInCents + p.Interval = temp.Interval + p.IntervalUnit = temp.IntervalUnit + p.InitialChargeInCents = temp.InitialChargeInCents + p.TrialPriceInCents = temp.TrialPriceInCents + p.TrialInterval = temp.TrialInterval + p.TrialIntervalUnit = temp.TrialIntervalUnit + p.ArchivedAt.ShouldSetValue(temp.ArchivedAt.IsValueSet()) + if temp.ArchivedAt.Value() != nil { + ArchivedAtVal, err := time.Parse(time.RFC3339, (*temp.ArchivedAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse archived_at as % s format.", time.RFC3339) + } + p.ArchivedAt.SetValue(&ArchivedAtVal) + } + p.RequireCreditCard = temp.RequireCreditCard + p.ReturnParams = temp.ReturnParams + p.Taxable = temp.Taxable + p.UpdateReturnUrl = temp.UpdateReturnUrl + p.InitialChargeAfterTrial = temp.InitialChargeAfterTrial + p.VersionNumber = temp.VersionNumber + p.UpdateReturnParams = temp.UpdateReturnParams + p.ProductFamily = temp.ProductFamily + p.PublicSignupPages = temp.PublicSignupPages + p.ProductPricePointName = temp.ProductPricePointName + p.RequestBillingAddress = temp.RequestBillingAddress + p.RequireBillingAddress = temp.RequireBillingAddress + p.RequireShippingAddress = temp.RequireShippingAddress + p.TaxCode = temp.TaxCode + p.DefaultProductPricePointId = temp.DefaultProductPricePointId + p.UseSiteExchangeRate = temp.UseSiteExchangeRate + p.ItemCategory = temp.ItemCategory + p.ProductPricePointId = temp.ProductPricePointId + p.ProductPricePointHandle = temp.ProductPricePointHandle + return nil } diff --git a/models/product_family.go b/models/product_family.go index 224f0938..c9692b43 100644 --- a/models/product_family.go +++ b/models/product_family.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProductFamily represents a ProductFamily struct. type ProductFamily struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - AccountingCode Optional[string] `json:"accounting_code"` - Description Optional[string] `json:"description"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + AccountingCode Optional[string] `json:"accounting_code"` + Description Optional[string] `json:"description"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProductFamily. +// MarshalJSON implements the json.Marshaler interface for ProductFamily. // It customizes the JSON marshaling process for ProductFamily objects. func (p *ProductFamily) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductFamily object to a map representation for JSON marshaling. func (p *ProductFamily) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Handle != nil { - structMap["handle"] = p.Handle - } - if p.AccountingCode.IsValueSet() { - structMap["accounting_code"] = p.AccountingCode.Value() - } - if p.Description.IsValueSet() { - structMap["description"] = p.Description.Value() - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt - } - if p.UpdatedAt != nil { - structMap["updated_at"] = p.UpdatedAt - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Handle != nil { + structMap["handle"] = p.Handle + } + if p.AccountingCode.IsValueSet() { + structMap["accounting_code"] = p.AccountingCode.Value() + } + if p.Description.IsValueSet() { + structMap["description"] = p.Description.Value() + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt + } + if p.UpdatedAt != nil { + structMap["updated_at"] = p.UpdatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductFamily. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductFamily. // It customizes the JSON unmarshaling process for ProductFamily objects. func (p *ProductFamily) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - AccountingCode Optional[string] `json:"accounting_code"` - Description Optional[string] `json:"description"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.Name = temp.Name - p.Handle = temp.Handle - p.AccountingCode = temp.AccountingCode - p.Description = temp.Description - p.CreatedAt = temp.CreatedAt - p.UpdatedAt = temp.UpdatedAt - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + AccountingCode Optional[string] `json:"accounting_code"` + Description Optional[string] `json:"description"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.Name = temp.Name + p.Handle = temp.Handle + p.AccountingCode = temp.AccountingCode + p.Description = temp.Description + p.CreatedAt = temp.CreatedAt + p.UpdatedAt = temp.UpdatedAt + return nil } diff --git a/models/product_family_response.go b/models/product_family_response.go index 49a4872f..b0a76307 100644 --- a/models/product_family_response.go +++ b/models/product_family_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProductFamilyResponse represents a ProductFamilyResponse struct. type ProductFamilyResponse struct { - ProductFamily *ProductFamily `json:"product_family,omitempty"` + ProductFamily *ProductFamily `json:"product_family,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProductFamilyResponse. +// MarshalJSON implements the json.Marshaler interface for ProductFamilyResponse. // It customizes the JSON marshaling process for ProductFamilyResponse objects. func (p *ProductFamilyResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductFamilyResponse object to a map representation for JSON marshaling. func (p *ProductFamilyResponse) toMap() map[string]any { - structMap := make(map[string]any) - if p.ProductFamily != nil { - structMap["product_family"] = p.ProductFamily - } - return structMap + structMap := make(map[string]any) + if p.ProductFamily != nil { + structMap["product_family"] = p.ProductFamily.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductFamilyResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductFamilyResponse. // It customizes the JSON unmarshaling process for ProductFamilyResponse objects. func (p *ProductFamilyResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductFamily *ProductFamily `json:"product_family,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.ProductFamily = temp.ProductFamily - return nil + temp := &struct { + ProductFamily *ProductFamily `json:"product_family,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.ProductFamily = temp.ProductFamily + return nil } diff --git a/models/product_price_point.go b/models/product_price_point.go index e9b4c526..c5f7400b 100644 --- a/models/product_price_point.go +++ b/models/product_price_point.go @@ -1,227 +1,227 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // ProductPricePoint represents a ProductPricePoint struct. type ProductPricePoint struct { - Id *int `json:"id,omitempty"` - // The product price point name - Name *string `json:"name,omitempty"` - // The product price point API handle - Handle *string `json:"handle,omitempty"` - // The product price point price, in integer cents - PriceInCents *int64 `json:"price_in_cents,omitempty"` - // 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 `json:"interval,omitempty"` - // A string representing the interval unit for this product price point, either month or day - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - // The product price point trial price, in integer cents - TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` - // The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days - TrialInterval *int `json:"trial_interval,omitempty"` - // A string representing the trial interval unit for this product price point, either month or day - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - TrialType *string `json:"trial_type,omitempty"` - // reserved for future use - IntroductoryOffer *bool `json:"introductory_offer,omitempty"` - // The product price point initial charge, in integer cents - InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - // 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 every 30 days - ExpirationInterval *int `json:"expiration_interval,omitempty"` - // A string representing the expiration interval unit for this product price point, either month or day - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - // The product id this price point belongs to - ProductId *int `json:"product_id,omitempty"` - // Timestamp indicating when this price point was archived - ArchivedAt Optional[time.Time] `json:"archived_at"` - // Timestamp indicating when this price point was created - CreatedAt *time.Time `json:"created_at,omitempty"` - // Timestamp indicating when this price point was last updated - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - // The type of price point - Type *PricePointType `json:"type,omitempty"` - // Whether or not the price point includes tax - TaxIncluded *bool `json:"tax_included,omitempty"` - // The subscription id this price point belongs to - SubscriptionId Optional[int] `json:"subscription_id"` - // 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. - CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` + Id *int `json:"id,omitempty"` + // The product price point name + Name *string `json:"name,omitempty"` + // The product price point API handle + Handle *string `json:"handle,omitempty"` + // The product price point price, in integer cents + PriceInCents *int64 `json:"price_in_cents,omitempty"` + // 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 `json:"interval,omitempty"` + // A string representing the interval unit for this product price point, either month or day + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // The product price point trial price, in integer cents + TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` + // The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days + TrialInterval *int `json:"trial_interval,omitempty"` + // A string representing the trial interval unit for this product price point, either month or day + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + TrialType *string `json:"trial_type,omitempty"` + // reserved for future use + IntroductoryOffer *bool `json:"introductory_offer,omitempty"` + // The product price point initial charge, in integer cents + InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + // 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 every 30 days + ExpirationInterval *int `json:"expiration_interval,omitempty"` + // A string representing the expiration interval unit for this product price point, either month or day + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + // The product id this price point belongs to + ProductId *int `json:"product_id,omitempty"` + // Timestamp indicating when this price point was archived + ArchivedAt Optional[time.Time] `json:"archived_at"` + // Timestamp indicating when this price point was created + CreatedAt *time.Time `json:"created_at,omitempty"` + // Timestamp indicating when this price point was last updated + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined. + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + // The type of price point + Type *PricePointType `json:"type,omitempty"` + // Whether or not the price point includes tax + TaxIncluded *bool `json:"tax_included,omitempty"` + // The subscription id this price point belongs to + SubscriptionId Optional[int] `json:"subscription_id"` + // 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. + CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProductPricePoint. +// MarshalJSON implements the json.Marshaler interface for ProductPricePoint. // It customizes the JSON marshaling process for ProductPricePoint objects. func (p *ProductPricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductPricePoint object to a map representation for JSON marshaling. func (p *ProductPricePoint) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Handle != nil { - structMap["handle"] = p.Handle - } - if p.PriceInCents != nil { - structMap["price_in_cents"] = p.PriceInCents - } - if p.Interval != nil { - structMap["interval"] = p.Interval - } - if p.IntervalUnit != nil { - structMap["interval_unit"] = p.IntervalUnit - } - if p.TrialPriceInCents != nil { - structMap["trial_price_in_cents"] = p.TrialPriceInCents - } - if p.TrialInterval != nil { - structMap["trial_interval"] = p.TrialInterval - } - if p.TrialIntervalUnit != nil { - structMap["trial_interval_unit"] = p.TrialIntervalUnit - } - if p.TrialType != nil { - structMap["trial_type"] = p.TrialType - } - if p.IntroductoryOffer != nil { - structMap["introductory_offer"] = p.IntroductoryOffer - } - if p.InitialChargeInCents != nil { - structMap["initial_charge_in_cents"] = p.InitialChargeInCents - } - if p.InitialChargeAfterTrial != nil { - structMap["initial_charge_after_trial"] = p.InitialChargeAfterTrial - } - if p.ExpirationInterval != nil { - structMap["expiration_interval"] = p.ExpirationInterval - } - if p.ExpirationIntervalUnit != nil { - structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit - } - if p.ProductId != nil { - structMap["product_id"] = p.ProductId - } - if p.ArchivedAt.IsValueSet() { - var ArchivedAtVal *string = nil - if p.ArchivedAt.Value() != nil { - val := p.ArchivedAt.Value().Format(time.RFC3339) - ArchivedAtVal = &val - } - structMap["archived_at"] = ArchivedAtVal - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt.Format(time.RFC3339) - } - if p.UpdatedAt != nil { - structMap["updated_at"] = p.UpdatedAt.Format(time.RFC3339) - } - if p.UseSiteExchangeRate != nil { - structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate - } - if p.Type != nil { - structMap["type"] = p.Type - } - if p.TaxIncluded != nil { - structMap["tax_included"] = p.TaxIncluded - } - if p.SubscriptionId.IsValueSet() { - structMap["subscription_id"] = p.SubscriptionId.Value() - } - if p.CurrencyPrices != nil { - structMap["currency_prices"] = p.CurrencyPrices - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Handle != nil { + structMap["handle"] = p.Handle + } + if p.PriceInCents != nil { + structMap["price_in_cents"] = p.PriceInCents + } + if p.Interval != nil { + structMap["interval"] = p.Interval + } + if p.IntervalUnit != nil { + structMap["interval_unit"] = p.IntervalUnit + } + if p.TrialPriceInCents != nil { + structMap["trial_price_in_cents"] = p.TrialPriceInCents + } + if p.TrialInterval != nil { + structMap["trial_interval"] = p.TrialInterval + } + if p.TrialIntervalUnit != nil { + structMap["trial_interval_unit"] = p.TrialIntervalUnit + } + if p.TrialType != nil { + structMap["trial_type"] = p.TrialType + } + if p.IntroductoryOffer != nil { + structMap["introductory_offer"] = p.IntroductoryOffer + } + if p.InitialChargeInCents != nil { + structMap["initial_charge_in_cents"] = p.InitialChargeInCents + } + if p.InitialChargeAfterTrial != nil { + structMap["initial_charge_after_trial"] = p.InitialChargeAfterTrial + } + if p.ExpirationInterval != nil { + structMap["expiration_interval"] = p.ExpirationInterval + } + if p.ExpirationIntervalUnit != nil { + structMap["expiration_interval_unit"] = p.ExpirationIntervalUnit + } + if p.ProductId != nil { + structMap["product_id"] = p.ProductId + } + if p.ArchivedAt.IsValueSet() { + var ArchivedAtVal *string = nil + if p.ArchivedAt.Value() != nil { + val := p.ArchivedAt.Value().Format(time.RFC3339) + ArchivedAtVal = &val + } + structMap["archived_at"] = ArchivedAtVal + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt.Format(time.RFC3339) + } + if p.UpdatedAt != nil { + structMap["updated_at"] = p.UpdatedAt.Format(time.RFC3339) + } + if p.UseSiteExchangeRate != nil { + structMap["use_site_exchange_rate"] = p.UseSiteExchangeRate + } + if p.Type != nil { + structMap["type"] = p.Type + } + if p.TaxIncluded != nil { + structMap["tax_included"] = p.TaxIncluded + } + if p.SubscriptionId.IsValueSet() { + structMap["subscription_id"] = p.SubscriptionId.Value() + } + if p.CurrencyPrices != nil { + structMap["currency_prices"] = p.CurrencyPrices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePoint. // It customizes the JSON unmarshaling process for ProductPricePoint objects. func (p *ProductPricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - PriceInCents *int64 `json:"price_in_cents,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` - TrialInterval *int `json:"trial_interval,omitempty"` - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - TrialType *string `json:"trial_type,omitempty"` - IntroductoryOffer *bool `json:"introductory_offer,omitempty"` - InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - ExpirationInterval *int `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ArchivedAt Optional[string] `json:"archived_at"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - Type *PricePointType `json:"type,omitempty"` - TaxIncluded *bool `json:"tax_included,omitempty"` - SubscriptionId Optional[int] `json:"subscription_id"` - CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.Name = temp.Name - p.Handle = temp.Handle - p.PriceInCents = temp.PriceInCents - p.Interval = temp.Interval - p.IntervalUnit = temp.IntervalUnit - p.TrialPriceInCents = temp.TrialPriceInCents - p.TrialInterval = temp.TrialInterval - p.TrialIntervalUnit = temp.TrialIntervalUnit - p.TrialType = temp.TrialType - p.IntroductoryOffer = temp.IntroductoryOffer - p.InitialChargeInCents = temp.InitialChargeInCents - p.InitialChargeAfterTrial = temp.InitialChargeAfterTrial - p.ExpirationInterval = temp.ExpirationInterval - p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - p.ProductId = temp.ProductId - p.ArchivedAt.ShouldSetValue(temp.ArchivedAt.IsValueSet()) - if temp.ArchivedAt.Value() != nil { - ArchivedAtVal, err := time.Parse(time.RFC3339, (*temp.ArchivedAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse archived_at as % s format.", time.RFC3339) - } - p.ArchivedAt.SetValue(&ArchivedAtVal) - } - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - p.CreatedAt = &CreatedAtVal - } - if temp.UpdatedAt != nil { - UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) - if err != nil { - log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) - } - p.UpdatedAt = &UpdatedAtVal - } - p.UseSiteExchangeRate = temp.UseSiteExchangeRate - p.Type = temp.Type - p.TaxIncluded = temp.TaxIncluded - p.SubscriptionId = temp.SubscriptionId - p.CurrencyPrices = temp.CurrencyPrices - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + PriceInCents *int64 `json:"price_in_cents,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"` + TrialInterval *int `json:"trial_interval,omitempty"` + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + TrialType *string `json:"trial_type,omitempty"` + IntroductoryOffer *bool `json:"introductory_offer,omitempty"` + InitialChargeInCents *int64 `json:"initial_charge_in_cents,omitempty"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + ExpirationInterval *int `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ArchivedAt Optional[string] `json:"archived_at"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + Type *PricePointType `json:"type,omitempty"` + TaxIncluded *bool `json:"tax_included,omitempty"` + SubscriptionId Optional[int] `json:"subscription_id"` + CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.Name = temp.Name + p.Handle = temp.Handle + p.PriceInCents = temp.PriceInCents + p.Interval = temp.Interval + p.IntervalUnit = temp.IntervalUnit + p.TrialPriceInCents = temp.TrialPriceInCents + p.TrialInterval = temp.TrialInterval + p.TrialIntervalUnit = temp.TrialIntervalUnit + p.TrialType = temp.TrialType + p.IntroductoryOffer = temp.IntroductoryOffer + p.InitialChargeInCents = temp.InitialChargeInCents + p.InitialChargeAfterTrial = temp.InitialChargeAfterTrial + p.ExpirationInterval = temp.ExpirationInterval + p.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + p.ProductId = temp.ProductId + p.ArchivedAt.ShouldSetValue(temp.ArchivedAt.IsValueSet()) + if temp.ArchivedAt.Value() != nil { + ArchivedAtVal, err := time.Parse(time.RFC3339, (*temp.ArchivedAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse archived_at as % s format.", time.RFC3339) + } + p.ArchivedAt.SetValue(&ArchivedAtVal) + } + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + p.CreatedAt = &CreatedAtVal + } + if temp.UpdatedAt != nil { + UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) + if err != nil { + log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) + } + p.UpdatedAt = &UpdatedAtVal + } + p.UseSiteExchangeRate = temp.UseSiteExchangeRate + p.Type = temp.Type + p.TaxIncluded = temp.TaxIncluded + p.SubscriptionId = temp.SubscriptionId + p.CurrencyPrices = temp.CurrencyPrices + return nil } diff --git a/models/product_price_point_errors.go b/models/product_price_point_errors.go index 2e045703..42397423 100644 --- a/models/product_price_point_errors.go +++ b/models/product_price_point_errors.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProductPricePointErrors represents a ProductPricePointErrors struct. type ProductPricePointErrors struct { - PricePoint *string `json:"price_point,omitempty"` - Interval []string `json:"interval,omitempty"` - IntervalUnit []string `json:"interval_unit,omitempty"` - Name []string `json:"name,omitempty"` - Price []string `json:"price,omitempty"` - PriceInCents []string `json:"price_in_cents,omitempty"` + PricePoint *string `json:"price_point,omitempty"` + Interval []string `json:"interval,omitempty"` + IntervalUnit []string `json:"interval_unit,omitempty"` + Name []string `json:"name,omitempty"` + Price []string `json:"price,omitempty"` + PriceInCents []string `json:"price_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProductPricePointErrors. +// MarshalJSON implements the json.Marshaler interface for ProductPricePointErrors. // It customizes the JSON marshaling process for ProductPricePointErrors objects. func (p *ProductPricePointErrors) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductPricePointErrors object to a map representation for JSON marshaling. func (p *ProductPricePointErrors) toMap() map[string]any { - structMap := make(map[string]any) - if p.PricePoint != nil { - structMap["price_point"] = p.PricePoint - } - if p.Interval != nil { - structMap["interval"] = p.Interval - } - if p.IntervalUnit != nil { - structMap["interval_unit"] = p.IntervalUnit - } - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Price != nil { - structMap["price"] = p.Price - } - if p.PriceInCents != nil { - structMap["price_in_cents"] = p.PriceInCents - } - return structMap + structMap := make(map[string]any) + if p.PricePoint != nil { + structMap["price_point"] = p.PricePoint + } + if p.Interval != nil { + structMap["interval"] = p.Interval + } + if p.IntervalUnit != nil { + structMap["interval_unit"] = p.IntervalUnit + } + if p.Name != nil { + structMap["name"] = p.Name + } + if p.Price != nil { + structMap["price"] = p.Price + } + if p.PriceInCents != nil { + structMap["price_in_cents"] = p.PriceInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointErrors. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointErrors. // It customizes the JSON unmarshaling process for ProductPricePointErrors objects. func (p *ProductPricePointErrors) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoint *string `json:"price_point,omitempty"` - Interval []string `json:"interval,omitempty"` - IntervalUnit []string `json:"interval_unit,omitempty"` - Name []string `json:"name,omitempty"` - Price []string `json:"price,omitempty"` - PriceInCents []string `json:"price_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PricePoint = temp.PricePoint - p.Interval = temp.Interval - p.IntervalUnit = temp.IntervalUnit - p.Name = temp.Name - p.Price = temp.Price - p.PriceInCents = temp.PriceInCents - return nil + temp := &struct { + PricePoint *string `json:"price_point,omitempty"` + Interval []string `json:"interval,omitempty"` + IntervalUnit []string `json:"interval_unit,omitempty"` + Name []string `json:"name,omitempty"` + Price []string `json:"price,omitempty"` + PriceInCents []string `json:"price_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PricePoint = temp.PricePoint + p.Interval = temp.Interval + p.IntervalUnit = temp.IntervalUnit + p.Name = temp.Name + p.Price = temp.Price + p.PriceInCents = temp.PriceInCents + return nil } diff --git a/models/product_price_point_response.go b/models/product_price_point_response.go index aad3ae20..f10b3ea9 100644 --- a/models/product_price_point_response.go +++ b/models/product_price_point_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProductPricePointResponse represents a ProductPricePointResponse struct. type ProductPricePointResponse struct { - PricePoint ProductPricePoint `json:"price_point"` + PricePoint ProductPricePoint `json:"price_point"` } -// MarshalJSON implements the json.Marshaler interface for ProductPricePointResponse. +// MarshalJSON implements the json.Marshaler interface for ProductPricePointResponse. // It customizes the JSON marshaling process for ProductPricePointResponse objects. func (p *ProductPricePointResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductPricePointResponse object to a map representation for JSON marshaling. func (p *ProductPricePointResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["price_point"] = p.PricePoint - return structMap + structMap := make(map[string]any) + structMap["price_point"] = p.PricePoint.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointResponse. // It customizes the JSON unmarshaling process for ProductPricePointResponse objects. func (p *ProductPricePointResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoint ProductPricePoint `json:"price_point"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PricePoint = temp.PricePoint - return nil + temp := &struct { + PricePoint ProductPricePoint `json:"price_point"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PricePoint = temp.PricePoint + return nil } diff --git a/models/product_response.go b/models/product_response.go index ee0e6c8b..100a10e5 100644 --- a/models/product_response.go +++ b/models/product_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProductResponse represents a ProductResponse struct. type ProductResponse struct { - Product Product `json:"product"` + Product Product `json:"product"` } -// MarshalJSON implements the json.Marshaler interface for ProductResponse. +// MarshalJSON implements the json.Marshaler interface for ProductResponse. // It customizes the JSON marshaling process for ProductResponse objects. func (p *ProductResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProductResponse object to a map representation for JSON marshaling. func (p *ProductResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["product"] = p.Product - return structMap + structMap := make(map[string]any) + structMap["product"] = p.Product.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProductResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ProductResponse. // It customizes the JSON unmarshaling process for ProductResponse objects. func (p *ProductResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Product Product `json:"product"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Product = temp.Product - return nil + temp := &struct { + Product Product `json:"product"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Product = temp.Product + return nil } diff --git a/models/proforma_custom_field.go b/models/proforma_custom_field.go deleted file mode 100644 index cd82af98..00000000 --- a/models/proforma_custom_field.go +++ /dev/null @@ -1,66 +0,0 @@ -package models - -import ( - "encoding/json" -) - -// ProformaCustomField represents a ProformaCustomField struct. -type ProformaCustomField struct { - OwnerId *int `json:"owner_id,omitempty"` - OwnerType *string `json:"owner_type,omitempty"` - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - MetadatumId *int `json:"metadatum_id,omitempty"` -} - -// MarshalJSON implements the json.Marshaler interface for ProformaCustomField. -// It customizes the JSON marshaling process for ProformaCustomField objects. -func (p *ProformaCustomField) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) -} - -// toMap converts the ProformaCustomField object to a map representation for JSON marshaling. -func (p *ProformaCustomField) toMap() map[string]any { - structMap := make(map[string]any) - if p.OwnerId != nil { - structMap["owner_id"] = p.OwnerId - } - if p.OwnerType != nil { - structMap["owner_type"] = p.OwnerType - } - if p.Name != nil { - structMap["name"] = p.Name - } - if p.Value != nil { - structMap["value"] = p.Value - } - if p.MetadatumId != nil { - structMap["metadatum_id"] = p.MetadatumId - } - return structMap -} - -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaCustomField. -// It customizes the JSON unmarshaling process for ProformaCustomField objects. -func (p *ProformaCustomField) UnmarshalJSON(input []byte) error { - temp := &struct { - OwnerId *int `json:"owner_id,omitempty"` - OwnerType *string `json:"owner_type,omitempty"` - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - MetadatumId *int `json:"metadatum_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.OwnerId = temp.OwnerId - p.OwnerType = temp.OwnerType - p.Name = temp.Name - p.Value = temp.Value - p.MetadatumId = temp.MetadatumId - return nil -} diff --git a/models/proforma_error.go b/models/proforma_error.go index eabacd8d..b35412fd 100644 --- a/models/proforma_error.go +++ b/models/proforma_error.go @@ -1,43 +1,43 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaError represents a ProformaError struct. type ProformaError struct { - // The error is base if it is not directly associated with a single attribute. - Subscription *BaseStringError `json:"subscription,omitempty"` + // The error is base if it is not directly associated with a single attribute. + Subscription *BaseStringError `json:"subscription,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaError. +// MarshalJSON implements the json.Marshaler interface for ProformaError. // It customizes the JSON marshaling process for ProformaError objects. func (p *ProformaError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaError object to a map representation for JSON marshaling. func (p *ProformaError) toMap() map[string]any { - structMap := make(map[string]any) - if p.Subscription != nil { - structMap["subscription"] = p.Subscription - } - return structMap + structMap := make(map[string]any) + if p.Subscription != nil { + structMap["subscription"] = p.Subscription.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaError. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaError. // It customizes the JSON unmarshaling process for ProformaError objects. func (p *ProformaError) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscription *BaseStringError `json:"subscription,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Subscription = temp.Subscription - return nil + temp := &struct { + Subscription *BaseStringError `json:"subscription,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Subscription = temp.Subscription + return nil } diff --git a/models/proforma_invoice.go b/models/proforma_invoice.go index 243a02c7..04fb41b9 100644 --- a/models/proforma_invoice.go +++ b/models/proforma_invoice.go @@ -1,254 +1,254 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoice represents a ProformaInvoice struct. type ProformaInvoice struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *int `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - DeliveryDate *string `json:"delivery_date,omitempty"` - Status *string `json:"status,omitempty"` - CollectionMethod *string `json:"collection_method,omitempty"` - PaymentInstructions *string `json:"payment_instructions,omitempty"` - Currency *string `json:"currency,omitempty"` - ConsolidationLevel *string `json:"consolidation_level,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - Role *string `json:"role,omitempty"` - // Information about the seller (merchant) listed on the masthead of the invoice. - Seller *InvoiceSeller `json:"seller,omitempty"` - // Information about the customer who is owner or recipient the invoiced subscription. - Customer *InvoiceCustomer `json:"customer,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CreditAmount *string `json:"credit_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` - Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` - Credits []ProformaInvoiceCredit `json:"credits,omitempty"` - Payments []ProformaInvoicePayment `json:"payments,omitempty"` - CustomFields []ProformaCustomField `json:"custom_fields,omitempty"` - PublicUrl *string `json:"public_url,omitempty"` + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *int `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + DeliveryDate *string `json:"delivery_date,omitempty"` + Status *string `json:"status,omitempty"` + CollectionMethod *string `json:"collection_method,omitempty"` + PaymentInstructions *string `json:"payment_instructions,omitempty"` + Currency *string `json:"currency,omitempty"` + ConsolidationLevel *string `json:"consolidation_level,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + Role *string `json:"role,omitempty"` + // Information about the seller (merchant) listed on the masthead of the invoice. + Seller *InvoiceSeller `json:"seller,omitempty"` + // Information about the customer who is owner or recipient the invoiced subscription. + Customer *InvoiceCustomer `json:"customer,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CreditAmount *string `json:"credit_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` + Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` + Credits []ProformaInvoiceCredit `json:"credits,omitempty"` + Payments []ProformaInvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + PublicUrl *string `json:"public_url,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoice. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoice. // It customizes the JSON marshaling process for ProformaInvoice objects. func (p *ProformaInvoice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoice object to a map representation for JSON marshaling. func (p *ProformaInvoice) toMap() map[string]any { - structMap := make(map[string]any) - if p.Uid != nil { - structMap["uid"] = p.Uid - } - if p.SiteId != nil { - structMap["site_id"] = p.SiteId - } - if p.CustomerId != nil { - structMap["customer_id"] = p.CustomerId - } - if p.SubscriptionId != nil { - structMap["subscription_id"] = p.SubscriptionId - } - if p.Number != nil { - structMap["number"] = p.Number - } - if p.SequenceNumber != nil { - structMap["sequence_number"] = p.SequenceNumber - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt - } - if p.DeliveryDate != nil { - structMap["delivery_date"] = p.DeliveryDate - } - if p.Status != nil { - structMap["status"] = p.Status - } - if p.CollectionMethod != nil { - structMap["collection_method"] = p.CollectionMethod - } - if p.PaymentInstructions != nil { - structMap["payment_instructions"] = p.PaymentInstructions - } - if p.Currency != nil { - structMap["currency"] = p.Currency - } - if p.ConsolidationLevel != nil { - structMap["consolidation_level"] = p.ConsolidationLevel - } - if p.ProductName != nil { - structMap["product_name"] = p.ProductName - } - if p.ProductFamilyName != nil { - structMap["product_family_name"] = p.ProductFamilyName - } - if p.Role != nil { - structMap["role"] = p.Role - } - if p.Seller != nil { - structMap["seller"] = p.Seller - } - if p.Customer != nil { - structMap["customer"] = p.Customer - } - if p.Memo != nil { - structMap["memo"] = p.Memo - } - if p.BillingAddress != nil { - structMap["billing_address"] = p.BillingAddress - } - if p.ShippingAddress != nil { - structMap["shipping_address"] = p.ShippingAddress - } - if p.SubtotalAmount != nil { - structMap["subtotal_amount"] = p.SubtotalAmount - } - if p.DiscountAmount != nil { - structMap["discount_amount"] = p.DiscountAmount - } - if p.TaxAmount != nil { - structMap["tax_amount"] = p.TaxAmount - } - if p.TotalAmount != nil { - structMap["total_amount"] = p.TotalAmount - } - if p.CreditAmount != nil { - structMap["credit_amount"] = p.CreditAmount - } - if p.PaidAmount != nil { - structMap["paid_amount"] = p.PaidAmount - } - if p.RefundAmount != nil { - structMap["refund_amount"] = p.RefundAmount - } - if p.DueAmount != nil { - structMap["due_amount"] = p.DueAmount - } - if p.LineItems != nil { - structMap["line_items"] = p.LineItems - } - if p.Discounts != nil { - structMap["discounts"] = p.Discounts - } - if p.Taxes != nil { - structMap["taxes"] = p.Taxes - } - if p.Credits != nil { - structMap["credits"] = p.Credits - } - if p.Payments != nil { - structMap["payments"] = p.Payments - } - if p.CustomFields != nil { - structMap["custom_fields"] = p.CustomFields - } - if p.PublicUrl != nil { - structMap["public_url"] = p.PublicUrl - } - return structMap + structMap := make(map[string]any) + if p.Uid != nil { + structMap["uid"] = p.Uid + } + if p.SiteId != nil { + structMap["site_id"] = p.SiteId + } + if p.CustomerId != nil { + structMap["customer_id"] = p.CustomerId + } + if p.SubscriptionId != nil { + structMap["subscription_id"] = p.SubscriptionId + } + if p.Number != nil { + structMap["number"] = p.Number + } + if p.SequenceNumber != nil { + structMap["sequence_number"] = p.SequenceNumber + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt + } + if p.DeliveryDate != nil { + structMap["delivery_date"] = p.DeliveryDate + } + if p.Status != nil { + structMap["status"] = p.Status + } + if p.CollectionMethod != nil { + structMap["collection_method"] = p.CollectionMethod + } + if p.PaymentInstructions != nil { + structMap["payment_instructions"] = p.PaymentInstructions + } + if p.Currency != nil { + structMap["currency"] = p.Currency + } + if p.ConsolidationLevel != nil { + structMap["consolidation_level"] = p.ConsolidationLevel + } + if p.ProductName != nil { + structMap["product_name"] = p.ProductName + } + if p.ProductFamilyName != nil { + structMap["product_family_name"] = p.ProductFamilyName + } + if p.Role != nil { + structMap["role"] = p.Role + } + if p.Seller != nil { + structMap["seller"] = p.Seller.toMap() + } + if p.Customer != nil { + structMap["customer"] = p.Customer.toMap() + } + if p.Memo != nil { + structMap["memo"] = p.Memo + } + if p.BillingAddress != nil { + structMap["billing_address"] = p.BillingAddress.toMap() + } + if p.ShippingAddress != nil { + structMap["shipping_address"] = p.ShippingAddress.toMap() + } + if p.SubtotalAmount != nil { + structMap["subtotal_amount"] = p.SubtotalAmount + } + if p.DiscountAmount != nil { + structMap["discount_amount"] = p.DiscountAmount + } + if p.TaxAmount != nil { + structMap["tax_amount"] = p.TaxAmount + } + if p.TotalAmount != nil { + structMap["total_amount"] = p.TotalAmount + } + if p.CreditAmount != nil { + structMap["credit_amount"] = p.CreditAmount + } + if p.PaidAmount != nil { + structMap["paid_amount"] = p.PaidAmount + } + if p.RefundAmount != nil { + structMap["refund_amount"] = p.RefundAmount + } + if p.DueAmount != nil { + structMap["due_amount"] = p.DueAmount + } + if p.LineItems != nil { + structMap["line_items"] = p.LineItems + } + if p.Discounts != nil { + structMap["discounts"] = p.Discounts + } + if p.Taxes != nil { + structMap["taxes"] = p.Taxes + } + if p.Credits != nil { + structMap["credits"] = p.Credits + } + if p.Payments != nil { + structMap["payments"] = p.Payments + } + if p.CustomFields != nil { + structMap["custom_fields"] = p.CustomFields + } + if p.PublicUrl != nil { + structMap["public_url"] = p.PublicUrl + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoice. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoice. // It customizes the JSON unmarshaling process for ProformaInvoice objects. func (p *ProformaInvoice) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *int `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - DeliveryDate *string `json:"delivery_date,omitempty"` - Status *string `json:"status,omitempty"` - CollectionMethod *string `json:"collection_method,omitempty"` - PaymentInstructions *string `json:"payment_instructions,omitempty"` - Currency *string `json:"currency,omitempty"` - ConsolidationLevel *string `json:"consolidation_level,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - Role *string `json:"role,omitempty"` - Seller *InvoiceSeller `json:"seller,omitempty"` - Customer *InvoiceCustomer `json:"customer,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CreditAmount *string `json:"credit_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` - Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` - Credits []ProformaInvoiceCredit `json:"credits,omitempty"` - Payments []ProformaInvoicePayment `json:"payments,omitempty"` - CustomFields []ProformaCustomField `json:"custom_fields,omitempty"` - PublicUrl *string `json:"public_url,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Uid = temp.Uid - p.SiteId = temp.SiteId - p.CustomerId = temp.CustomerId - p.SubscriptionId = temp.SubscriptionId - p.Number = temp.Number - p.SequenceNumber = temp.SequenceNumber - p.CreatedAt = temp.CreatedAt - p.DeliveryDate = temp.DeliveryDate - p.Status = temp.Status - p.CollectionMethod = temp.CollectionMethod - p.PaymentInstructions = temp.PaymentInstructions - p.Currency = temp.Currency - p.ConsolidationLevel = temp.ConsolidationLevel - p.ProductName = temp.ProductName - p.ProductFamilyName = temp.ProductFamilyName - p.Role = temp.Role - p.Seller = temp.Seller - p.Customer = temp.Customer - p.Memo = temp.Memo - p.BillingAddress = temp.BillingAddress - p.ShippingAddress = temp.ShippingAddress - p.SubtotalAmount = temp.SubtotalAmount - p.DiscountAmount = temp.DiscountAmount - p.TaxAmount = temp.TaxAmount - p.TotalAmount = temp.TotalAmount - p.CreditAmount = temp.CreditAmount - p.PaidAmount = temp.PaidAmount - p.RefundAmount = temp.RefundAmount - p.DueAmount = temp.DueAmount - p.LineItems = temp.LineItems - p.Discounts = temp.Discounts - p.Taxes = temp.Taxes - p.Credits = temp.Credits - p.Payments = temp.Payments - p.CustomFields = temp.CustomFields - p.PublicUrl = temp.PublicUrl - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *int `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + DeliveryDate *string `json:"delivery_date,omitempty"` + Status *string `json:"status,omitempty"` + CollectionMethod *string `json:"collection_method,omitempty"` + PaymentInstructions *string `json:"payment_instructions,omitempty"` + Currency *string `json:"currency,omitempty"` + ConsolidationLevel *string `json:"consolidation_level,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + Role *string `json:"role,omitempty"` + Seller *InvoiceSeller `json:"seller,omitempty"` + Customer *InvoiceCustomer `json:"customer,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CreditAmount *string `json:"credit_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` + Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` + Credits []ProformaInvoiceCredit `json:"credits,omitempty"` + Payments []ProformaInvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + PublicUrl *string `json:"public_url,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Uid = temp.Uid + p.SiteId = temp.SiteId + p.CustomerId = temp.CustomerId + p.SubscriptionId = temp.SubscriptionId + p.Number = temp.Number + p.SequenceNumber = temp.SequenceNumber + p.CreatedAt = temp.CreatedAt + p.DeliveryDate = temp.DeliveryDate + p.Status = temp.Status + p.CollectionMethod = temp.CollectionMethod + p.PaymentInstructions = temp.PaymentInstructions + p.Currency = temp.Currency + p.ConsolidationLevel = temp.ConsolidationLevel + p.ProductName = temp.ProductName + p.ProductFamilyName = temp.ProductFamilyName + p.Role = temp.Role + p.Seller = temp.Seller + p.Customer = temp.Customer + p.Memo = temp.Memo + p.BillingAddress = temp.BillingAddress + p.ShippingAddress = temp.ShippingAddress + p.SubtotalAmount = temp.SubtotalAmount + p.DiscountAmount = temp.DiscountAmount + p.TaxAmount = temp.TaxAmount + p.TotalAmount = temp.TotalAmount + p.CreditAmount = temp.CreditAmount + p.PaidAmount = temp.PaidAmount + p.RefundAmount = temp.RefundAmount + p.DueAmount = temp.DueAmount + p.LineItems = temp.LineItems + p.Discounts = temp.Discounts + p.Taxes = temp.Taxes + p.Credits = temp.Credits + p.Payments = temp.Payments + p.CustomFields = temp.CustomFields + p.PublicUrl = temp.PublicUrl + return nil } diff --git a/models/proforma_invoice_credit.go b/models/proforma_invoice_credit.go index f5d8ee05..8cff0bff 100644 --- a/models/proforma_invoice_credit.go +++ b/models/proforma_invoice_credit.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoiceCredit represents a ProformaInvoiceCredit struct. type ProformaInvoiceCredit struct { - Uid *string `json:"uid,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` + Uid *string `json:"uid,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceCredit. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceCredit. // It customizes the JSON marshaling process for ProformaInvoiceCredit objects. func (p *ProformaInvoiceCredit) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoiceCredit object to a map representation for JSON marshaling. func (p *ProformaInvoiceCredit) toMap() map[string]any { - structMap := make(map[string]any) - if p.Uid != nil { - structMap["uid"] = p.Uid - } - if p.Memo != nil { - structMap["memo"] = p.Memo - } - if p.OriginalAmount != nil { - structMap["original_amount"] = p.OriginalAmount - } - if p.AppliedAmount != nil { - structMap["applied_amount"] = p.AppliedAmount - } - return structMap + structMap := make(map[string]any) + if p.Uid != nil { + structMap["uid"] = p.Uid + } + if p.Memo != nil { + structMap["memo"] = p.Memo + } + if p.OriginalAmount != nil { + structMap["original_amount"] = p.OriginalAmount + } + if p.AppliedAmount != nil { + structMap["applied_amount"] = p.AppliedAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceCredit. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceCredit. // It customizes the JSON unmarshaling process for ProformaInvoiceCredit objects. func (p *ProformaInvoiceCredit) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Uid = temp.Uid - p.Memo = temp.Memo - p.OriginalAmount = temp.OriginalAmount - p.AppliedAmount = temp.AppliedAmount - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Uid = temp.Uid + p.Memo = temp.Memo + p.OriginalAmount = temp.OriginalAmount + p.AppliedAmount = temp.AppliedAmount + return nil } diff --git a/models/proforma_invoice_discount.go b/models/proforma_invoice_discount.go index 1a7043b4..052b545f 100644 --- a/models/proforma_invoice_discount.go +++ b/models/proforma_invoice_discount.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoiceDiscount represents a ProformaInvoiceDiscount struct. type ProformaInvoiceDiscount struct { - Title *string `json:"title,omitempty"` - SourceType *string `json:"source_type,omitempty"` - DiscountType *string `json:"discount_type,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - LineItemBreakouts []ProformaInvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` + Title *string `json:"title,omitempty"` + SourceType *string `json:"source_type,omitempty"` + DiscountType *string `json:"discount_type,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + LineItemBreakouts []ProformaInvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscount. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscount. // It customizes the JSON marshaling process for ProformaInvoiceDiscount objects. func (p *ProformaInvoiceDiscount) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoiceDiscount object to a map representation for JSON marshaling. func (p *ProformaInvoiceDiscount) toMap() map[string]any { - structMap := make(map[string]any) - if p.Title != nil { - structMap["title"] = p.Title - } - if p.SourceType != nil { - structMap["source_type"] = p.SourceType - } - if p.DiscountType != nil { - structMap["discount_type"] = p.DiscountType - } - if p.EligibleAmount != nil { - structMap["eligible_amount"] = p.EligibleAmount - } - if p.DiscountAmount != nil { - structMap["discount_amount"] = p.DiscountAmount - } - if p.LineItemBreakouts != nil { - structMap["line_item_breakouts"] = p.LineItemBreakouts - } - return structMap + structMap := make(map[string]any) + if p.Title != nil { + structMap["title"] = p.Title + } + if p.SourceType != nil { + structMap["source_type"] = p.SourceType + } + if p.DiscountType != nil { + structMap["discount_type"] = p.DiscountType + } + if p.EligibleAmount != nil { + structMap["eligible_amount"] = p.EligibleAmount + } + if p.DiscountAmount != nil { + structMap["discount_amount"] = p.DiscountAmount + } + if p.LineItemBreakouts != nil { + structMap["line_item_breakouts"] = p.LineItemBreakouts + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscount. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscount. // It customizes the JSON unmarshaling process for ProformaInvoiceDiscount objects. func (p *ProformaInvoiceDiscount) UnmarshalJSON(input []byte) error { - temp := &struct { - Title *string `json:"title,omitempty"` - SourceType *string `json:"source_type,omitempty"` - DiscountType *string `json:"discount_type,omitempty"` - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - LineItemBreakouts []ProformaInvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Title = temp.Title - p.SourceType = temp.SourceType - p.DiscountType = temp.DiscountType - p.EligibleAmount = temp.EligibleAmount - p.DiscountAmount = temp.DiscountAmount - p.LineItemBreakouts = temp.LineItemBreakouts - return nil + temp := &struct { + Title *string `json:"title,omitempty"` + SourceType *string `json:"source_type,omitempty"` + DiscountType *string `json:"discount_type,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + LineItemBreakouts []ProformaInvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Title = temp.Title + p.SourceType = temp.SourceType + p.DiscountType = temp.DiscountType + p.EligibleAmount = temp.EligibleAmount + p.DiscountAmount = temp.DiscountAmount + p.LineItemBreakouts = temp.LineItemBreakouts + return nil } diff --git a/models/proforma_invoice_discount_breakout.go b/models/proforma_invoice_discount_breakout.go index d4e2159e..4e827c73 100644 --- a/models/proforma_invoice_discount_breakout.go +++ b/models/proforma_invoice_discount_breakout.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoiceDiscountBreakout represents a ProformaInvoiceDiscountBreakout struct. type ProformaInvoiceDiscountBreakout struct { - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscountBreakout. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscountBreakout. // It customizes the JSON marshaling process for ProformaInvoiceDiscountBreakout objects. func (p *ProformaInvoiceDiscountBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoiceDiscountBreakout object to a map representation for JSON marshaling. func (p *ProformaInvoiceDiscountBreakout) toMap() map[string]any { - structMap := make(map[string]any) - if p.EligibleAmount != nil { - structMap["eligible_amount"] = p.EligibleAmount - } - if p.DiscountAmount != nil { - structMap["discount_amount"] = p.DiscountAmount - } - return structMap + structMap := make(map[string]any) + if p.EligibleAmount != nil { + structMap["eligible_amount"] = p.EligibleAmount + } + if p.DiscountAmount != nil { + structMap["discount_amount"] = p.DiscountAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscountBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscountBreakout. // It customizes the JSON unmarshaling process for ProformaInvoiceDiscountBreakout objects. func (p *ProformaInvoiceDiscountBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - EligibleAmount *string `json:"eligible_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.EligibleAmount = temp.EligibleAmount - p.DiscountAmount = temp.DiscountAmount - return nil + temp := &struct { + EligibleAmount *string `json:"eligible_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.EligibleAmount = temp.EligibleAmount + p.DiscountAmount = temp.DiscountAmount + return nil } diff --git a/models/proforma_invoice_payment.go b/models/proforma_invoice_payment.go index 0fb7a432..654a2145 100644 --- a/models/proforma_invoice_payment.go +++ b/models/proforma_invoice_payment.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoicePayment represents a ProformaInvoicePayment struct. type ProformaInvoicePayment struct { - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - Prepayment *bool `json:"prepayment,omitempty"` + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + Prepayment *bool `json:"prepayment,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoicePayment. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoicePayment. // It customizes the JSON marshaling process for ProformaInvoicePayment objects. func (p *ProformaInvoicePayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoicePayment object to a map representation for JSON marshaling. func (p *ProformaInvoicePayment) toMap() map[string]any { - structMap := make(map[string]any) - if p.Memo != nil { - structMap["memo"] = p.Memo - } - if p.OriginalAmount != nil { - structMap["original_amount"] = p.OriginalAmount - } - if p.AppliedAmount != nil { - structMap["applied_amount"] = p.AppliedAmount - } - if p.Prepayment != nil { - structMap["prepayment"] = p.Prepayment - } - return structMap + structMap := make(map[string]any) + if p.Memo != nil { + structMap["memo"] = p.Memo + } + if p.OriginalAmount != nil { + structMap["original_amount"] = p.OriginalAmount + } + if p.AppliedAmount != nil { + structMap["applied_amount"] = p.AppliedAmount + } + if p.Prepayment != nil { + structMap["prepayment"] = p.Prepayment + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePayment. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePayment. // It customizes the JSON unmarshaling process for ProformaInvoicePayment objects. func (p *ProformaInvoicePayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Memo *string `json:"memo,omitempty"` - OriginalAmount *string `json:"original_amount,omitempty"` - AppliedAmount *string `json:"applied_amount,omitempty"` - Prepayment *bool `json:"prepayment,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Memo = temp.Memo - p.OriginalAmount = temp.OriginalAmount - p.AppliedAmount = temp.AppliedAmount - p.Prepayment = temp.Prepayment - return nil + temp := &struct { + Memo *string `json:"memo,omitempty"` + OriginalAmount *string `json:"original_amount,omitempty"` + AppliedAmount *string `json:"applied_amount,omitempty"` + Prepayment *bool `json:"prepayment,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Memo = temp.Memo + p.OriginalAmount = temp.OriginalAmount + p.AppliedAmount = temp.AppliedAmount + p.Prepayment = temp.Prepayment + return nil } diff --git a/models/proforma_invoice_preview.go b/models/proforma_invoice_preview.go index 37760d82..e9b80fea 100644 --- a/models/proforma_invoice_preview.go +++ b/models/proforma_invoice_preview.go @@ -1,254 +1,254 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoicePreview represents a ProformaInvoicePreview struct. type ProformaInvoicePreview struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *string `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - DeliveryDate *string `json:"delivery_date,omitempty"` - Status *string `json:"status,omitempty"` - CollectionMethod *string `json:"collection_method,omitempty"` - PaymentInstructions *string `json:"payment_instructions,omitempty"` - Currency *string `json:"currency,omitempty"` - ConsolidationLevel *string `json:"consolidation_level,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - Role *string `json:"role,omitempty"` - // Information about the seller (merchant) listed on the masthead of the invoice. - Seller *InvoiceSeller `json:"seller,omitempty"` - // Information about the customer who is owner or recipient the invoiced subscription. - Customer *InvoiceCustomer `json:"customer,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CreditAmount *string `json:"credit_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` - Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` - Credits []ProformaInvoiceCredit `json:"credits,omitempty"` - Payments []ProformaInvoicePayment `json:"payments,omitempty"` - CustomFields []ProformaCustomField `json:"custom_fields,omitempty"` - PublicUrl *string `json:"public_url,omitempty"` + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *string `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + DeliveryDate *string `json:"delivery_date,omitempty"` + Status *string `json:"status,omitempty"` + CollectionMethod *string `json:"collection_method,omitempty"` + PaymentInstructions *string `json:"payment_instructions,omitempty"` + Currency *string `json:"currency,omitempty"` + ConsolidationLevel *string `json:"consolidation_level,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + Role *string `json:"role,omitempty"` + // Information about the seller (merchant) listed on the masthead of the invoice. + Seller *InvoiceSeller `json:"seller,omitempty"` + // Information about the customer who is owner or recipient the invoiced subscription. + Customer *InvoiceCustomer `json:"customer,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CreditAmount *string `json:"credit_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` + Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` + Credits []ProformaInvoiceCredit `json:"credits,omitempty"` + Payments []ProformaInvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + PublicUrl *string `json:"public_url,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoicePreview. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoicePreview. // It customizes the JSON marshaling process for ProformaInvoicePreview objects. func (p *ProformaInvoicePreview) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoicePreview object to a map representation for JSON marshaling. func (p *ProformaInvoicePreview) toMap() map[string]any { - structMap := make(map[string]any) - if p.Uid != nil { - structMap["uid"] = p.Uid - } - if p.SiteId != nil { - structMap["site_id"] = p.SiteId - } - if p.CustomerId != nil { - structMap["customer_id"] = p.CustomerId - } - if p.SubscriptionId != nil { - structMap["subscription_id"] = p.SubscriptionId - } - if p.Number != nil { - structMap["number"] = p.Number - } - if p.SequenceNumber != nil { - structMap["sequence_number"] = p.SequenceNumber - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt - } - if p.DeliveryDate != nil { - structMap["delivery_date"] = p.DeliveryDate - } - if p.Status != nil { - structMap["status"] = p.Status - } - if p.CollectionMethod != nil { - structMap["collection_method"] = p.CollectionMethod - } - if p.PaymentInstructions != nil { - structMap["payment_instructions"] = p.PaymentInstructions - } - if p.Currency != nil { - structMap["currency"] = p.Currency - } - if p.ConsolidationLevel != nil { - structMap["consolidation_level"] = p.ConsolidationLevel - } - if p.ProductName != nil { - structMap["product_name"] = p.ProductName - } - if p.ProductFamilyName != nil { - structMap["product_family_name"] = p.ProductFamilyName - } - if p.Role != nil { - structMap["role"] = p.Role - } - if p.Seller != nil { - structMap["seller"] = p.Seller - } - if p.Customer != nil { - structMap["customer"] = p.Customer - } - if p.Memo != nil { - structMap["memo"] = p.Memo - } - if p.BillingAddress != nil { - structMap["billing_address"] = p.BillingAddress - } - if p.ShippingAddress != nil { - structMap["shipping_address"] = p.ShippingAddress - } - if p.SubtotalAmount != nil { - structMap["subtotal_amount"] = p.SubtotalAmount - } - if p.DiscountAmount != nil { - structMap["discount_amount"] = p.DiscountAmount - } - if p.TaxAmount != nil { - structMap["tax_amount"] = p.TaxAmount - } - if p.TotalAmount != nil { - structMap["total_amount"] = p.TotalAmount - } - if p.CreditAmount != nil { - structMap["credit_amount"] = p.CreditAmount - } - if p.PaidAmount != nil { - structMap["paid_amount"] = p.PaidAmount - } - if p.RefundAmount != nil { - structMap["refund_amount"] = p.RefundAmount - } - if p.DueAmount != nil { - structMap["due_amount"] = p.DueAmount - } - if p.LineItems != nil { - structMap["line_items"] = p.LineItems - } - if p.Discounts != nil { - structMap["discounts"] = p.Discounts - } - if p.Taxes != nil { - structMap["taxes"] = p.Taxes - } - if p.Credits != nil { - structMap["credits"] = p.Credits - } - if p.Payments != nil { - structMap["payments"] = p.Payments - } - if p.CustomFields != nil { - structMap["custom_fields"] = p.CustomFields - } - if p.PublicUrl != nil { - structMap["public_url"] = p.PublicUrl - } - return structMap + structMap := make(map[string]any) + if p.Uid != nil { + structMap["uid"] = p.Uid + } + if p.SiteId != nil { + structMap["site_id"] = p.SiteId + } + if p.CustomerId != nil { + structMap["customer_id"] = p.CustomerId + } + if p.SubscriptionId != nil { + structMap["subscription_id"] = p.SubscriptionId + } + if p.Number != nil { + structMap["number"] = p.Number + } + if p.SequenceNumber != nil { + structMap["sequence_number"] = p.SequenceNumber + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt + } + if p.DeliveryDate != nil { + structMap["delivery_date"] = p.DeliveryDate + } + if p.Status != nil { + structMap["status"] = p.Status + } + if p.CollectionMethod != nil { + structMap["collection_method"] = p.CollectionMethod + } + if p.PaymentInstructions != nil { + structMap["payment_instructions"] = p.PaymentInstructions + } + if p.Currency != nil { + structMap["currency"] = p.Currency + } + if p.ConsolidationLevel != nil { + structMap["consolidation_level"] = p.ConsolidationLevel + } + if p.ProductName != nil { + structMap["product_name"] = p.ProductName + } + if p.ProductFamilyName != nil { + structMap["product_family_name"] = p.ProductFamilyName + } + if p.Role != nil { + structMap["role"] = p.Role + } + if p.Seller != nil { + structMap["seller"] = p.Seller.toMap() + } + if p.Customer != nil { + structMap["customer"] = p.Customer.toMap() + } + if p.Memo != nil { + structMap["memo"] = p.Memo + } + if p.BillingAddress != nil { + structMap["billing_address"] = p.BillingAddress.toMap() + } + if p.ShippingAddress != nil { + structMap["shipping_address"] = p.ShippingAddress.toMap() + } + if p.SubtotalAmount != nil { + structMap["subtotal_amount"] = p.SubtotalAmount + } + if p.DiscountAmount != nil { + structMap["discount_amount"] = p.DiscountAmount + } + if p.TaxAmount != nil { + structMap["tax_amount"] = p.TaxAmount + } + if p.TotalAmount != nil { + structMap["total_amount"] = p.TotalAmount + } + if p.CreditAmount != nil { + structMap["credit_amount"] = p.CreditAmount + } + if p.PaidAmount != nil { + structMap["paid_amount"] = p.PaidAmount + } + if p.RefundAmount != nil { + structMap["refund_amount"] = p.RefundAmount + } + if p.DueAmount != nil { + structMap["due_amount"] = p.DueAmount + } + if p.LineItems != nil { + structMap["line_items"] = p.LineItems + } + if p.Discounts != nil { + structMap["discounts"] = p.Discounts + } + if p.Taxes != nil { + structMap["taxes"] = p.Taxes + } + if p.Credits != nil { + structMap["credits"] = p.Credits + } + if p.Payments != nil { + structMap["payments"] = p.Payments + } + if p.CustomFields != nil { + structMap["custom_fields"] = p.CustomFields + } + if p.PublicUrl != nil { + structMap["public_url"] = p.PublicUrl + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePreview. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePreview. // It customizes the JSON unmarshaling process for ProformaInvoicePreview objects. func (p *ProformaInvoicePreview) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - SiteId *int `json:"site_id,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Number *string `json:"number,omitempty"` - SequenceNumber *int `json:"sequence_number,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - DeliveryDate *string `json:"delivery_date,omitempty"` - Status *string `json:"status,omitempty"` - CollectionMethod *string `json:"collection_method,omitempty"` - PaymentInstructions *string `json:"payment_instructions,omitempty"` - Currency *string `json:"currency,omitempty"` - ConsolidationLevel *string `json:"consolidation_level,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ProductFamilyName *string `json:"product_family_name,omitempty"` - Role *string `json:"role,omitempty"` - Seller *InvoiceSeller `json:"seller,omitempty"` - Customer *InvoiceCustomer `json:"customer,omitempty"` - Memo *string `json:"memo,omitempty"` - BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` - ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` - SubtotalAmount *string `json:"subtotal_amount,omitempty"` - DiscountAmount *string `json:"discount_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - TotalAmount *string `json:"total_amount,omitempty"` - CreditAmount *string `json:"credit_amount,omitempty"` - PaidAmount *string `json:"paid_amount,omitempty"` - RefundAmount *string `json:"refund_amount,omitempty"` - DueAmount *string `json:"due_amount,omitempty"` - LineItems []InvoiceLineItem `json:"line_items,omitempty"` - Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` - Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` - Credits []ProformaInvoiceCredit `json:"credits,omitempty"` - Payments []ProformaInvoicePayment `json:"payments,omitempty"` - CustomFields []ProformaCustomField `json:"custom_fields,omitempty"` - PublicUrl *string `json:"public_url,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Uid = temp.Uid - p.SiteId = temp.SiteId - p.CustomerId = temp.CustomerId - p.SubscriptionId = temp.SubscriptionId - p.Number = temp.Number - p.SequenceNumber = temp.SequenceNumber - p.CreatedAt = temp.CreatedAt - p.DeliveryDate = temp.DeliveryDate - p.Status = temp.Status - p.CollectionMethod = temp.CollectionMethod - p.PaymentInstructions = temp.PaymentInstructions - p.Currency = temp.Currency - p.ConsolidationLevel = temp.ConsolidationLevel - p.ProductName = temp.ProductName - p.ProductFamilyName = temp.ProductFamilyName - p.Role = temp.Role - p.Seller = temp.Seller - p.Customer = temp.Customer - p.Memo = temp.Memo - p.BillingAddress = temp.BillingAddress - p.ShippingAddress = temp.ShippingAddress - p.SubtotalAmount = temp.SubtotalAmount - p.DiscountAmount = temp.DiscountAmount - p.TaxAmount = temp.TaxAmount - p.TotalAmount = temp.TotalAmount - p.CreditAmount = temp.CreditAmount - p.PaidAmount = temp.PaidAmount - p.RefundAmount = temp.RefundAmount - p.DueAmount = temp.DueAmount - p.LineItems = temp.LineItems - p.Discounts = temp.Discounts - p.Taxes = temp.Taxes - p.Credits = temp.Credits - p.Payments = temp.Payments - p.CustomFields = temp.CustomFields - p.PublicUrl = temp.PublicUrl - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + SiteId *int `json:"site_id,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Number *string `json:"number,omitempty"` + SequenceNumber *int `json:"sequence_number,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + DeliveryDate *string `json:"delivery_date,omitempty"` + Status *string `json:"status,omitempty"` + CollectionMethod *string `json:"collection_method,omitempty"` + PaymentInstructions *string `json:"payment_instructions,omitempty"` + Currency *string `json:"currency,omitempty"` + ConsolidationLevel *string `json:"consolidation_level,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ProductFamilyName *string `json:"product_family_name,omitempty"` + Role *string `json:"role,omitempty"` + Seller *InvoiceSeller `json:"seller,omitempty"` + Customer *InvoiceCustomer `json:"customer,omitempty"` + Memo *string `json:"memo,omitempty"` + BillingAddress *InvoiceAddress `json:"billing_address,omitempty"` + ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"` + SubtotalAmount *string `json:"subtotal_amount,omitempty"` + DiscountAmount *string `json:"discount_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + TotalAmount *string `json:"total_amount,omitempty"` + CreditAmount *string `json:"credit_amount,omitempty"` + PaidAmount *string `json:"paid_amount,omitempty"` + RefundAmount *string `json:"refund_amount,omitempty"` + DueAmount *string `json:"due_amount,omitempty"` + LineItems []InvoiceLineItem `json:"line_items,omitempty"` + Discounts []ProformaInvoiceDiscount `json:"discounts,omitempty"` + Taxes []ProformaInvoiceTax `json:"taxes,omitempty"` + Credits []ProformaInvoiceCredit `json:"credits,omitempty"` + Payments []ProformaInvoicePayment `json:"payments,omitempty"` + CustomFields []InvoiceCustomField `json:"custom_fields,omitempty"` + PublicUrl *string `json:"public_url,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Uid = temp.Uid + p.SiteId = temp.SiteId + p.CustomerId = temp.CustomerId + p.SubscriptionId = temp.SubscriptionId + p.Number = temp.Number + p.SequenceNumber = temp.SequenceNumber + p.CreatedAt = temp.CreatedAt + p.DeliveryDate = temp.DeliveryDate + p.Status = temp.Status + p.CollectionMethod = temp.CollectionMethod + p.PaymentInstructions = temp.PaymentInstructions + p.Currency = temp.Currency + p.ConsolidationLevel = temp.ConsolidationLevel + p.ProductName = temp.ProductName + p.ProductFamilyName = temp.ProductFamilyName + p.Role = temp.Role + p.Seller = temp.Seller + p.Customer = temp.Customer + p.Memo = temp.Memo + p.BillingAddress = temp.BillingAddress + p.ShippingAddress = temp.ShippingAddress + p.SubtotalAmount = temp.SubtotalAmount + p.DiscountAmount = temp.DiscountAmount + p.TaxAmount = temp.TaxAmount + p.TotalAmount = temp.TotalAmount + p.CreditAmount = temp.CreditAmount + p.PaidAmount = temp.PaidAmount + p.RefundAmount = temp.RefundAmount + p.DueAmount = temp.DueAmount + p.LineItems = temp.LineItems + p.Discounts = temp.Discounts + p.Taxes = temp.Taxes + p.Credits = temp.Credits + p.Payments = temp.Payments + p.CustomFields = temp.CustomFields + p.PublicUrl = temp.PublicUrl + return nil } diff --git a/models/proforma_invoice_tax.go b/models/proforma_invoice_tax.go index 860ff521..2be99cd3 100644 --- a/models/proforma_invoice_tax.go +++ b/models/proforma_invoice_tax.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoiceTax represents a ProformaInvoiceTax struct. type ProformaInvoiceTax struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - SourceType *string `json:"source_type,omitempty"` - Percentage *string `json:"percentage,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - LineItemBreakouts []ProformaInvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + SourceType *string `json:"source_type,omitempty"` + Percentage *string `json:"percentage,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + LineItemBreakouts []ProformaInvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTax. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTax. // It customizes the JSON marshaling process for ProformaInvoiceTax objects. func (p *ProformaInvoiceTax) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoiceTax object to a map representation for JSON marshaling. func (p *ProformaInvoiceTax) toMap() map[string]any { - structMap := make(map[string]any) - if p.Uid != nil { - structMap["uid"] = p.Uid - } - if p.Title != nil { - structMap["title"] = p.Title - } - if p.SourceType != nil { - structMap["source_type"] = p.SourceType - } - if p.Percentage != nil { - structMap["percentage"] = p.Percentage - } - if p.TaxableAmount != nil { - structMap["taxable_amount"] = p.TaxableAmount - } - if p.TaxAmount != nil { - structMap["tax_amount"] = p.TaxAmount - } - if p.LineItemBreakouts != nil { - structMap["line_item_breakouts"] = p.LineItemBreakouts - } - return structMap + structMap := make(map[string]any) + if p.Uid != nil { + structMap["uid"] = p.Uid + } + if p.Title != nil { + structMap["title"] = p.Title + } + if p.SourceType != nil { + structMap["source_type"] = p.SourceType + } + if p.Percentage != nil { + structMap["percentage"] = p.Percentage + } + if p.TaxableAmount != nil { + structMap["taxable_amount"] = p.TaxableAmount + } + if p.TaxAmount != nil { + structMap["tax_amount"] = p.TaxAmount + } + if p.LineItemBreakouts != nil { + structMap["line_item_breakouts"] = p.LineItemBreakouts + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTax. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTax. // It customizes the JSON unmarshaling process for ProformaInvoiceTax objects. func (p *ProformaInvoiceTax) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Title *string `json:"title,omitempty"` - SourceType *string `json:"source_type,omitempty"` - Percentage *string `json:"percentage,omitempty"` - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - LineItemBreakouts []ProformaInvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Uid = temp.Uid - p.Title = temp.Title - p.SourceType = temp.SourceType - p.Percentage = temp.Percentage - p.TaxableAmount = temp.TaxableAmount - p.TaxAmount = temp.TaxAmount - p.LineItemBreakouts = temp.LineItemBreakouts - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Title *string `json:"title,omitempty"` + SourceType *string `json:"source_type,omitempty"` + Percentage *string `json:"percentage,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + LineItemBreakouts []ProformaInvoiceTaxBreakout `json:"line_item_breakouts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Uid = temp.Uid + p.Title = temp.Title + p.SourceType = temp.SourceType + p.Percentage = temp.Percentage + p.TaxableAmount = temp.TaxableAmount + p.TaxAmount = temp.TaxAmount + p.LineItemBreakouts = temp.LineItemBreakouts + return nil } diff --git a/models/proforma_invoice_tax_breakout.go b/models/proforma_invoice_tax_breakout.go index 7a834f49..a3b5ac9b 100644 --- a/models/proforma_invoice_tax_breakout.go +++ b/models/proforma_invoice_tax_breakout.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ProformaInvoiceTaxBreakout represents a ProformaInvoiceTaxBreakout struct. type ProformaInvoiceTaxBreakout struct { - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTaxBreakout. +// MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTaxBreakout. // It customizes the JSON marshaling process for ProformaInvoiceTaxBreakout objects. func (p *ProformaInvoiceTaxBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the ProformaInvoiceTaxBreakout object to a map representation for JSON marshaling. func (p *ProformaInvoiceTaxBreakout) toMap() map[string]any { - structMap := make(map[string]any) - if p.TaxableAmount != nil { - structMap["taxable_amount"] = p.TaxableAmount - } - if p.TaxAmount != nil { - structMap["tax_amount"] = p.TaxAmount - } - return structMap + structMap := make(map[string]any) + if p.TaxableAmount != nil { + structMap["taxable_amount"] = p.TaxableAmount + } + if p.TaxAmount != nil { + structMap["tax_amount"] = p.TaxAmount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTaxBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTaxBreakout. // It customizes the JSON unmarshaling process for ProformaInvoiceTaxBreakout objects. func (p *ProformaInvoiceTaxBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - TaxableAmount *string `json:"taxable_amount,omitempty"` - TaxAmount *string `json:"tax_amount,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.TaxableAmount = temp.TaxableAmount - p.TaxAmount = temp.TaxAmount - return nil + temp := &struct { + TaxableAmount *string `json:"taxable_amount,omitempty"` + TaxAmount *string `json:"tax_amount,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.TaxableAmount = temp.TaxableAmount + p.TaxAmount = temp.TaxAmount + return nil } diff --git a/models/proration.go b/models/proration.go index cb8f4a5d..65ef5474 100644 --- a/models/proration.go +++ b/models/proration.go @@ -1,43 +1,43 @@ package models import ( - "encoding/json" + "encoding/json" ) // Proration represents a Proration struct. type Proration struct { - // The alternative to sending preserve_period as a direct attribute to migration - PreservePeriod *bool `json:"preserve_period,omitempty"` + // The alternative to sending preserve_period as a direct attribute to migration + PreservePeriod *bool `json:"preserve_period,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Proration. +// MarshalJSON implements the json.Marshaler interface for Proration. // It customizes the JSON marshaling process for Proration objects. func (p *Proration) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the Proration object to a map representation for JSON marshaling. func (p *Proration) toMap() map[string]any { - structMap := make(map[string]any) - if p.PreservePeriod != nil { - structMap["preserve_period"] = p.PreservePeriod - } - return structMap + structMap := make(map[string]any) + if p.PreservePeriod != nil { + structMap["preserve_period"] = p.PreservePeriod + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Proration. +// UnmarshalJSON implements the json.Unmarshaler interface for Proration. // It customizes the JSON unmarshaling process for Proration objects. func (p *Proration) UnmarshalJSON(input []byte) error { - temp := &struct { - PreservePeriod *bool `json:"preserve_period,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PreservePeriod = temp.PreservePeriod - return nil + temp := &struct { + PreservePeriod *bool `json:"preserve_period,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PreservePeriod = temp.PreservePeriod + return nil } diff --git a/models/public_key.go b/models/public_key.go index 127e5835..b863cad2 100644 --- a/models/public_key.go +++ b/models/public_key.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // PublicKey represents a PublicKey struct. type PublicKey struct { - PublicKey *string `json:"public_key,omitempty"` - RequiresSecurityToken *bool `json:"requires_security_token,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` + PublicKey *string `json:"public_key,omitempty"` + RequiresSecurityToken *bool `json:"requires_security_token,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PublicKey. +// MarshalJSON implements the json.Marshaler interface for PublicKey. // It customizes the JSON marshaling process for PublicKey objects. func (p *PublicKey) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PublicKey object to a map representation for JSON marshaling. func (p *PublicKey) toMap() map[string]any { - structMap := make(map[string]any) - if p.PublicKey != nil { - structMap["public_key"] = p.PublicKey - } - if p.RequiresSecurityToken != nil { - structMap["requires_security_token"] = p.RequiresSecurityToken - } - if p.CreatedAt != nil { - structMap["created_at"] = p.CreatedAt - } - return structMap + structMap := make(map[string]any) + if p.PublicKey != nil { + structMap["public_key"] = p.PublicKey + } + if p.RequiresSecurityToken != nil { + structMap["requires_security_token"] = p.RequiresSecurityToken + } + if p.CreatedAt != nil { + structMap["created_at"] = p.CreatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PublicKey. +// UnmarshalJSON implements the json.Unmarshaler interface for PublicKey. // It customizes the JSON unmarshaling process for PublicKey objects. func (p *PublicKey) UnmarshalJSON(input []byte) error { - temp := &struct { - PublicKey *string `json:"public_key,omitempty"` - RequiresSecurityToken *bool `json:"requires_security_token,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.PublicKey = temp.PublicKey - p.RequiresSecurityToken = temp.RequiresSecurityToken - p.CreatedAt = temp.CreatedAt - return nil + temp := &struct { + PublicKey *string `json:"public_key,omitempty"` + RequiresSecurityToken *bool `json:"requires_security_token,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.PublicKey = temp.PublicKey + p.RequiresSecurityToken = temp.RequiresSecurityToken + p.CreatedAt = temp.CreatedAt + return nil } diff --git a/models/public_signup_page.go b/models/public_signup_page.go index 748c6e31..551e1c8a 100644 --- a/models/public_signup_page.go +++ b/models/public_signup_page.go @@ -1,64 +1,64 @@ package models import ( - "encoding/json" + "encoding/json" ) // PublicSignupPage represents a PublicSignupPage struct. type PublicSignupPage struct { - // The id of the signup page (public_signup_pages only) - Id *int `json:"id,omitempty"` - // The url to which a customer will be returned after a successful signup (public_signup_pages only) - ReturnUrl Optional[string] `json:"return_url"` - // The params to be appended to the return_url (public_signup_pages only) - ReturnParams Optional[string] `json:"return_params"` - // The url where the signup page can be viewed (public_signup_pages only) - Url *string `json:"url,omitempty"` + // The id of the signup page (public_signup_pages only) + Id *int `json:"id,omitempty"` + // The url to which a customer will be returned after a successful signup (public_signup_pages only) + ReturnUrl Optional[string] `json:"return_url"` + // The params to be appended to the return_url (public_signup_pages only) + ReturnParams Optional[string] `json:"return_params"` + // The url where the signup page can be viewed (public_signup_pages only) + Url *string `json:"url,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for PublicSignupPage. +// MarshalJSON implements the json.Marshaler interface for PublicSignupPage. // It customizes the JSON marshaling process for PublicSignupPage objects. func (p *PublicSignupPage) MarshalJSON() ( - []byte, - error) { - return json.Marshal(p.toMap()) + []byte, + error) { + return json.Marshal(p.toMap()) } // toMap converts the PublicSignupPage object to a map representation for JSON marshaling. func (p *PublicSignupPage) toMap() map[string]any { - structMap := make(map[string]any) - if p.Id != nil { - structMap["id"] = p.Id - } - if p.ReturnUrl.IsValueSet() { - structMap["return_url"] = p.ReturnUrl.Value() - } - if p.ReturnParams.IsValueSet() { - structMap["return_params"] = p.ReturnParams.Value() - } - if p.Url != nil { - structMap["url"] = p.Url - } - return structMap + structMap := make(map[string]any) + if p.Id != nil { + structMap["id"] = p.Id + } + if p.ReturnUrl.IsValueSet() { + structMap["return_url"] = p.ReturnUrl.Value() + } + if p.ReturnParams.IsValueSet() { + structMap["return_params"] = p.ReturnParams.Value() + } + if p.Url != nil { + structMap["url"] = p.Url + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for PublicSignupPage. +// UnmarshalJSON implements the json.Unmarshaler interface for PublicSignupPage. // It customizes the JSON unmarshaling process for PublicSignupPage objects. func (p *PublicSignupPage) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - ReturnUrl Optional[string] `json:"return_url"` - ReturnParams Optional[string] `json:"return_params"` - Url *string `json:"url,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - p.Id = temp.Id - p.ReturnUrl = temp.ReturnUrl - p.ReturnParams = temp.ReturnParams - p.Url = temp.Url - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + ReturnUrl Optional[string] `json:"return_url"` + ReturnParams Optional[string] `json:"return_params"` + Url *string `json:"url,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + p.Id = temp.Id + p.ReturnUrl = temp.ReturnUrl + p.ReturnParams = temp.ReturnParams + p.Url = temp.Url + return nil } diff --git a/models/quantity_based_component.go b/models/quantity_based_component.go index 31599e26..979e6b64 100644 --- a/models/quantity_based_component.go +++ b/models/quantity_based_component.go @@ -1,167 +1,167 @@ package models import ( - "encoding/json" + "encoding/json" ) // QuantityBasedComponent represents a QuantityBasedComponent struct. type QuantityBasedComponent struct { - // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". - Name string `json:"name"` - // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item - UnitName string `json:"unit_name"` - // A description for the component that will be displayed to the user on the hosted signup page. - Description *string `json:"description,omitempty"` - // 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 '_'. - Handle *string `json:"handle,omitempty"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. - Prices []Price `json:"prices,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice *interface{} `json:"unit_price,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode *string `json:"tax_code,omitempty"` - // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - // deprecated May 2011 - use unit_price instead - PriceInCents *string `json:"price_in_cents,omitempty"` - Recurring *bool `json:"recurring,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + // A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". + Name string `json:"name"` + // The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item + UnitName string `json:"unit_name"` + // A description for the component that will be displayed to the user on the hosted signup page. + Description *string `json:"description,omitempty"` + // 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 '_'. + Handle *string `json:"handle,omitempty"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + // (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. + Prices []Price `json:"prices,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + // The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice *interface{} `json:"unit_price,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode *string `json:"tax_code,omitempty"` + // (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + // deprecated May 2011 - use unit_price instead + PriceInCents *string `json:"price_in_cents,omitempty"` + Recurring *bool `json:"recurring,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for QuantityBasedComponent. +// MarshalJSON implements the json.Marshaler interface for QuantityBasedComponent. // It customizes the JSON marshaling process for QuantityBasedComponent objects. func (q *QuantityBasedComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(q.toMap()) + []byte, + error) { + return json.Marshal(q.toMap()) } // toMap converts the QuantityBasedComponent object to a map representation for JSON marshaling. func (q *QuantityBasedComponent) toMap() map[string]any { - structMap := make(map[string]any) - structMap["name"] = q.Name - structMap["unit_name"] = q.UnitName - if q.Description != nil { - structMap["description"] = q.Description - } - if q.Handle != nil { - structMap["handle"] = q.Handle - } - if q.Taxable != nil { - structMap["taxable"] = q.Taxable - } - structMap["pricing_scheme"] = q.PricingScheme - if q.Prices != nil { - structMap["prices"] = q.Prices - } - if q.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = q.UpgradeCharge.Value() - } - if q.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = q.DowngradeCredit.Value() - } - if q.PricePoints != nil { - structMap["price_points"] = q.PricePoints - } - if q.UnitPrice != nil { - structMap["unit_price"] = q.UnitPrice - } - if q.TaxCode != nil { - structMap["tax_code"] = q.TaxCode - } - if q.HideDateRangeOnInvoice != nil { - structMap["hide_date_range_on_invoice"] = q.HideDateRangeOnInvoice - } - if q.PriceInCents != nil { - structMap["price_in_cents"] = q.PriceInCents - } - if q.Recurring != nil { - structMap["recurring"] = q.Recurring - } - if q.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = q.DisplayOnHostedPage - } - if q.AllowFractionalQuantities != nil { - structMap["allow_fractional_quantities"] = q.AllowFractionalQuantities - } - if q.PublicSignupPageIds != nil { - structMap["public_signup_page_ids"] = q.PublicSignupPageIds - } - if q.Interval != nil { - structMap["interval"] = q.Interval - } - if q.IntervalUnit != nil { - structMap["interval_unit"] = q.IntervalUnit - } - return structMap + structMap := make(map[string]any) + structMap["name"] = q.Name + structMap["unit_name"] = q.UnitName + if q.Description != nil { + structMap["description"] = q.Description + } + if q.Handle != nil { + structMap["handle"] = q.Handle + } + if q.Taxable != nil { + structMap["taxable"] = q.Taxable + } + structMap["pricing_scheme"] = q.PricingScheme + if q.Prices != nil { + structMap["prices"] = q.Prices + } + if q.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = q.UpgradeCharge.Value() + } + if q.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = q.DowngradeCredit.Value() + } + if q.PricePoints != nil { + structMap["price_points"] = q.PricePoints + } + if q.UnitPrice != nil { + structMap["unit_price"] = q.UnitPrice + } + if q.TaxCode != nil { + structMap["tax_code"] = q.TaxCode + } + if q.HideDateRangeOnInvoice != nil { + structMap["hide_date_range_on_invoice"] = q.HideDateRangeOnInvoice + } + if q.PriceInCents != nil { + structMap["price_in_cents"] = q.PriceInCents + } + if q.Recurring != nil { + structMap["recurring"] = q.Recurring + } + if q.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = q.DisplayOnHostedPage + } + if q.AllowFractionalQuantities != nil { + structMap["allow_fractional_quantities"] = q.AllowFractionalQuantities + } + if q.PublicSignupPageIds != nil { + structMap["public_signup_page_ids"] = q.PublicSignupPageIds + } + if q.Interval != nil { + structMap["interval"] = q.Interval + } + if q.IntervalUnit != nil { + structMap["interval_unit"] = q.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for QuantityBasedComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for QuantityBasedComponent. // It customizes the JSON unmarshaling process for QuantityBasedComponent objects. func (q *QuantityBasedComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Name string `json:"name"` - UnitName string `json:"unit_name"` - Description *string `json:"description,omitempty"` - Handle *string `json:"handle,omitempty"` - Taxable *bool `json:"taxable,omitempty"` - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []Price `json:"prices,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - TaxCode *string `json:"tax_code,omitempty"` - HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` - PriceInCents *string `json:"price_in_cents,omitempty"` - Recurring *bool `json:"recurring,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - q.Name = temp.Name - q.UnitName = temp.UnitName - q.Description = temp.Description - q.Handle = temp.Handle - q.Taxable = temp.Taxable - q.PricingScheme = temp.PricingScheme - q.Prices = temp.Prices - q.UpgradeCharge = temp.UpgradeCharge - q.DowngradeCredit = temp.DowngradeCredit - q.PricePoints = temp.PricePoints - q.UnitPrice = temp.UnitPrice - q.TaxCode = temp.TaxCode - q.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice - q.PriceInCents = temp.PriceInCents - q.Recurring = temp.Recurring - q.DisplayOnHostedPage = temp.DisplayOnHostedPage - q.AllowFractionalQuantities = temp.AllowFractionalQuantities - q.PublicSignupPageIds = temp.PublicSignupPageIds - q.Interval = temp.Interval - q.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + Name string `json:"name"` + UnitName string `json:"unit_name"` + Description *string `json:"description,omitempty"` + Handle *string `json:"handle,omitempty"` + Taxable *bool `json:"taxable,omitempty"` + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []Price `json:"prices,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + PricePoints []ComponentPricePointItem `json:"price_points,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + TaxCode *string `json:"tax_code,omitempty"` + HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"` + PriceInCents *string `json:"price_in_cents,omitempty"` + Recurring *bool `json:"recurring,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + PublicSignupPageIds []int `json:"public_signup_page_ids,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + q.Name = temp.Name + q.UnitName = temp.UnitName + q.Description = temp.Description + q.Handle = temp.Handle + q.Taxable = temp.Taxable + q.PricingScheme = temp.PricingScheme + q.Prices = temp.Prices + q.UpgradeCharge = temp.UpgradeCharge + q.DowngradeCredit = temp.DowngradeCredit + q.PricePoints = temp.PricePoints + q.UnitPrice = temp.UnitPrice + q.TaxCode = temp.TaxCode + q.HideDateRangeOnInvoice = temp.HideDateRangeOnInvoice + q.PriceInCents = temp.PriceInCents + q.Recurring = temp.Recurring + q.DisplayOnHostedPage = temp.DisplayOnHostedPage + q.AllowFractionalQuantities = temp.AllowFractionalQuantities + q.PublicSignupPageIds = temp.PublicSignupPageIds + q.Interval = temp.Interval + q.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/reactivate_subscription_group_request.go b/models/reactivate_subscription_group_request.go index 2e44ccd0..6851d658 100644 --- a/models/reactivate_subscription_group_request.go +++ b/models/reactivate_subscription_group_request.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReactivateSubscriptionGroupRequest represents a ReactivateSubscriptionGroupRequest struct. type ReactivateSubscriptionGroupRequest struct { - Resume *bool `json:"resume,omitempty"` - ResumeMembers *bool `json:"resume_members,omitempty"` + Resume *bool `json:"resume,omitempty"` + ResumeMembers *bool `json:"resume_members,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupRequest. +// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupRequest. // It customizes the JSON marshaling process for ReactivateSubscriptionGroupRequest objects. func (r *ReactivateSubscriptionGroupRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReactivateSubscriptionGroupRequest object to a map representation for JSON marshaling. func (r *ReactivateSubscriptionGroupRequest) toMap() map[string]any { - structMap := make(map[string]any) - if r.Resume != nil { - structMap["resume"] = r.Resume - } - if r.ResumeMembers != nil { - structMap["resume_members"] = r.ResumeMembers - } - return structMap + structMap := make(map[string]any) + if r.Resume != nil { + structMap["resume"] = r.Resume + } + if r.ResumeMembers != nil { + structMap["resume_members"] = r.ResumeMembers + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupRequest. // It customizes the JSON unmarshaling process for ReactivateSubscriptionGroupRequest objects. func (r *ReactivateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Resume *bool `json:"resume,omitempty"` - ResumeMembers *bool `json:"resume_members,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Resume = temp.Resume - r.ResumeMembers = temp.ResumeMembers - return nil + temp := &struct { + Resume *bool `json:"resume,omitempty"` + ResumeMembers *bool `json:"resume_members,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Resume = temp.Resume + r.ResumeMembers = temp.ResumeMembers + return nil } diff --git a/models/reactivate_subscription_group_response.go b/models/reactivate_subscription_group_response.go index 8907a4b7..37539ef5 100644 --- a/models/reactivate_subscription_group_response.go +++ b/models/reactivate_subscription_group_response.go @@ -1,90 +1,90 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReactivateSubscriptionGroupResponse represents a ReactivateSubscriptionGroupResponse struct. type ReactivateSubscriptionGroupResponse struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupResponse. +// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupResponse. // It customizes the JSON marshaling process for ReactivateSubscriptionGroupResponse objects. func (r *ReactivateSubscriptionGroupResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReactivateSubscriptionGroupResponse object to a map representation for JSON marshaling. func (r *ReactivateSubscriptionGroupResponse) toMap() map[string]any { - structMap := make(map[string]any) - if r.Uid != nil { - structMap["uid"] = r.Uid - } - if r.Scheme != nil { - structMap["scheme"] = r.Scheme - } - if r.CustomerId != nil { - structMap["customer_id"] = r.CustomerId - } - if r.PaymentProfileId != nil { - structMap["payment_profile_id"] = r.PaymentProfileId - } - if r.SubscriptionIds != nil { - structMap["subscription_ids"] = r.SubscriptionIds - } - if r.PrimarySubscriptionId != nil { - structMap["primary_subscription_id"] = r.PrimarySubscriptionId - } - if r.NextAssessmentAt != nil { - structMap["next_assessment_at"] = r.NextAssessmentAt - } - if r.State != nil { - structMap["state"] = r.State - } - if r.CancelAtEndOfPeriod != nil { - structMap["cancel_at_end_of_period"] = r.CancelAtEndOfPeriod - } - return structMap + structMap := make(map[string]any) + if r.Uid != nil { + structMap["uid"] = r.Uid + } + if r.Scheme != nil { + structMap["scheme"] = r.Scheme + } + if r.CustomerId != nil { + structMap["customer_id"] = r.CustomerId + } + if r.PaymentProfileId != nil { + structMap["payment_profile_id"] = r.PaymentProfileId + } + if r.SubscriptionIds != nil { + structMap["subscription_ids"] = r.SubscriptionIds + } + if r.PrimarySubscriptionId != nil { + structMap["primary_subscription_id"] = r.PrimarySubscriptionId + } + if r.NextAssessmentAt != nil { + structMap["next_assessment_at"] = r.NextAssessmentAt + } + if r.State != nil { + structMap["state"] = r.State + } + if r.CancelAtEndOfPeriod != nil { + structMap["cancel_at_end_of_period"] = r.CancelAtEndOfPeriod + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupResponse. // It customizes the JSON unmarshaling process for ReactivateSubscriptionGroupResponse objects. func (r *ReactivateSubscriptionGroupResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Uid = temp.Uid - r.Scheme = temp.Scheme - r.CustomerId = temp.CustomerId - r.PaymentProfileId = temp.PaymentProfileId - r.SubscriptionIds = temp.SubscriptionIds - r.PrimarySubscriptionId = temp.PrimarySubscriptionId - r.NextAssessmentAt = temp.NextAssessmentAt - r.State = temp.State - r.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Uid = temp.Uid + r.Scheme = temp.Scheme + r.CustomerId = temp.CustomerId + r.PaymentProfileId = temp.PaymentProfileId + r.SubscriptionIds = temp.SubscriptionIds + r.PrimarySubscriptionId = temp.PrimarySubscriptionId + r.NextAssessmentAt = temp.NextAssessmentAt + r.State = temp.State + r.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod + return nil } diff --git a/models/reactivate_subscription_request.go b/models/reactivate_subscription_request.go index dc5ce20c..09ffc66c 100644 --- a/models/reactivate_subscription_request.go +++ b/models/reactivate_subscription_request.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReactivateSubscriptionRequest represents a ReactivateSubscriptionRequest struct. type ReactivateSubscriptionRequest struct { - // These values are only applicable to subscriptions using calendar billing - CalendarBilling *ReactivationBilling `json:"calendar_billing,omitempty"` - // 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. - IncludeTrial *bool `json:"include_trial,omitempty"` - // If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. - PreserveBalance *bool `json:"preserve_balance,omitempty"` - // The coupon code to be applied during reactivation. - CouponCode *string `json:"coupon_code,omitempty"` - // If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. - UseCreditsAndPrepayments *bool `json:"use_credits_and_prepayments,omitempty"` - // If `true`, Chargify will attempt to resume the subscription's billing period. if not resumable, the subscription will be reactivated with a new billing period. If `false`: Chargify will only attempt to reactivate the subscription. - Resume *interface{} `json:"resume,omitempty"` + // These values are only applicable to subscriptions using calendar billing + CalendarBilling *ReactivationBilling `json:"calendar_billing,omitempty"` + // 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. + IncludeTrial *bool `json:"include_trial,omitempty"` + // If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. + PreserveBalance *bool `json:"preserve_balance,omitempty"` + // The coupon code to be applied during reactivation. + CouponCode *string `json:"coupon_code,omitempty"` + // If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. + UseCreditsAndPrepayments *bool `json:"use_credits_and_prepayments,omitempty"` + // If `true`, Chargify will attempt to resume the subscription's billing period. if not resumable, the subscription will be reactivated with a new billing period. If `false`: Chargify will only attempt to reactivate the subscription. + Resume *interface{} `json:"resume,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionRequest. +// MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionRequest. // It customizes the JSON marshaling process for ReactivateSubscriptionRequest objects. func (r *ReactivateSubscriptionRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReactivateSubscriptionRequest object to a map representation for JSON marshaling. func (r *ReactivateSubscriptionRequest) toMap() map[string]any { - structMap := make(map[string]any) - if r.CalendarBilling != nil { - structMap["calendar_billing"] = r.CalendarBilling - } - if r.IncludeTrial != nil { - structMap["include_trial"] = r.IncludeTrial - } - if r.PreserveBalance != nil { - structMap["preserve_balance"] = r.PreserveBalance - } - if r.CouponCode != nil { - structMap["coupon_code"] = r.CouponCode - } - if r.UseCreditsAndPrepayments != nil { - structMap["use_credits_and_prepayments"] = r.UseCreditsAndPrepayments - } - if r.Resume != nil { - structMap["resume"] = r.Resume - } - return structMap + structMap := make(map[string]any) + if r.CalendarBilling != nil { + structMap["calendar_billing"] = r.CalendarBilling.toMap() + } + if r.IncludeTrial != nil { + structMap["include_trial"] = r.IncludeTrial + } + if r.PreserveBalance != nil { + structMap["preserve_balance"] = r.PreserveBalance + } + if r.CouponCode != nil { + structMap["coupon_code"] = r.CouponCode + } + if r.UseCreditsAndPrepayments != nil { + structMap["use_credits_and_prepayments"] = r.UseCreditsAndPrepayments + } + if r.Resume != nil { + structMap["resume"] = r.Resume + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionRequest. // It customizes the JSON unmarshaling process for ReactivateSubscriptionRequest objects. func (r *ReactivateSubscriptionRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - CalendarBilling *ReactivationBilling `json:"calendar_billing,omitempty"` - IncludeTrial *bool `json:"include_trial,omitempty"` - PreserveBalance *bool `json:"preserve_balance,omitempty"` - CouponCode *string `json:"coupon_code,omitempty"` - UseCreditsAndPrepayments *bool `json:"use_credits_and_prepayments,omitempty"` - Resume *interface{} `json:"resume,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.CalendarBilling = temp.CalendarBilling - r.IncludeTrial = temp.IncludeTrial - r.PreserveBalance = temp.PreserveBalance - r.CouponCode = temp.CouponCode - r.UseCreditsAndPrepayments = temp.UseCreditsAndPrepayments - r.Resume = temp.Resume - return nil + temp := &struct { + CalendarBilling *ReactivationBilling `json:"calendar_billing,omitempty"` + IncludeTrial *bool `json:"include_trial,omitempty"` + PreserveBalance *bool `json:"preserve_balance,omitempty"` + CouponCode *string `json:"coupon_code,omitempty"` + UseCreditsAndPrepayments *bool `json:"use_credits_and_prepayments,omitempty"` + Resume *interface{} `json:"resume,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.CalendarBilling = temp.CalendarBilling + r.IncludeTrial = temp.IncludeTrial + r.PreserveBalance = temp.PreserveBalance + r.CouponCode = temp.CouponCode + r.UseCreditsAndPrepayments = temp.UseCreditsAndPrepayments + r.Resume = temp.Resume + return nil } diff --git a/models/reactivation_billing.go b/models/reactivation_billing.go index d6764861..5968db93 100644 --- a/models/reactivation_billing.go +++ b/models/reactivation_billing.go @@ -1,44 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) -// ReactivationBilling represents a ReactivationBilling struct. +// ReactivationBilling represents a ReactivationBilling struct. // These values are only applicable to subscriptions using calendar billing type ReactivationBilling struct { - // 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 - ReactivationCharge *ReactivationCharge `json:"reactivation_charge,omitempty"` + // 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 + ReactivationCharge *ReactivationCharge `json:"reactivation_charge,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReactivationBilling. +// MarshalJSON implements the json.Marshaler interface for ReactivationBilling. // It customizes the JSON marshaling process for ReactivationBilling objects. func (r *ReactivationBilling) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReactivationBilling object to a map representation for JSON marshaling. func (r *ReactivationBilling) toMap() map[string]any { - structMap := make(map[string]any) - if r.ReactivationCharge != nil { - structMap["reactivation_charge"] = r.ReactivationCharge - } - return structMap + structMap := make(map[string]any) + if r.ReactivationCharge != nil { + structMap["reactivation_charge"] = r.ReactivationCharge + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReactivationBilling. +// UnmarshalJSON implements the json.Unmarshaler interface for ReactivationBilling. // It customizes the JSON unmarshaling process for ReactivationBilling objects. func (r *ReactivationBilling) UnmarshalJSON(input []byte) error { - temp := &struct { - ReactivationCharge *ReactivationCharge `json:"reactivation_charge,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.ReactivationCharge = temp.ReactivationCharge - return nil + temp := &struct { + ReactivationCharge *ReactivationCharge `json:"reactivation_charge,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.ReactivationCharge = temp.ReactivationCharge + return nil } diff --git a/models/reason_code.go b/models/reason_code.go index e13c263d..f84178ad 100644 --- a/models/reason_code.go +++ b/models/reason_code.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReasonCode represents a ReasonCode struct. type ReasonCode struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - Code *string `json:"code,omitempty"` - Description *string `json:"description,omitempty"` - Position *int `json:"position,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + Code *string `json:"code,omitempty"` + Description *string `json:"description,omitempty"` + Position *int `json:"position,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReasonCode. +// MarshalJSON implements the json.Marshaler interface for ReasonCode. // It customizes the JSON marshaling process for ReasonCode objects. func (r *ReasonCode) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReasonCode object to a map representation for JSON marshaling. func (r *ReasonCode) toMap() map[string]any { - structMap := make(map[string]any) - if r.Id != nil { - structMap["id"] = r.Id - } - if r.SiteId != nil { - structMap["site_id"] = r.SiteId - } - if r.Code != nil { - structMap["code"] = r.Code - } - if r.Description != nil { - structMap["description"] = r.Description - } - if r.Position != nil { - structMap["position"] = r.Position - } - if r.CreatedAt != nil { - structMap["created_at"] = r.CreatedAt - } - if r.UpdatedAt != nil { - structMap["updated_at"] = r.UpdatedAt - } - return structMap + structMap := make(map[string]any) + if r.Id != nil { + structMap["id"] = r.Id + } + if r.SiteId != nil { + structMap["site_id"] = r.SiteId + } + if r.Code != nil { + structMap["code"] = r.Code + } + if r.Description != nil { + structMap["description"] = r.Description + } + if r.Position != nil { + structMap["position"] = r.Position + } + if r.CreatedAt != nil { + structMap["created_at"] = r.CreatedAt + } + if r.UpdatedAt != nil { + structMap["updated_at"] = r.UpdatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCode. +// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCode. // It customizes the JSON unmarshaling process for ReasonCode objects. func (r *ReasonCode) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - Code *string `json:"code,omitempty"` - Description *string `json:"description,omitempty"` - Position *int `json:"position,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Id = temp.Id - r.SiteId = temp.SiteId - r.Code = temp.Code - r.Description = temp.Description - r.Position = temp.Position - r.CreatedAt = temp.CreatedAt - r.UpdatedAt = temp.UpdatedAt - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + Code *string `json:"code,omitempty"` + Description *string `json:"description,omitempty"` + Position *int `json:"position,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Id = temp.Id + r.SiteId = temp.SiteId + r.Code = temp.Code + r.Description = temp.Description + r.Position = temp.Position + r.CreatedAt = temp.CreatedAt + r.UpdatedAt = temp.UpdatedAt + return nil } diff --git a/models/reason_code_response.go b/models/reason_code_response.go index 6a366d1f..cf5d985d 100644 --- a/models/reason_code_response.go +++ b/models/reason_code_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReasonCodeResponse represents a ReasonCodeResponse struct. type ReasonCodeResponse struct { - ReasonCode ReasonCode `json:"reason_code"` + ReasonCode ReasonCode `json:"reason_code"` } -// MarshalJSON implements the json.Marshaler interface for ReasonCodeResponse. +// MarshalJSON implements the json.Marshaler interface for ReasonCodeResponse. // It customizes the JSON marshaling process for ReasonCodeResponse objects. func (r *ReasonCodeResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReasonCodeResponse object to a map representation for JSON marshaling. func (r *ReasonCodeResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["reason_code"] = r.ReasonCode - return structMap + structMap := make(map[string]any) + structMap["reason_code"] = r.ReasonCode.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodeResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodeResponse. // It customizes the JSON unmarshaling process for ReasonCodeResponse objects. func (r *ReasonCodeResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ReasonCode ReasonCode `json:"reason_code"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.ReasonCode = temp.ReasonCode - return nil + temp := &struct { + ReasonCode ReasonCode `json:"reason_code"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.ReasonCode = temp.ReasonCode + return nil } diff --git a/models/reason_codes_json_response.go b/models/reason_codes_json_response.go index eeddf038..bdea2465 100644 --- a/models/reason_codes_json_response.go +++ b/models/reason_codes_json_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReasonCodesJsonResponse represents a ReasonCodesJsonResponse struct. type ReasonCodesJsonResponse struct { - Ok *string `json:"ok,omitempty"` + Ok *string `json:"ok,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReasonCodesJsonResponse. +// MarshalJSON implements the json.Marshaler interface for ReasonCodesJsonResponse. // It customizes the JSON marshaling process for ReasonCodesJsonResponse objects. func (r *ReasonCodesJsonResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReasonCodesJsonResponse object to a map representation for JSON marshaling. func (r *ReasonCodesJsonResponse) toMap() map[string]any { - structMap := make(map[string]any) - if r.Ok != nil { - structMap["ok"] = r.Ok - } - return structMap + structMap := make(map[string]any) + if r.Ok != nil { + structMap["ok"] = r.Ok + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodesJsonResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodesJsonResponse. // It customizes the JSON unmarshaling process for ReasonCodesJsonResponse objects. func (r *ReasonCodesJsonResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Ok *string `json:"ok,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Ok = temp.Ok - return nil + temp := &struct { + Ok *string `json:"ok,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Ok = temp.Ok + return nil } diff --git a/models/record_payment_request.go b/models/record_payment_request.go index 138d36cb..9dd3b7bd 100644 --- a/models/record_payment_request.go +++ b/models/record_payment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // RecordPaymentRequest represents a RecordPaymentRequest struct. type RecordPaymentRequest struct { - Payment CreatePayment `json:"payment"` + Payment CreatePayment `json:"payment"` } -// MarshalJSON implements the json.Marshaler interface for RecordPaymentRequest. +// MarshalJSON implements the json.Marshaler interface for RecordPaymentRequest. // It customizes the JSON marshaling process for RecordPaymentRequest objects. func (r *RecordPaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RecordPaymentRequest object to a map representation for JSON marshaling. func (r *RecordPaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment"] = r.Payment - return structMap + structMap := make(map[string]any) + structMap["payment"] = r.Payment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RecordPaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for RecordPaymentRequest. // It customizes the JSON unmarshaling process for RecordPaymentRequest objects. func (r *RecordPaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Payment CreatePayment `json:"payment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Payment = temp.Payment - return nil + temp := &struct { + Payment CreatePayment `json:"payment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Payment = temp.Payment + return nil } diff --git a/models/referral_code.go b/models/referral_code.go index cd33be8d..2c29c843 100644 --- a/models/referral_code.go +++ b/models/referral_code.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReferralCode represents a ReferralCode struct. type ReferralCode struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Code *string `json:"code,omitempty"` + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Code *string `json:"code,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReferralCode. +// MarshalJSON implements the json.Marshaler interface for ReferralCode. // It customizes the JSON marshaling process for ReferralCode objects. func (r *ReferralCode) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReferralCode object to a map representation for JSON marshaling. func (r *ReferralCode) toMap() map[string]any { - structMap := make(map[string]any) - if r.Id != nil { - structMap["id"] = r.Id - } - if r.SiteId != nil { - structMap["site_id"] = r.SiteId - } - if r.SubscriptionId != nil { - structMap["subscription_id"] = r.SubscriptionId - } - if r.Code != nil { - structMap["code"] = r.Code - } - return structMap + structMap := make(map[string]any) + if r.Id != nil { + structMap["id"] = r.Id + } + if r.SiteId != nil { + structMap["site_id"] = r.SiteId + } + if r.SubscriptionId != nil { + structMap["subscription_id"] = r.SubscriptionId + } + if r.Code != nil { + structMap["code"] = r.Code + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReferralCode. +// UnmarshalJSON implements the json.Unmarshaler interface for ReferralCode. // It customizes the JSON unmarshaling process for ReferralCode objects. func (r *ReferralCode) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SiteId *int `json:"site_id,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Code *string `json:"code,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Id = temp.Id - r.SiteId = temp.SiteId - r.SubscriptionId = temp.SubscriptionId - r.Code = temp.Code - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SiteId *int `json:"site_id,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Code *string `json:"code,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Id = temp.Id + r.SiteId = temp.SiteId + r.SubscriptionId = temp.SubscriptionId + r.Code = temp.Code + return nil } diff --git a/models/referral_validation_response.go b/models/referral_validation_response.go index 8d6bb287..34b0172b 100644 --- a/models/referral_validation_response.go +++ b/models/referral_validation_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReferralValidationResponse represents a ReferralValidationResponse struct. type ReferralValidationResponse struct { - ReferralCode *ReferralCode `json:"referral_code,omitempty"` + ReferralCode *ReferralCode `json:"referral_code,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReferralValidationResponse. +// MarshalJSON implements the json.Marshaler interface for ReferralValidationResponse. // It customizes the JSON marshaling process for ReferralValidationResponse objects. func (r *ReferralValidationResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReferralValidationResponse object to a map representation for JSON marshaling. func (r *ReferralValidationResponse) toMap() map[string]any { - structMap := make(map[string]any) - if r.ReferralCode != nil { - structMap["referral_code"] = r.ReferralCode - } - return structMap + structMap := make(map[string]any) + if r.ReferralCode != nil { + structMap["referral_code"] = r.ReferralCode.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReferralValidationResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ReferralValidationResponse. // It customizes the JSON unmarshaling process for ReferralValidationResponse objects. func (r *ReferralValidationResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ReferralCode *ReferralCode `json:"referral_code,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.ReferralCode = temp.ReferralCode - return nil + temp := &struct { + ReferralCode *ReferralCode `json:"referral_code,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.ReferralCode = temp.ReferralCode + return nil } diff --git a/models/refund.go b/models/refund.go index e3f6e421..242718cb 100644 --- a/models/refund.go +++ b/models/refund.go @@ -1,85 +1,85 @@ package models import ( - "encoding/json" + "encoding/json" ) // Refund represents a Refund struct. type Refund struct { - // The amount to be refunded in decimal format as a string. Example: "10.50". Must not exceed the remaining refundable balance of the payment. - Amount *string `json:"amount,omitempty"` - // A description that will be attached to the refund - Memo *string `json:"memo,omitempty"` - // The ID of the payment to be refunded - PaymentId *int `json:"payment_id,omitempty"` - // Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. - External *bool `json:"external,omitempty"` - // If set to true, creates credit and applies it to an invoice. Defaults to `false`. - ApplyCredit *bool `json:"apply_credit,omitempty"` - // 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`. - VoidInvoice *bool `json:"void_invoice,omitempty"` - // An array of segment uids to refund or the string 'all' to indicate that all segments should be refunded - SegmentUids *interface{} `json:"segment_uids,omitempty"` + // The amount to be refunded in decimal format as a string. Example: "10.50". Must not exceed the remaining refundable balance of the payment. + Amount *string `json:"amount,omitempty"` + // A description that will be attached to the refund + Memo *string `json:"memo,omitempty"` + // The ID of the payment to be refunded + PaymentId *int `json:"payment_id,omitempty"` + // Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. + External *bool `json:"external,omitempty"` + // If set to true, creates credit and applies it to an invoice. Defaults to `false`. + ApplyCredit *bool `json:"apply_credit,omitempty"` + // 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`. + VoidInvoice *bool `json:"void_invoice,omitempty"` + // An array of segment uids to refund or the string 'all' to indicate that all segments should be refunded + SegmentUids *interface{} `json:"segment_uids,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Refund. +// MarshalJSON implements the json.Marshaler interface for Refund. // It customizes the JSON marshaling process for Refund objects. func (r *Refund) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the Refund object to a map representation for JSON marshaling. func (r *Refund) toMap() map[string]any { - structMap := make(map[string]any) - if r.Amount != nil { - structMap["amount"] = r.Amount - } - if r.Memo != nil { - structMap["memo"] = r.Memo - } - if r.PaymentId != nil { - structMap["payment_id"] = r.PaymentId - } - if r.External != nil { - structMap["external"] = r.External - } - if r.ApplyCredit != nil { - structMap["apply_credit"] = r.ApplyCredit - } - if r.VoidInvoice != nil { - structMap["void_invoice"] = r.VoidInvoice - } - if r.SegmentUids != nil { - structMap["segment_uids"] = r.SegmentUids - } - return structMap + structMap := make(map[string]any) + if r.Amount != nil { + structMap["amount"] = r.Amount + } + if r.Memo != nil { + structMap["memo"] = r.Memo + } + if r.PaymentId != nil { + structMap["payment_id"] = r.PaymentId + } + if r.External != nil { + structMap["external"] = r.External + } + if r.ApplyCredit != nil { + structMap["apply_credit"] = r.ApplyCredit + } + if r.VoidInvoice != nil { + structMap["void_invoice"] = r.VoidInvoice + } + if r.SegmentUids != nil { + structMap["segment_uids"] = r.SegmentUids + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Refund. +// UnmarshalJSON implements the json.Unmarshaler interface for Refund. // It customizes the JSON unmarshaling process for Refund objects. func (r *Refund) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount *string `json:"amount,omitempty"` - Memo *string `json:"memo,omitempty"` - PaymentId *int `json:"payment_id,omitempty"` - External *bool `json:"external,omitempty"` - ApplyCredit *bool `json:"apply_credit,omitempty"` - VoidInvoice *bool `json:"void_invoice,omitempty"` - SegmentUids *interface{} `json:"segment_uids,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Amount = temp.Amount - r.Memo = temp.Memo - r.PaymentId = temp.PaymentId - r.External = temp.External - r.ApplyCredit = temp.ApplyCredit - r.VoidInvoice = temp.VoidInvoice - r.SegmentUids = temp.SegmentUids - return nil + temp := &struct { + Amount *string `json:"amount,omitempty"` + Memo *string `json:"memo,omitempty"` + PaymentId *int `json:"payment_id,omitempty"` + External *bool `json:"external,omitempty"` + ApplyCredit *bool `json:"apply_credit,omitempty"` + VoidInvoice *bool `json:"void_invoice,omitempty"` + SegmentUids *interface{} `json:"segment_uids,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Amount = temp.Amount + r.Memo = temp.Memo + r.PaymentId = temp.PaymentId + r.External = temp.External + r.ApplyCredit = temp.ApplyCredit + r.VoidInvoice = temp.VoidInvoice + r.SegmentUids = temp.SegmentUids + return nil } diff --git a/models/refund_invoice_request.go b/models/refund_invoice_request.go index aad0b4d2..2bdec40d 100644 --- a/models/refund_invoice_request.go +++ b/models/refund_invoice_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // RefundInvoiceRequest represents a RefundInvoiceRequest struct. type RefundInvoiceRequest struct { - Refund Refund `json:"refund"` + Refund Refund `json:"refund"` } -// MarshalJSON implements the json.Marshaler interface for RefundInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for RefundInvoiceRequest. // It customizes the JSON marshaling process for RefundInvoiceRequest objects. func (r *RefundInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RefundInvoiceRequest object to a map representation for JSON marshaling. func (r *RefundInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["refund"] = r.Refund - return structMap + structMap := make(map[string]any) + structMap["refund"] = r.Refund.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RefundInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for RefundInvoiceRequest. // It customizes the JSON unmarshaling process for RefundInvoiceRequest objects. func (r *RefundInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Refund Refund `json:"refund"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Refund = temp.Refund - return nil + temp := &struct { + Refund Refund `json:"refund"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Refund = temp.Refund + return nil } diff --git a/models/refund_prepayment.go b/models/refund_prepayment.go index 8009c377..cd4e62a6 100644 --- a/models/refund_prepayment.go +++ b/models/refund_prepayment.go @@ -1,57 +1,57 @@ package models import ( - "encoding/json" + "encoding/json" ) // RefundPrepayment represents a RefundPrepayment struct. type RefundPrepayment struct { - // `amount` is not required if you pass `amount_in_cents`. - AmountInCents int64 `json:"amount_in_cents"` - // `amount_in_cents` is not required if you pass `amount`. - Amount interface{} `json:"amount"` - Memo string `json:"memo"` - // 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. - External *bool `json:"external,omitempty"` + // `amount` is not required if you pass `amount_in_cents`. + AmountInCents int64 `json:"amount_in_cents"` + // `amount_in_cents` is not required if you pass `amount`. + Amount interface{} `json:"amount"` + Memo string `json:"memo"` + // 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. + External *bool `json:"external,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RefundPrepayment. +// MarshalJSON implements the json.Marshaler interface for RefundPrepayment. // It customizes the JSON marshaling process for RefundPrepayment objects. func (r *RefundPrepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RefundPrepayment object to a map representation for JSON marshaling. func (r *RefundPrepayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount_in_cents"] = r.AmountInCents - structMap["amount"] = r.Amount - structMap["memo"] = r.Memo - if r.External != nil { - structMap["external"] = r.External - } - return structMap + structMap := make(map[string]any) + structMap["amount_in_cents"] = r.AmountInCents + structMap["amount"] = r.Amount + structMap["memo"] = r.Memo + if r.External != nil { + structMap["external"] = r.External + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepayment. // It customizes the JSON unmarshaling process for RefundPrepayment objects. func (r *RefundPrepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - AmountInCents int64 `json:"amount_in_cents"` - Amount interface{} `json:"amount"` - Memo string `json:"memo"` - External *bool `json:"external,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.AmountInCents = temp.AmountInCents - r.Amount = temp.Amount - r.Memo = temp.Memo - r.External = temp.External - return nil + temp := &struct { + AmountInCents int64 `json:"amount_in_cents"` + Amount interface{} `json:"amount"` + Memo string `json:"memo"` + External *bool `json:"external,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.AmountInCents = temp.AmountInCents + r.Amount = temp.Amount + r.Memo = temp.Memo + r.External = temp.External + return nil } diff --git a/models/refund_prepayment_aggregated_error.go b/models/refund_prepayment_aggregated_error.go index eaba7818..a362b0c0 100644 --- a/models/refund_prepayment_aggregated_error.go +++ b/models/refund_prepayment_aggregated_error.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // RefundPrepaymentAggregatedError represents a RefundPrepaymentAggregatedError struct. type RefundPrepaymentAggregatedError struct { - Refund *PrepaymentAggregatedError `json:"refund,omitempty"` + Refund *PrepaymentAggregatedError `json:"refund,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentAggregatedError. +// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentAggregatedError. // It customizes the JSON marshaling process for RefundPrepaymentAggregatedError objects. func (r *RefundPrepaymentAggregatedError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RefundPrepaymentAggregatedError object to a map representation for JSON marshaling. func (r *RefundPrepaymentAggregatedError) toMap() map[string]any { - structMap := make(map[string]any) - if r.Refund != nil { - structMap["refund"] = r.Refund - } - return structMap + structMap := make(map[string]any) + if r.Refund != nil { + structMap["refund"] = r.Refund.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentAggregatedError. +// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentAggregatedError. // It customizes the JSON unmarshaling process for RefundPrepaymentAggregatedError objects. func (r *RefundPrepaymentAggregatedError) UnmarshalJSON(input []byte) error { - temp := &struct { - Refund *PrepaymentAggregatedError `json:"refund,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Refund = temp.Refund - return nil + temp := &struct { + Refund *PrepaymentAggregatedError `json:"refund,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Refund = temp.Refund + return nil } diff --git a/models/refund_prepayment_base_refund_error.go b/models/refund_prepayment_base_refund_error.go index 0807cb6f..4689622f 100644 --- a/models/refund_prepayment_base_refund_error.go +++ b/models/refund_prepayment_base_refund_error.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // RefundPrepaymentBaseRefundError represents a RefundPrepaymentBaseRefundError struct. type RefundPrepaymentBaseRefundError struct { - Refund *BaseRefundError `json:"refund,omitempty"` + Refund *BaseRefundError `json:"refund,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentBaseRefundError. +// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentBaseRefundError. // It customizes the JSON marshaling process for RefundPrepaymentBaseRefundError objects. func (r *RefundPrepaymentBaseRefundError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RefundPrepaymentBaseRefundError object to a map representation for JSON marshaling. func (r *RefundPrepaymentBaseRefundError) toMap() map[string]any { - structMap := make(map[string]any) - if r.Refund != nil { - structMap["refund"] = r.Refund - } - return structMap + structMap := make(map[string]any) + if r.Refund != nil { + structMap["refund"] = r.Refund.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentBaseRefundError. +// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentBaseRefundError. // It customizes the JSON unmarshaling process for RefundPrepaymentBaseRefundError objects. func (r *RefundPrepaymentBaseRefundError) UnmarshalJSON(input []byte) error { - temp := &struct { - Refund *BaseRefundError `json:"refund,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Refund = temp.Refund - return nil + temp := &struct { + Refund *BaseRefundError `json:"refund,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Refund = temp.Refund + return nil } diff --git a/models/refund_prepayment_request.go b/models/refund_prepayment_request.go index 98fca274..589be4e4 100644 --- a/models/refund_prepayment_request.go +++ b/models/refund_prepayment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // RefundPrepaymentRequest represents a RefundPrepaymentRequest struct. type RefundPrepaymentRequest struct { - Refund RefundPrepayment `json:"refund"` + Refund RefundPrepayment `json:"refund"` } -// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentRequest. +// MarshalJSON implements the json.Marshaler interface for RefundPrepaymentRequest. // It customizes the JSON marshaling process for RefundPrepaymentRequest objects. func (r *RefundPrepaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RefundPrepaymentRequest object to a map representation for JSON marshaling. func (r *RefundPrepaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["refund"] = r.Refund - return structMap + structMap := make(map[string]any) + structMap["refund"] = r.Refund.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentRequest. // It customizes the JSON unmarshaling process for RefundPrepaymentRequest objects. func (r *RefundPrepaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Refund RefundPrepayment `json:"refund"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Refund = temp.Refund - return nil + temp := &struct { + Refund RefundPrepayment `json:"refund"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Refund = temp.Refund + return nil } diff --git a/models/renewal_preview.go b/models/renewal_preview.go index 269e6532..bffaee7f 100644 --- a/models/renewal_preview.go +++ b/models/renewal_preview.go @@ -1,99 +1,99 @@ package models import ( - "encoding/json" + "encoding/json" ) // RenewalPreview represents a RenewalPreview struct. type RenewalPreview struct { - // The timestamp for the subscription’s next renewal - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - // An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal - SubtotalInCents *int64 `json:"subtotal_in_cents,omitempty"` - // An integer representing the total tax charges that will be assessed at the next renewal - TotalTaxInCents *int64 `json:"total_tax_in_cents,omitempty"` - // An integer representing the amount of the coupon discounts that will be applied to the next renewal - TotalDiscountInCents *int64 `json:"total_discount_in_cents,omitempty"` - // An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal - TotalInCents *int64 `json:"total_in_cents,omitempty"` - // An integer representing the amount of the subscription’s current balance - ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"` - // An integer representing the existing_balance_in_cents plus the total_in_cents - TotalAmountDueInCents *int64 `json:"total_amount_due_in_cents,omitempty"` - // 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. - UncalculatedTaxes *bool `json:"uncalculated_taxes,omitempty"` - // An array of objects representing the individual transactions that will be created at the next renewal - LineItems []RenewalPreviewLineItem `json:"line_items,omitempty"` + // The timestamp for the subscription’s next renewal + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + // An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal + SubtotalInCents *int64 `json:"subtotal_in_cents,omitempty"` + // An integer representing the total tax charges that will be assessed at the next renewal + TotalTaxInCents *int64 `json:"total_tax_in_cents,omitempty"` + // An integer representing the amount of the coupon discounts that will be applied to the next renewal + TotalDiscountInCents *int64 `json:"total_discount_in_cents,omitempty"` + // An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal + TotalInCents *int64 `json:"total_in_cents,omitempty"` + // An integer representing the amount of the subscription’s current balance + ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"` + // An integer representing the existing_balance_in_cents plus the total_in_cents + TotalAmountDueInCents *int64 `json:"total_amount_due_in_cents,omitempty"` + // 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. + UncalculatedTaxes *bool `json:"uncalculated_taxes,omitempty"` + // An array of objects representing the individual transactions that will be created at the next renewal + LineItems []RenewalPreviewLineItem `json:"line_items,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RenewalPreview. +// MarshalJSON implements the json.Marshaler interface for RenewalPreview. // It customizes the JSON marshaling process for RenewalPreview objects. func (r *RenewalPreview) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RenewalPreview object to a map representation for JSON marshaling. func (r *RenewalPreview) toMap() map[string]any { - structMap := make(map[string]any) - if r.NextAssessmentAt != nil { - structMap["next_assessment_at"] = r.NextAssessmentAt - } - if r.SubtotalInCents != nil { - structMap["subtotal_in_cents"] = r.SubtotalInCents - } - if r.TotalTaxInCents != nil { - structMap["total_tax_in_cents"] = r.TotalTaxInCents - } - if r.TotalDiscountInCents != nil { - structMap["total_discount_in_cents"] = r.TotalDiscountInCents - } - if r.TotalInCents != nil { - structMap["total_in_cents"] = r.TotalInCents - } - if r.ExistingBalanceInCents != nil { - structMap["existing_balance_in_cents"] = r.ExistingBalanceInCents - } - if r.TotalAmountDueInCents != nil { - structMap["total_amount_due_in_cents"] = r.TotalAmountDueInCents - } - if r.UncalculatedTaxes != nil { - structMap["uncalculated_taxes"] = r.UncalculatedTaxes - } - if r.LineItems != nil { - structMap["line_items"] = r.LineItems - } - return structMap + structMap := make(map[string]any) + if r.NextAssessmentAt != nil { + structMap["next_assessment_at"] = r.NextAssessmentAt + } + if r.SubtotalInCents != nil { + structMap["subtotal_in_cents"] = r.SubtotalInCents + } + if r.TotalTaxInCents != nil { + structMap["total_tax_in_cents"] = r.TotalTaxInCents + } + if r.TotalDiscountInCents != nil { + structMap["total_discount_in_cents"] = r.TotalDiscountInCents + } + if r.TotalInCents != nil { + structMap["total_in_cents"] = r.TotalInCents + } + if r.ExistingBalanceInCents != nil { + structMap["existing_balance_in_cents"] = r.ExistingBalanceInCents + } + if r.TotalAmountDueInCents != nil { + structMap["total_amount_due_in_cents"] = r.TotalAmountDueInCents + } + if r.UncalculatedTaxes != nil { + structMap["uncalculated_taxes"] = r.UncalculatedTaxes + } + if r.LineItems != nil { + structMap["line_items"] = r.LineItems + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreview. +// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreview. // It customizes the JSON unmarshaling process for RenewalPreview objects. func (r *RenewalPreview) UnmarshalJSON(input []byte) error { - temp := &struct { - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - SubtotalInCents *int64 `json:"subtotal_in_cents,omitempty"` - TotalTaxInCents *int64 `json:"total_tax_in_cents,omitempty"` - TotalDiscountInCents *int64 `json:"total_discount_in_cents,omitempty"` - TotalInCents *int64 `json:"total_in_cents,omitempty"` - ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"` - TotalAmountDueInCents *int64 `json:"total_amount_due_in_cents,omitempty"` - UncalculatedTaxes *bool `json:"uncalculated_taxes,omitempty"` - LineItems []RenewalPreviewLineItem `json:"line_items,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.NextAssessmentAt = temp.NextAssessmentAt - r.SubtotalInCents = temp.SubtotalInCents - r.TotalTaxInCents = temp.TotalTaxInCents - r.TotalDiscountInCents = temp.TotalDiscountInCents - r.TotalInCents = temp.TotalInCents - r.ExistingBalanceInCents = temp.ExistingBalanceInCents - r.TotalAmountDueInCents = temp.TotalAmountDueInCents - r.UncalculatedTaxes = temp.UncalculatedTaxes - r.LineItems = temp.LineItems - return nil + temp := &struct { + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + SubtotalInCents *int64 `json:"subtotal_in_cents,omitempty"` + TotalTaxInCents *int64 `json:"total_tax_in_cents,omitempty"` + TotalDiscountInCents *int64 `json:"total_discount_in_cents,omitempty"` + TotalInCents *int64 `json:"total_in_cents,omitempty"` + ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"` + TotalAmountDueInCents *int64 `json:"total_amount_due_in_cents,omitempty"` + UncalculatedTaxes *bool `json:"uncalculated_taxes,omitempty"` + LineItems []RenewalPreviewLineItem `json:"line_items,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.NextAssessmentAt = temp.NextAssessmentAt + r.SubtotalInCents = temp.SubtotalInCents + r.TotalTaxInCents = temp.TotalTaxInCents + r.TotalDiscountInCents = temp.TotalDiscountInCents + r.TotalInCents = temp.TotalInCents + r.ExistingBalanceInCents = temp.ExistingBalanceInCents + r.TotalAmountDueInCents = temp.TotalAmountDueInCents + r.UncalculatedTaxes = temp.UncalculatedTaxes + r.LineItems = temp.LineItems + return nil } diff --git a/models/renewal_preview_component.go b/models/renewal_preview_component.go index b8dca6e5..0f19c16d 100644 --- a/models/renewal_preview_component.go +++ b/models/renewal_preview_component.go @@ -1,62 +1,62 @@ package models import ( - "encoding/json" + "encoding/json" ) // RenewalPreviewComponent represents a RenewalPreviewComponent struct. type RenewalPreviewComponent struct { - // Either the component's Chargify id or its handle prefixed with `handle:` - ComponentId *interface{} `json:"component_id,omitempty"` - // 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 - Quantity *int `json:"quantity,omitempty"` - // Either the component price point's Chargify id or its handle prefixed with `handle:` - PricePointId *interface{} `json:"price_point_id,omitempty"` + // Either the component's Chargify id or its handle prefixed with `handle:` + ComponentId *interface{} `json:"component_id,omitempty"` + // 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 + Quantity *int `json:"quantity,omitempty"` + // Either the component price point's Chargify id or its handle prefixed with `handle:` + PricePointId *interface{} `json:"price_point_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RenewalPreviewComponent. +// MarshalJSON implements the json.Marshaler interface for RenewalPreviewComponent. // It customizes the JSON marshaling process for RenewalPreviewComponent objects. func (r *RenewalPreviewComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RenewalPreviewComponent object to a map representation for JSON marshaling. func (r *RenewalPreviewComponent) toMap() map[string]any { - structMap := make(map[string]any) - if r.ComponentId != nil { - structMap["component_id"] = r.ComponentId - } - if r.Quantity != nil { - structMap["quantity"] = r.Quantity - } - if r.PricePointId != nil { - structMap["price_point_id"] = r.PricePointId - } - return structMap + structMap := make(map[string]any) + if r.ComponentId != nil { + structMap["component_id"] = r.ComponentId + } + if r.Quantity != nil { + structMap["quantity"] = r.Quantity + } + if r.PricePointId != nil { + structMap["price_point_id"] = r.PricePointId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewComponent. // It customizes the JSON unmarshaling process for RenewalPreviewComponent objects. func (r *RenewalPreviewComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *interface{} `json:"component_id,omitempty"` - Quantity *int `json:"quantity,omitempty"` - PricePointId *interface{} `json:"price_point_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.ComponentId = temp.ComponentId - r.Quantity = temp.Quantity - r.PricePointId = temp.PricePointId - return nil + temp := &struct { + ComponentId *interface{} `json:"component_id,omitempty"` + Quantity *int `json:"quantity,omitempty"` + PricePointId *interface{} `json:"price_point_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.ComponentId = temp.ComponentId + r.Quantity = temp.Quantity + r.PricePointId = temp.PricePointId + return nil } diff --git a/models/renewal_preview_line_item.go b/models/renewal_preview_line_item.go index a05e2f18..e7d5b101 100644 --- a/models/renewal_preview_line_item.go +++ b/models/renewal_preview_line_item.go @@ -1,122 +1,122 @@ package models import ( - "encoding/json" + "encoding/json" ) // RenewalPreviewLineItem represents a RenewalPreviewLineItem struct. type RenewalPreviewLineItem struct { - // A handle for the line item transaction type - TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"` - // A handle for the line item kind - Kind *LineItemKind `json:"kind,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Memo *string `json:"memo,omitempty"` - DiscountAmountInCents *int64 `json:"discount_amount_in_cents,omitempty"` - TaxableAmountInCents *int64 `json:"taxable_amount_in_cents,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle *string `json:"component_handle,omitempty"` - ComponentName *string `json:"component_name,omitempty"` - ProductHandle *string `json:"product_handle,omitempty"` - PeriodRangeStart *string `json:"period_range_start,omitempty"` - PeriodRangeEnd *string `json:"period_range_end,omitempty"` + // A handle for the line item transaction type + TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"` + // A handle for the line item kind + Kind *LineItemKind `json:"kind,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Memo *string `json:"memo,omitempty"` + DiscountAmountInCents *int64 `json:"discount_amount_in_cents,omitempty"` + TaxableAmountInCents *int64 `json:"taxable_amount_in_cents,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle *string `json:"component_handle,omitempty"` + ComponentName *string `json:"component_name,omitempty"` + ProductHandle *string `json:"product_handle,omitempty"` + PeriodRangeStart *string `json:"period_range_start,omitempty"` + PeriodRangeEnd *string `json:"period_range_end,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RenewalPreviewLineItem. +// MarshalJSON implements the json.Marshaler interface for RenewalPreviewLineItem. // It customizes the JSON marshaling process for RenewalPreviewLineItem objects. func (r *RenewalPreviewLineItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RenewalPreviewLineItem object to a map representation for JSON marshaling. func (r *RenewalPreviewLineItem) toMap() map[string]any { - structMap := make(map[string]any) - if r.TransactionType != nil { - structMap["transaction_type"] = r.TransactionType - } - if r.Kind != nil { - structMap["kind"] = r.Kind - } - if r.AmountInCents != nil { - structMap["amount_in_cents"] = r.AmountInCents - } - if r.Memo != nil { - structMap["memo"] = r.Memo - } - if r.DiscountAmountInCents != nil { - structMap["discount_amount_in_cents"] = r.DiscountAmountInCents - } - if r.TaxableAmountInCents != nil { - structMap["taxable_amount_in_cents"] = r.TaxableAmountInCents - } - if r.ProductId != nil { - structMap["product_id"] = r.ProductId - } - if r.ProductName != nil { - structMap["product_name"] = r.ProductName - } - if r.ComponentId != nil { - structMap["component_id"] = r.ComponentId - } - if r.ComponentHandle != nil { - structMap["component_handle"] = r.ComponentHandle - } - if r.ComponentName != nil { - structMap["component_name"] = r.ComponentName - } - if r.ProductHandle != nil { - structMap["product_handle"] = r.ProductHandle - } - if r.PeriodRangeStart != nil { - structMap["period_range_start"] = r.PeriodRangeStart - } - if r.PeriodRangeEnd != nil { - structMap["period_range_end"] = r.PeriodRangeEnd - } - return structMap + structMap := make(map[string]any) + if r.TransactionType != nil { + structMap["transaction_type"] = r.TransactionType + } + if r.Kind != nil { + structMap["kind"] = r.Kind + } + if r.AmountInCents != nil { + structMap["amount_in_cents"] = r.AmountInCents + } + if r.Memo != nil { + structMap["memo"] = r.Memo + } + if r.DiscountAmountInCents != nil { + structMap["discount_amount_in_cents"] = r.DiscountAmountInCents + } + if r.TaxableAmountInCents != nil { + structMap["taxable_amount_in_cents"] = r.TaxableAmountInCents + } + if r.ProductId != nil { + structMap["product_id"] = r.ProductId + } + if r.ProductName != nil { + structMap["product_name"] = r.ProductName + } + if r.ComponentId != nil { + structMap["component_id"] = r.ComponentId + } + if r.ComponentHandle != nil { + structMap["component_handle"] = r.ComponentHandle + } + if r.ComponentName != nil { + structMap["component_name"] = r.ComponentName + } + if r.ProductHandle != nil { + structMap["product_handle"] = r.ProductHandle + } + if r.PeriodRangeStart != nil { + structMap["period_range_start"] = r.PeriodRangeStart + } + if r.PeriodRangeEnd != nil { + structMap["period_range_end"] = r.PeriodRangeEnd + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewLineItem. +// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewLineItem. // It customizes the JSON unmarshaling process for RenewalPreviewLineItem objects. func (r *RenewalPreviewLineItem) UnmarshalJSON(input []byte) error { - temp := &struct { - TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"` - Kind *LineItemKind `json:"kind,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - Memo *string `json:"memo,omitempty"` - DiscountAmountInCents *int64 `json:"discount_amount_in_cents,omitempty"` - TaxableAmountInCents *int64 `json:"taxable_amount_in_cents,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductName *string `json:"product_name,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle *string `json:"component_handle,omitempty"` - ComponentName *string `json:"component_name,omitempty"` - ProductHandle *string `json:"product_handle,omitempty"` - PeriodRangeStart *string `json:"period_range_start,omitempty"` - PeriodRangeEnd *string `json:"period_range_end,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.TransactionType = temp.TransactionType - r.Kind = temp.Kind - r.AmountInCents = temp.AmountInCents - r.Memo = temp.Memo - r.DiscountAmountInCents = temp.DiscountAmountInCents - r.TaxableAmountInCents = temp.TaxableAmountInCents - r.ProductId = temp.ProductId - r.ProductName = temp.ProductName - r.ComponentId = temp.ComponentId - r.ComponentHandle = temp.ComponentHandle - r.ComponentName = temp.ComponentName - r.ProductHandle = temp.ProductHandle - r.PeriodRangeStart = temp.PeriodRangeStart - r.PeriodRangeEnd = temp.PeriodRangeEnd - return nil + temp := &struct { + TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"` + Kind *LineItemKind `json:"kind,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + Memo *string `json:"memo,omitempty"` + DiscountAmountInCents *int64 `json:"discount_amount_in_cents,omitempty"` + TaxableAmountInCents *int64 `json:"taxable_amount_in_cents,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductName *string `json:"product_name,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle *string `json:"component_handle,omitempty"` + ComponentName *string `json:"component_name,omitempty"` + ProductHandle *string `json:"product_handle,omitempty"` + PeriodRangeStart *string `json:"period_range_start,omitempty"` + PeriodRangeEnd *string `json:"period_range_end,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.TransactionType = temp.TransactionType + r.Kind = temp.Kind + r.AmountInCents = temp.AmountInCents + r.Memo = temp.Memo + r.DiscountAmountInCents = temp.DiscountAmountInCents + r.TaxableAmountInCents = temp.TaxableAmountInCents + r.ProductId = temp.ProductId + r.ProductName = temp.ProductName + r.ComponentId = temp.ComponentId + r.ComponentHandle = temp.ComponentHandle + r.ComponentName = temp.ComponentName + r.ProductHandle = temp.ProductHandle + r.PeriodRangeStart = temp.PeriodRangeStart + r.PeriodRangeEnd = temp.PeriodRangeEnd + return nil } diff --git a/models/renewal_preview_request.go b/models/renewal_preview_request.go index a5821298..95c6b923 100644 --- a/models/renewal_preview_request.go +++ b/models/renewal_preview_request.go @@ -1,43 +1,43 @@ package models import ( - "encoding/json" + "encoding/json" ) // RenewalPreviewRequest represents a RenewalPreviewRequest struct. type RenewalPreviewRequest struct { - // 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). - Components []RenewalPreviewComponent `json:"components,omitempty"` + // 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). + Components []RenewalPreviewComponent `json:"components,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RenewalPreviewRequest. +// MarshalJSON implements the json.Marshaler interface for RenewalPreviewRequest. // It customizes the JSON marshaling process for RenewalPreviewRequest objects. func (r *RenewalPreviewRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RenewalPreviewRequest object to a map representation for JSON marshaling. func (r *RenewalPreviewRequest) toMap() map[string]any { - structMap := make(map[string]any) - if r.Components != nil { - structMap["components"] = r.Components - } - return structMap + structMap := make(map[string]any) + if r.Components != nil { + structMap["components"] = r.Components + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewRequest. // It customizes the JSON unmarshaling process for RenewalPreviewRequest objects. func (r *RenewalPreviewRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Components []RenewalPreviewComponent `json:"components,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Components = temp.Components - return nil + temp := &struct { + Components []RenewalPreviewComponent `json:"components,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Components = temp.Components + return nil } diff --git a/models/renewal_preview_response.go b/models/renewal_preview_response.go index 687b637f..30d5b4b0 100644 --- a/models/renewal_preview_response.go +++ b/models/renewal_preview_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // RenewalPreviewResponse represents a RenewalPreviewResponse struct. type RenewalPreviewResponse struct { - RenewalPreview RenewalPreview `json:"renewal_preview"` + RenewalPreview RenewalPreview `json:"renewal_preview"` } -// MarshalJSON implements the json.Marshaler interface for RenewalPreviewResponse. +// MarshalJSON implements the json.Marshaler interface for RenewalPreviewResponse. // It customizes the JSON marshaling process for RenewalPreviewResponse objects. func (r *RenewalPreviewResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RenewalPreviewResponse object to a map representation for JSON marshaling. func (r *RenewalPreviewResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["renewal_preview"] = r.RenewalPreview - return structMap + structMap := make(map[string]any) + structMap["renewal_preview"] = r.RenewalPreview.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewResponse. // It customizes the JSON unmarshaling process for RenewalPreviewResponse objects. func (r *RenewalPreviewResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - RenewalPreview RenewalPreview `json:"renewal_preview"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.RenewalPreview = temp.RenewalPreview - return nil + temp := &struct { + RenewalPreview RenewalPreview `json:"renewal_preview"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.RenewalPreview = temp.RenewalPreview + return nil } diff --git a/models/replay_webhooks_request.go b/models/replay_webhooks_request.go index 83c4c695..2b3ba3c8 100644 --- a/models/replay_webhooks_request.go +++ b/models/replay_webhooks_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReplayWebhooksRequest represents a ReplayWebhooksRequest struct. type ReplayWebhooksRequest struct { - Ids []int `json:"ids"` + Ids []int `json:"ids"` } -// MarshalJSON implements the json.Marshaler interface for ReplayWebhooksRequest. +// MarshalJSON implements the json.Marshaler interface for ReplayWebhooksRequest. // It customizes the JSON marshaling process for ReplayWebhooksRequest objects. func (r *ReplayWebhooksRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReplayWebhooksRequest object to a map representation for JSON marshaling. func (r *ReplayWebhooksRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["ids"] = r.Ids - return structMap + structMap := make(map[string]any) + structMap["ids"] = r.Ids + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksRequest. // It customizes the JSON unmarshaling process for ReplayWebhooksRequest objects. func (r *ReplayWebhooksRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Ids []int `json:"ids"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Ids = temp.Ids - return nil + temp := &struct { + Ids []int `json:"ids"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Ids = temp.Ids + return nil } diff --git a/models/replay_webhooks_response.go b/models/replay_webhooks_response.go index afb99ee1..f77f3934 100644 --- a/models/replay_webhooks_response.go +++ b/models/replay_webhooks_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // ReplayWebhooksResponse represents a ReplayWebhooksResponse struct. type ReplayWebhooksResponse struct { - Status *string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ReplayWebhooksResponse. +// MarshalJSON implements the json.Marshaler interface for ReplayWebhooksResponse. // It customizes the JSON marshaling process for ReplayWebhooksResponse objects. func (r *ReplayWebhooksResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ReplayWebhooksResponse object to a map representation for JSON marshaling. func (r *ReplayWebhooksResponse) toMap() map[string]any { - structMap := make(map[string]any) - if r.Status != nil { - structMap["status"] = r.Status - } - return structMap + structMap := make(map[string]any) + if r.Status != nil { + structMap["status"] = r.Status + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksResponse. // It customizes the JSON unmarshaling process for ReplayWebhooksResponse objects. func (r *ReplayWebhooksResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Status *string `json:"status,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.Status = temp.Status - return nil + temp := &struct { + Status *string `json:"status,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.Status = temp.Status + return nil } diff --git a/models/resent_invitation.go b/models/resent_invitation.go index 47e2dd86..16f12980 100644 --- a/models/resent_invitation.go +++ b/models/resent_invitation.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // ResentInvitation represents a ResentInvitation struct. type ResentInvitation struct { - LastSentAt *string `json:"last_sent_at,omitempty"` - LastAcceptedAt *string `json:"last_accepted_at,omitempty"` - SendInviteLinkText *string `json:"send_invite_link_text,omitempty"` - UninvitedCount *int `json:"uninvited_count,omitempty"` + LastSentAt *string `json:"last_sent_at,omitempty"` + LastAcceptedAt *string `json:"last_accepted_at,omitempty"` + SendInviteLinkText *string `json:"send_invite_link_text,omitempty"` + UninvitedCount *int `json:"uninvited_count,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ResentInvitation. +// MarshalJSON implements the json.Marshaler interface for ResentInvitation. // It customizes the JSON marshaling process for ResentInvitation objects. func (r *ResentInvitation) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the ResentInvitation object to a map representation for JSON marshaling. func (r *ResentInvitation) toMap() map[string]any { - structMap := make(map[string]any) - if r.LastSentAt != nil { - structMap["last_sent_at"] = r.LastSentAt - } - if r.LastAcceptedAt != nil { - structMap["last_accepted_at"] = r.LastAcceptedAt - } - if r.SendInviteLinkText != nil { - structMap["send_invite_link_text"] = r.SendInviteLinkText - } - if r.UninvitedCount != nil { - structMap["uninvited_count"] = r.UninvitedCount - } - return structMap + structMap := make(map[string]any) + if r.LastSentAt != nil { + structMap["last_sent_at"] = r.LastSentAt + } + if r.LastAcceptedAt != nil { + structMap["last_accepted_at"] = r.LastAcceptedAt + } + if r.SendInviteLinkText != nil { + structMap["send_invite_link_text"] = r.SendInviteLinkText + } + if r.UninvitedCount != nil { + structMap["uninvited_count"] = r.UninvitedCount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ResentInvitation. +// UnmarshalJSON implements the json.Unmarshaler interface for ResentInvitation. // It customizes the JSON unmarshaling process for ResentInvitation objects. func (r *ResentInvitation) UnmarshalJSON(input []byte) error { - temp := &struct { - LastSentAt *string `json:"last_sent_at,omitempty"` - LastAcceptedAt *string `json:"last_accepted_at,omitempty"` - SendInviteLinkText *string `json:"send_invite_link_text,omitempty"` - UninvitedCount *int `json:"uninvited_count,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.LastSentAt = temp.LastSentAt - r.LastAcceptedAt = temp.LastAcceptedAt - r.SendInviteLinkText = temp.SendInviteLinkText - r.UninvitedCount = temp.UninvitedCount - return nil + temp := &struct { + LastSentAt *string `json:"last_sent_at,omitempty"` + LastAcceptedAt *string `json:"last_accepted_at,omitempty"` + SendInviteLinkText *string `json:"send_invite_link_text,omitempty"` + UninvitedCount *int `json:"uninvited_count,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.LastSentAt = temp.LastSentAt + r.LastAcceptedAt = temp.LastAcceptedAt + r.SendInviteLinkText = temp.SendInviteLinkText + r.UninvitedCount = temp.UninvitedCount + return nil } diff --git a/models/revoked_invitation.go b/models/revoked_invitation.go index fcd8de69..6d8b64aa 100644 --- a/models/revoked_invitation.go +++ b/models/revoked_invitation.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // RevokedInvitation represents a RevokedInvitation struct. type RevokedInvitation struct { - LastSentAt *string `json:"last_sent_at,omitempty"` - LastAcceptedAt *string `json:"last_accepted_at,omitempty"` - UninvitedCount *int `json:"uninvited_count,omitempty"` + LastSentAt *string `json:"last_sent_at,omitempty"` + LastAcceptedAt *string `json:"last_accepted_at,omitempty"` + UninvitedCount *int `json:"uninvited_count,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for RevokedInvitation. +// MarshalJSON implements the json.Marshaler interface for RevokedInvitation. // It customizes the JSON marshaling process for RevokedInvitation objects. func (r *RevokedInvitation) MarshalJSON() ( - []byte, - error) { - return json.Marshal(r.toMap()) + []byte, + error) { + return json.Marshal(r.toMap()) } // toMap converts the RevokedInvitation object to a map representation for JSON marshaling. func (r *RevokedInvitation) toMap() map[string]any { - structMap := make(map[string]any) - if r.LastSentAt != nil { - structMap["last_sent_at"] = r.LastSentAt - } - if r.LastAcceptedAt != nil { - structMap["last_accepted_at"] = r.LastAcceptedAt - } - if r.UninvitedCount != nil { - structMap["uninvited_count"] = r.UninvitedCount - } - return structMap + structMap := make(map[string]any) + if r.LastSentAt != nil { + structMap["last_sent_at"] = r.LastSentAt + } + if r.LastAcceptedAt != nil { + structMap["last_accepted_at"] = r.LastAcceptedAt + } + if r.UninvitedCount != nil { + structMap["uninvited_count"] = r.UninvitedCount + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for RevokedInvitation. +// UnmarshalJSON implements the json.Unmarshaler interface for RevokedInvitation. // It customizes the JSON unmarshaling process for RevokedInvitation objects. func (r *RevokedInvitation) UnmarshalJSON(input []byte) error { - temp := &struct { - LastSentAt *string `json:"last_sent_at,omitempty"` - LastAcceptedAt *string `json:"last_accepted_at,omitempty"` - UninvitedCount *int `json:"uninvited_count,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - r.LastSentAt = temp.LastSentAt - r.LastAcceptedAt = temp.LastAcceptedAt - r.UninvitedCount = temp.UninvitedCount - return nil + temp := &struct { + LastSentAt *string `json:"last_sent_at,omitempty"` + LastAcceptedAt *string `json:"last_accepted_at,omitempty"` + UninvitedCount *int `json:"uninvited_count,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + r.LastSentAt = temp.LastSentAt + r.LastAcceptedAt = temp.LastAcceptedAt + r.UninvitedCount = temp.UninvitedCount + return nil } diff --git a/models/sale_rep.go b/models/sale_rep.go index 83889a0b..00f75a00 100644 --- a/models/sale_rep.go +++ b/models/sale_rep.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // SaleRep represents a SaleRep struct. type SaleRep struct { - Id *int `json:"id,omitempty"` - FullName *string `json:"full_name,omitempty"` - SubscriptionsCount *int `json:"subscriptions_count,omitempty"` - TestMode *bool `json:"test_mode,omitempty"` - Subscriptions []SaleRepSubscription `json:"subscriptions,omitempty"` + Id *int `json:"id,omitempty"` + FullName *string `json:"full_name,omitempty"` + SubscriptionsCount *int `json:"subscriptions_count,omitempty"` + TestMode *bool `json:"test_mode,omitempty"` + Subscriptions []SaleRepSubscription `json:"subscriptions,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SaleRep. +// MarshalJSON implements the json.Marshaler interface for SaleRep. // It customizes the JSON marshaling process for SaleRep objects. func (s *SaleRep) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SaleRep object to a map representation for JSON marshaling. func (s *SaleRep) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.FullName != nil { - structMap["full_name"] = s.FullName - } - if s.SubscriptionsCount != nil { - structMap["subscriptions_count"] = s.SubscriptionsCount - } - if s.TestMode != nil { - structMap["test_mode"] = s.TestMode - } - if s.Subscriptions != nil { - structMap["subscriptions"] = s.Subscriptions - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.FullName != nil { + structMap["full_name"] = s.FullName + } + if s.SubscriptionsCount != nil { + structMap["subscriptions_count"] = s.SubscriptionsCount + } + if s.TestMode != nil { + structMap["test_mode"] = s.TestMode + } + if s.Subscriptions != nil { + structMap["subscriptions"] = s.Subscriptions + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SaleRep. +// UnmarshalJSON implements the json.Unmarshaler interface for SaleRep. // It customizes the JSON unmarshaling process for SaleRep objects. func (s *SaleRep) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - FullName *string `json:"full_name,omitempty"` - SubscriptionsCount *int `json:"subscriptions_count,omitempty"` - TestMode *bool `json:"test_mode,omitempty"` - Subscriptions []SaleRepSubscription `json:"subscriptions,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.FullName = temp.FullName - s.SubscriptionsCount = temp.SubscriptionsCount - s.TestMode = temp.TestMode - s.Subscriptions = temp.Subscriptions - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + FullName *string `json:"full_name,omitempty"` + SubscriptionsCount *int `json:"subscriptions_count,omitempty"` + TestMode *bool `json:"test_mode,omitempty"` + Subscriptions []SaleRepSubscription `json:"subscriptions,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.FullName = temp.FullName + s.SubscriptionsCount = temp.SubscriptionsCount + s.TestMode = temp.TestMode + s.Subscriptions = temp.Subscriptions + return nil } diff --git a/models/sale_rep_item_mrr.go b/models/sale_rep_item_mrr.go index 123daa17..acbb75a8 100644 --- a/models/sale_rep_item_mrr.go +++ b/models/sale_rep_item_mrr.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // SaleRepItemMrr represents a SaleRepItemMrr struct. type SaleRepItemMrr struct { - Mrr *string `json:"mrr,omitempty"` - Usage *string `json:"usage,omitempty"` - Recurring *string `json:"recurring,omitempty"` + Mrr *string `json:"mrr,omitempty"` + Usage *string `json:"usage,omitempty"` + Recurring *string `json:"recurring,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SaleRepItemMrr. +// MarshalJSON implements the json.Marshaler interface for SaleRepItemMrr. // It customizes the JSON marshaling process for SaleRepItemMrr objects. func (s *SaleRepItemMrr) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SaleRepItemMrr object to a map representation for JSON marshaling. func (s *SaleRepItemMrr) toMap() map[string]any { - structMap := make(map[string]any) - if s.Mrr != nil { - structMap["mrr"] = s.Mrr - } - if s.Usage != nil { - structMap["usage"] = s.Usage - } - if s.Recurring != nil { - structMap["recurring"] = s.Recurring - } - return structMap + structMap := make(map[string]any) + if s.Mrr != nil { + structMap["mrr"] = s.Mrr + } + if s.Usage != nil { + structMap["usage"] = s.Usage + } + if s.Recurring != nil { + structMap["recurring"] = s.Recurring + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepItemMrr. +// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepItemMrr. // It customizes the JSON unmarshaling process for SaleRepItemMrr objects. func (s *SaleRepItemMrr) UnmarshalJSON(input []byte) error { - temp := &struct { - Mrr *string `json:"mrr,omitempty"` - Usage *string `json:"usage,omitempty"` - Recurring *string `json:"recurring,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Mrr = temp.Mrr - s.Usage = temp.Usage - s.Recurring = temp.Recurring - return nil + temp := &struct { + Mrr *string `json:"mrr,omitempty"` + Usage *string `json:"usage,omitempty"` + Recurring *string `json:"recurring,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Mrr = temp.Mrr + s.Usage = temp.Usage + s.Recurring = temp.Recurring + return nil } diff --git a/models/sale_rep_settings.go b/models/sale_rep_settings.go index 06290f9b..69e92c04 100644 --- a/models/sale_rep_settings.go +++ b/models/sale_rep_settings.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // SaleRepSettings represents a SaleRepSettings struct. type SaleRepSettings struct { - CustomerName *string `json:"customer_name,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - SiteLink *string `json:"site_link,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SubscriptionMrr *string `json:"subscription_mrr,omitempty"` - SalesRepId *int `json:"sales_rep_id,omitempty"` - SalesRepName *string `json:"sales_rep_name,omitempty"` + CustomerName *string `json:"customer_name,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + SiteLink *string `json:"site_link,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SubscriptionMrr *string `json:"subscription_mrr,omitempty"` + SalesRepId *int `json:"sales_rep_id,omitempty"` + SalesRepName *string `json:"sales_rep_name,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SaleRepSettings. +// MarshalJSON implements the json.Marshaler interface for SaleRepSettings. // It customizes the JSON marshaling process for SaleRepSettings objects. func (s *SaleRepSettings) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SaleRepSettings object to a map representation for JSON marshaling. func (s *SaleRepSettings) toMap() map[string]any { - structMap := make(map[string]any) - if s.CustomerName != nil { - structMap["customer_name"] = s.CustomerName - } - if s.SubscriptionId != nil { - structMap["subscription_id"] = s.SubscriptionId - } - if s.SiteLink != nil { - structMap["site_link"] = s.SiteLink - } - if s.SiteName != nil { - structMap["site_name"] = s.SiteName - } - if s.SubscriptionMrr != nil { - structMap["subscription_mrr"] = s.SubscriptionMrr - } - if s.SalesRepId != nil { - structMap["sales_rep_id"] = s.SalesRepId - } - if s.SalesRepName != nil { - structMap["sales_rep_name"] = s.SalesRepName - } - return structMap + structMap := make(map[string]any) + if s.CustomerName != nil { + structMap["customer_name"] = s.CustomerName + } + if s.SubscriptionId != nil { + structMap["subscription_id"] = s.SubscriptionId + } + if s.SiteLink != nil { + structMap["site_link"] = s.SiteLink + } + if s.SiteName != nil { + structMap["site_name"] = s.SiteName + } + if s.SubscriptionMrr != nil { + structMap["subscription_mrr"] = s.SubscriptionMrr + } + if s.SalesRepId != nil { + structMap["sales_rep_id"] = s.SalesRepId + } + if s.SalesRepName != nil { + structMap["sales_rep_name"] = s.SalesRepName + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSettings. +// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSettings. // It customizes the JSON unmarshaling process for SaleRepSettings objects. func (s *SaleRepSettings) UnmarshalJSON(input []byte) error { - temp := &struct { - CustomerName *string `json:"customer_name,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - SiteLink *string `json:"site_link,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SubscriptionMrr *string `json:"subscription_mrr,omitempty"` - SalesRepId *int `json:"sales_rep_id,omitempty"` - SalesRepName *string `json:"sales_rep_name,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.CustomerName = temp.CustomerName - s.SubscriptionId = temp.SubscriptionId - s.SiteLink = temp.SiteLink - s.SiteName = temp.SiteName - s.SubscriptionMrr = temp.SubscriptionMrr - s.SalesRepId = temp.SalesRepId - s.SalesRepName = temp.SalesRepName - return nil + temp := &struct { + CustomerName *string `json:"customer_name,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + SiteLink *string `json:"site_link,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SubscriptionMrr *string `json:"subscription_mrr,omitempty"` + SalesRepId *int `json:"sales_rep_id,omitempty"` + SalesRepName *string `json:"sales_rep_name,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.CustomerName = temp.CustomerName + s.SubscriptionId = temp.SubscriptionId + s.SiteLink = temp.SiteLink + s.SiteName = temp.SiteName + s.SubscriptionMrr = temp.SubscriptionMrr + s.SalesRepId = temp.SalesRepId + s.SalesRepName = temp.SalesRepName + return nil } diff --git a/models/sale_rep_subscription.go b/models/sale_rep_subscription.go index ac46cbb3..b9c5c031 100644 --- a/models/sale_rep_subscription.go +++ b/models/sale_rep_subscription.go @@ -1,96 +1,96 @@ package models import ( - "encoding/json" + "encoding/json" ) // SaleRepSubscription represents a SaleRepSubscription struct. type SaleRepSubscription struct { - Id *int `json:"id,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SubscriptionUrl *string `json:"subscription_url,omitempty"` - CustomerName *string `json:"customer_name,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - Mrr *string `json:"mrr,omitempty"` - Usage *string `json:"usage,omitempty"` - Recurring *string `json:"recurring,omitempty"` - LastPayment *string `json:"last_payment,omitempty"` - ChurnDate Optional[string] `json:"churn_date"` + Id *int `json:"id,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SubscriptionUrl *string `json:"subscription_url,omitempty"` + CustomerName *string `json:"customer_name,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Mrr *string `json:"mrr,omitempty"` + Usage *string `json:"usage,omitempty"` + Recurring *string `json:"recurring,omitempty"` + LastPayment *string `json:"last_payment,omitempty"` + ChurnDate Optional[string] `json:"churn_date"` } -// MarshalJSON implements the json.Marshaler interface for SaleRepSubscription. +// MarshalJSON implements the json.Marshaler interface for SaleRepSubscription. // It customizes the JSON marshaling process for SaleRepSubscription objects. func (s *SaleRepSubscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SaleRepSubscription object to a map representation for JSON marshaling. func (s *SaleRepSubscription) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.SiteName != nil { - structMap["site_name"] = s.SiteName - } - if s.SubscriptionUrl != nil { - structMap["subscription_url"] = s.SubscriptionUrl - } - if s.CustomerName != nil { - structMap["customer_name"] = s.CustomerName - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt - } - if s.Mrr != nil { - structMap["mrr"] = s.Mrr - } - if s.Usage != nil { - structMap["usage"] = s.Usage - } - if s.Recurring != nil { - structMap["recurring"] = s.Recurring - } - if s.LastPayment != nil { - structMap["last_payment"] = s.LastPayment - } - if s.ChurnDate.IsValueSet() { - structMap["churn_date"] = s.ChurnDate.Value() - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.SiteName != nil { + structMap["site_name"] = s.SiteName + } + if s.SubscriptionUrl != nil { + structMap["subscription_url"] = s.SubscriptionUrl + } + if s.CustomerName != nil { + structMap["customer_name"] = s.CustomerName + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt + } + if s.Mrr != nil { + structMap["mrr"] = s.Mrr + } + if s.Usage != nil { + structMap["usage"] = s.Usage + } + if s.Recurring != nil { + structMap["recurring"] = s.Recurring + } + if s.LastPayment != nil { + structMap["last_payment"] = s.LastPayment + } + if s.ChurnDate.IsValueSet() { + structMap["churn_date"] = s.ChurnDate.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSubscription. +// UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSubscription. // It customizes the JSON unmarshaling process for SaleRepSubscription objects. func (s *SaleRepSubscription) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SubscriptionUrl *string `json:"subscription_url,omitempty"` - CustomerName *string `json:"customer_name,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - Mrr *string `json:"mrr,omitempty"` - Usage *string `json:"usage,omitempty"` - Recurring *string `json:"recurring,omitempty"` - LastPayment *string `json:"last_payment,omitempty"` - ChurnDate Optional[string] `json:"churn_date"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.SiteName = temp.SiteName - s.SubscriptionUrl = temp.SubscriptionUrl - s.CustomerName = temp.CustomerName - s.CreatedAt = temp.CreatedAt - s.Mrr = temp.Mrr - s.Usage = temp.Usage - s.Recurring = temp.Recurring - s.LastPayment = temp.LastPayment - s.ChurnDate = temp.ChurnDate - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SubscriptionUrl *string `json:"subscription_url,omitempty"` + CustomerName *string `json:"customer_name,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Mrr *string `json:"mrr,omitempty"` + Usage *string `json:"usage,omitempty"` + Recurring *string `json:"recurring,omitempty"` + LastPayment *string `json:"last_payment,omitempty"` + ChurnDate Optional[string] `json:"churn_date"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.SiteName = temp.SiteName + s.SubscriptionUrl = temp.SubscriptionUrl + s.CustomerName = temp.CustomerName + s.CreatedAt = temp.CreatedAt + s.Mrr = temp.Mrr + s.Usage = temp.Usage + s.Recurring = temp.Recurring + s.LastPayment = temp.LastPayment + s.ChurnDate = temp.ChurnDate + return nil } diff --git a/models/segment.go b/models/segment.go index 84b5ad33..8d25f293 100644 --- a/models/segment.go +++ b/models/segment.go @@ -1,109 +1,109 @@ package models import ( - "encoding/json" + "encoding/json" ) // Segment represents a Segment struct. type Segment struct { - Id *int `json:"id,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` - SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` - SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` - SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - Prices []SegmentPrice `json:"prices,omitempty"` + Id *int `json:"id,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` + SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` + SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` + SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Prices []SegmentPrice `json:"prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Segment. +// MarshalJSON implements the json.Marshaler interface for Segment. // It customizes the JSON marshaling process for Segment objects. func (s *Segment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the Segment object to a map representation for JSON marshaling. func (s *Segment) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.ComponentId != nil { - structMap["component_id"] = s.ComponentId - } - if s.PricePointId != nil { - structMap["price_point_id"] = s.PricePointId - } - if s.EventBasedBillingMetricId != nil { - structMap["event_based_billing_metric_id"] = s.EventBasedBillingMetricId - } - if s.PricingScheme != nil { - structMap["pricing_scheme"] = s.PricingScheme - } - if s.SegmentProperty1Value != nil { - structMap["segment_property_1_value"] = s.SegmentProperty1Value - } - if s.SegmentProperty2Value != nil { - structMap["segment_property_2_value"] = s.SegmentProperty2Value - } - if s.SegmentProperty3Value != nil { - structMap["segment_property_3_value"] = s.SegmentProperty3Value - } - if s.SegmentProperty4Value != nil { - structMap["segment_property_4_value"] = s.SegmentProperty4Value - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt - } - if s.UpdatedAt != nil { - structMap["updated_at"] = s.UpdatedAt - } - if s.Prices != nil { - structMap["prices"] = s.Prices - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.ComponentId != nil { + structMap["component_id"] = s.ComponentId + } + if s.PricePointId != nil { + structMap["price_point_id"] = s.PricePointId + } + if s.EventBasedBillingMetricId != nil { + structMap["event_based_billing_metric_id"] = s.EventBasedBillingMetricId + } + if s.PricingScheme != nil { + structMap["pricing_scheme"] = s.PricingScheme + } + if s.SegmentProperty1Value != nil { + structMap["segment_property_1_value"] = s.SegmentProperty1Value + } + if s.SegmentProperty2Value != nil { + structMap["segment_property_2_value"] = s.SegmentProperty2Value + } + if s.SegmentProperty3Value != nil { + structMap["segment_property_3_value"] = s.SegmentProperty3Value + } + if s.SegmentProperty4Value != nil { + structMap["segment_property_4_value"] = s.SegmentProperty4Value + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt + } + if s.UpdatedAt != nil { + structMap["updated_at"] = s.UpdatedAt + } + if s.Prices != nil { + structMap["prices"] = s.Prices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Segment. +// UnmarshalJSON implements the json.Unmarshaler interface for Segment. // It customizes the JSON unmarshaling process for Segment objects. func (s *Segment) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"` - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` - SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` - SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` - SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - Prices []SegmentPrice `json:"prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.ComponentId = temp.ComponentId - s.PricePointId = temp.PricePointId - s.EventBasedBillingMetricId = temp.EventBasedBillingMetricId - s.PricingScheme = temp.PricingScheme - s.SegmentProperty1Value = temp.SegmentProperty1Value - s.SegmentProperty2Value = temp.SegmentProperty2Value - s.SegmentProperty3Value = temp.SegmentProperty3Value - s.SegmentProperty4Value = temp.SegmentProperty4Value - s.CreatedAt = temp.CreatedAt - s.UpdatedAt = temp.UpdatedAt - s.Prices = temp.Prices - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"` + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"` + SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"` + SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"` + SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Prices []SegmentPrice `json:"prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.ComponentId = temp.ComponentId + s.PricePointId = temp.PricePointId + s.EventBasedBillingMetricId = temp.EventBasedBillingMetricId + s.PricingScheme = temp.PricingScheme + s.SegmentProperty1Value = temp.SegmentProperty1Value + s.SegmentProperty2Value = temp.SegmentProperty2Value + s.SegmentProperty3Value = temp.SegmentProperty3Value + s.SegmentProperty4Value = temp.SegmentProperty4Value + s.CreatedAt = temp.CreatedAt + s.UpdatedAt = temp.UpdatedAt + s.Prices = temp.Prices + return nil } diff --git a/models/segment_price.go b/models/segment_price.go index 57a4b132..47487b93 100644 --- a/models/segment_price.go +++ b/models/segment_price.go @@ -1,84 +1,84 @@ package models import ( - "encoding/json" + "encoding/json" ) // SegmentPrice represents a SegmentPrice struct. type SegmentPrice struct { - Id *int `json:"id,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - StartingQuantity *int `json:"starting_quantity,omitempty"` - EndingQuantity Optional[int] `json:"ending_quantity"` - UnitPrice *string `json:"unit_price,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - FormattedUnitPrice *string `json:"formatted_unit_price,omitempty"` - SegmentId *int `json:"segment_id,omitempty"` + Id *int `json:"id,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + StartingQuantity *int `json:"starting_quantity,omitempty"` + EndingQuantity Optional[int] `json:"ending_quantity"` + UnitPrice *string `json:"unit_price,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + FormattedUnitPrice *string `json:"formatted_unit_price,omitempty"` + SegmentId *int `json:"segment_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SegmentPrice. +// MarshalJSON implements the json.Marshaler interface for SegmentPrice. // It customizes the JSON marshaling process for SegmentPrice objects. func (s *SegmentPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SegmentPrice object to a map representation for JSON marshaling. func (s *SegmentPrice) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.ComponentId != nil { - structMap["component_id"] = s.ComponentId - } - if s.StartingQuantity != nil { - structMap["starting_quantity"] = s.StartingQuantity - } - if s.EndingQuantity.IsValueSet() { - structMap["ending_quantity"] = s.EndingQuantity.Value() - } - if s.UnitPrice != nil { - structMap["unit_price"] = s.UnitPrice - } - if s.PricePointId != nil { - structMap["price_point_id"] = s.PricePointId - } - if s.FormattedUnitPrice != nil { - structMap["formatted_unit_price"] = s.FormattedUnitPrice - } - if s.SegmentId != nil { - structMap["segment_id"] = s.SegmentId - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.ComponentId != nil { + structMap["component_id"] = s.ComponentId + } + if s.StartingQuantity != nil { + structMap["starting_quantity"] = s.StartingQuantity + } + if s.EndingQuantity.IsValueSet() { + structMap["ending_quantity"] = s.EndingQuantity.Value() + } + if s.UnitPrice != nil { + structMap["unit_price"] = s.UnitPrice + } + if s.PricePointId != nil { + structMap["price_point_id"] = s.PricePointId + } + if s.FormattedUnitPrice != nil { + structMap["formatted_unit_price"] = s.FormattedUnitPrice + } + if s.SegmentId != nil { + structMap["segment_id"] = s.SegmentId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SegmentPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for SegmentPrice. // It customizes the JSON unmarshaling process for SegmentPrice objects. func (s *SegmentPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - StartingQuantity *int `json:"starting_quantity,omitempty"` - EndingQuantity Optional[int] `json:"ending_quantity"` - UnitPrice *string `json:"unit_price,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - FormattedUnitPrice *string `json:"formatted_unit_price,omitempty"` - SegmentId *int `json:"segment_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.ComponentId = temp.ComponentId - s.StartingQuantity = temp.StartingQuantity - s.EndingQuantity = temp.EndingQuantity - s.UnitPrice = temp.UnitPrice - s.PricePointId = temp.PricePointId - s.FormattedUnitPrice = temp.FormattedUnitPrice - s.SegmentId = temp.SegmentId - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + StartingQuantity *int `json:"starting_quantity,omitempty"` + EndingQuantity Optional[int] `json:"ending_quantity"` + UnitPrice *string `json:"unit_price,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + FormattedUnitPrice *string `json:"formatted_unit_price,omitempty"` + SegmentId *int `json:"segment_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.ComponentId = temp.ComponentId + s.StartingQuantity = temp.StartingQuantity + s.EndingQuantity = temp.EndingQuantity + s.UnitPrice = temp.UnitPrice + s.PricePointId = temp.PricePointId + s.FormattedUnitPrice = temp.FormattedUnitPrice + s.SegmentId = temp.SegmentId + return nil } diff --git a/models/segment_response.go b/models/segment_response.go index 1649a258..45e134f2 100644 --- a/models/segment_response.go +++ b/models/segment_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // SegmentResponse represents a SegmentResponse struct. type SegmentResponse struct { - Segment *Segment `json:"segment,omitempty"` + Segment *Segment `json:"segment,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SegmentResponse. +// MarshalJSON implements the json.Marshaler interface for SegmentResponse. // It customizes the JSON marshaling process for SegmentResponse objects. func (s *SegmentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SegmentResponse object to a map representation for JSON marshaling. func (s *SegmentResponse) toMap() map[string]any { - structMap := make(map[string]any) - if s.Segment != nil { - structMap["segment"] = s.Segment - } - return structMap + structMap := make(map[string]any) + if s.Segment != nil { + structMap["segment"] = s.Segment.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SegmentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SegmentResponse. // It customizes the JSON unmarshaling process for SegmentResponse objects. func (s *SegmentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Segment *Segment `json:"segment,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Segment = temp.Segment - return nil + temp := &struct { + Segment *Segment `json:"segment,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Segment = temp.Segment + return nil } diff --git a/models/seller.go b/models/seller.go index 3b46c36e..a82e4926 100644 --- a/models/seller.go +++ b/models/seller.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // Seller represents a Seller struct. type Seller struct { - Name *string `json:"name,omitempty"` - Address *InvoiceAddress `json:"address,omitempty"` - Phone *string `json:"phone,omitempty"` - LogoUrl Optional[string] `json:"logo_url"` + Name *string `json:"name,omitempty"` + Address *InvoiceAddress `json:"address,omitempty"` + Phone *string `json:"phone,omitempty"` + LogoUrl Optional[string] `json:"logo_url"` } -// MarshalJSON implements the json.Marshaler interface for Seller. +// MarshalJSON implements the json.Marshaler interface for Seller. // It customizes the JSON marshaling process for Seller objects. func (s *Seller) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the Seller object to a map representation for JSON marshaling. func (s *Seller) toMap() map[string]any { - structMap := make(map[string]any) - if s.Name != nil { - structMap["name"] = s.Name - } - if s.Address != nil { - structMap["address"] = s.Address - } - if s.Phone != nil { - structMap["phone"] = s.Phone - } - if s.LogoUrl.IsValueSet() { - structMap["logo_url"] = s.LogoUrl.Value() - } - return structMap + structMap := make(map[string]any) + if s.Name != nil { + structMap["name"] = s.Name + } + if s.Address != nil { + structMap["address"] = s.Address.toMap() + } + if s.Phone != nil { + structMap["phone"] = s.Phone + } + if s.LogoUrl.IsValueSet() { + structMap["logo_url"] = s.LogoUrl.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Seller. +// UnmarshalJSON implements the json.Unmarshaler interface for Seller. // It customizes the JSON unmarshaling process for Seller objects. func (s *Seller) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Address *InvoiceAddress `json:"address,omitempty"` - Phone *string `json:"phone,omitempty"` - LogoUrl Optional[string] `json:"logo_url"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Name = temp.Name - s.Address = temp.Address - s.Phone = temp.Phone - s.LogoUrl = temp.LogoUrl - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Address *InvoiceAddress `json:"address,omitempty"` + Phone *string `json:"phone,omitempty"` + LogoUrl Optional[string] `json:"logo_url"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Name = temp.Name + s.Address = temp.Address + s.Phone = temp.Phone + s.LogoUrl = temp.LogoUrl + return nil } diff --git a/models/send_invoice_request.go b/models/send_invoice_request.go index 9fda0f32..64322a23 100644 --- a/models/send_invoice_request.go +++ b/models/send_invoice_request.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // SendInvoiceRequest represents a SendInvoiceRequest struct. type SendInvoiceRequest struct { - RecipientEmails []string `json:"recipient_emails,omitempty"` - CcRecipientEmails []string `json:"cc_recipient_emails,omitempty"` - BccRecipientEmails []string `json:"bcc_recipient_emails,omitempty"` + RecipientEmails []string `json:"recipient_emails,omitempty"` + CcRecipientEmails []string `json:"cc_recipient_emails,omitempty"` + BccRecipientEmails []string `json:"bcc_recipient_emails,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SendInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for SendInvoiceRequest. // It customizes the JSON marshaling process for SendInvoiceRequest objects. func (s *SendInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SendInvoiceRequest object to a map representation for JSON marshaling. func (s *SendInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - if s.RecipientEmails != nil { - structMap["recipient_emails"] = s.RecipientEmails - } - if s.CcRecipientEmails != nil { - structMap["cc_recipient_emails"] = s.CcRecipientEmails - } - if s.BccRecipientEmails != nil { - structMap["bcc_recipient_emails"] = s.BccRecipientEmails - } - return structMap + structMap := make(map[string]any) + if s.RecipientEmails != nil { + structMap["recipient_emails"] = s.RecipientEmails + } + if s.CcRecipientEmails != nil { + structMap["cc_recipient_emails"] = s.CcRecipientEmails + } + if s.BccRecipientEmails != nil { + structMap["bcc_recipient_emails"] = s.BccRecipientEmails + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SendInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for SendInvoiceRequest. // It customizes the JSON unmarshaling process for SendInvoiceRequest objects. func (s *SendInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - RecipientEmails []string `json:"recipient_emails,omitempty"` - CcRecipientEmails []string `json:"cc_recipient_emails,omitempty"` - BccRecipientEmails []string `json:"bcc_recipient_emails,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.RecipientEmails = temp.RecipientEmails - s.CcRecipientEmails = temp.CcRecipientEmails - s.BccRecipientEmails = temp.BccRecipientEmails - return nil + temp := &struct { + RecipientEmails []string `json:"recipient_emails,omitempty"` + CcRecipientEmails []string `json:"cc_recipient_emails,omitempty"` + BccRecipientEmails []string `json:"bcc_recipient_emails,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.RecipientEmails = temp.RecipientEmails + s.CcRecipientEmails = temp.CcRecipientEmails + s.BccRecipientEmails = temp.BccRecipientEmails + return nil } diff --git a/models/service_credit.go b/models/service_credit.go index 8ac240a2..eb4d5b67 100644 --- a/models/service_credit.go +++ b/models/service_credit.go @@ -1,70 +1,70 @@ package models import ( - "encoding/json" + "encoding/json" ) // ServiceCredit represents a ServiceCredit struct. type ServiceCredit struct { - Id *int `json:"id,omitempty"` - // The amount in cents of the entry - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - // The new balance for the credit account - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` - // The type of entry - EntryType *ServiceCreditType `json:"entry_type,omitempty"` - // The memo attached to the entry - Memo *string `json:"memo,omitempty"` + Id *int `json:"id,omitempty"` + // The amount in cents of the entry + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + // The new balance for the credit account + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + // The type of entry + EntryType *ServiceCreditType `json:"entry_type,omitempty"` + // The memo attached to the entry + Memo *string `json:"memo,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for ServiceCredit. +// MarshalJSON implements the json.Marshaler interface for ServiceCredit. // It customizes the JSON marshaling process for ServiceCredit objects. func (s *ServiceCredit) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the ServiceCredit object to a map representation for JSON marshaling. func (s *ServiceCredit) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.AmountInCents != nil { - structMap["amount_in_cents"] = s.AmountInCents - } - if s.EndingBalanceInCents != nil { - structMap["ending_balance_in_cents"] = s.EndingBalanceInCents - } - if s.EntryType != nil { - structMap["entry_type"] = s.EntryType - } - if s.Memo != nil { - structMap["memo"] = s.Memo - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.AmountInCents != nil { + structMap["amount_in_cents"] = s.AmountInCents + } + if s.EndingBalanceInCents != nil { + structMap["ending_balance_in_cents"] = s.EndingBalanceInCents + } + if s.EntryType != nil { + structMap["entry_type"] = s.EntryType + } + if s.Memo != nil { + structMap["memo"] = s.Memo + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ServiceCredit. +// UnmarshalJSON implements the json.Unmarshaler interface for ServiceCredit. // It customizes the JSON unmarshaling process for ServiceCredit objects. func (s *ServiceCredit) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` - EntryType *ServiceCreditType `json:"entry_type,omitempty"` - Memo *string `json:"memo,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.AmountInCents = temp.AmountInCents - s.EndingBalanceInCents = temp.EndingBalanceInCents - s.EntryType = temp.EntryType - s.Memo = temp.Memo - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + EntryType *ServiceCreditType `json:"entry_type,omitempty"` + Memo *string `json:"memo,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.AmountInCents = temp.AmountInCents + s.EndingBalanceInCents = temp.EndingBalanceInCents + s.EntryType = temp.EntryType + s.Memo = temp.Memo + return nil } diff --git a/models/service_credit_response.go b/models/service_credit_response.go index 4ac6b477..22a9aecd 100644 --- a/models/service_credit_response.go +++ b/models/service_credit_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // ServiceCreditResponse represents a ServiceCreditResponse struct. type ServiceCreditResponse struct { - ServiceCredit ServiceCredit `json:"service_credit"` + ServiceCredit ServiceCredit `json:"service_credit"` } -// MarshalJSON implements the json.Marshaler interface for ServiceCreditResponse. +// MarshalJSON implements the json.Marshaler interface for ServiceCreditResponse. // It customizes the JSON marshaling process for ServiceCreditResponse objects. func (s *ServiceCreditResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the ServiceCreditResponse object to a map representation for JSON marshaling. func (s *ServiceCreditResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["service_credit"] = s.ServiceCredit - return structMap + structMap := make(map[string]any) + structMap["service_credit"] = s.ServiceCredit.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ServiceCreditResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for ServiceCreditResponse. // It customizes the JSON unmarshaling process for ServiceCreditResponse objects. func (s *ServiceCreditResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ServiceCredit ServiceCredit `json:"service_credit"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ServiceCredit = temp.ServiceCredit - return nil + temp := &struct { + ServiceCredit ServiceCredit `json:"service_credit"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ServiceCredit = temp.ServiceCredit + return nil } diff --git a/models/shipping_address.go b/models/shipping_address.go index 1c57cc71..42e2a05d 100644 --- a/models/shipping_address.go +++ b/models/shipping_address.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // ShippingAddress represents a ShippingAddress struct. type ShippingAddress struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` } -// MarshalJSON implements the json.Marshaler interface for ShippingAddress. +// MarshalJSON implements the json.Marshaler interface for ShippingAddress. // It customizes the JSON marshaling process for ShippingAddress objects. func (s *ShippingAddress) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the ShippingAddress object to a map representation for JSON marshaling. func (s *ShippingAddress) toMap() map[string]any { - structMap := make(map[string]any) - if s.Street.IsValueSet() { - structMap["street"] = s.Street.Value() - } - if s.Line2.IsValueSet() { - structMap["line2"] = s.Line2.Value() - } - if s.City.IsValueSet() { - structMap["city"] = s.City.Value() - } - if s.State.IsValueSet() { - structMap["state"] = s.State.Value() - } - if s.Zip.IsValueSet() { - structMap["zip"] = s.Zip.Value() - } - if s.Country.IsValueSet() { - structMap["country"] = s.Country.Value() - } - return structMap + structMap := make(map[string]any) + if s.Street.IsValueSet() { + structMap["street"] = s.Street.Value() + } + if s.Line2.IsValueSet() { + structMap["line2"] = s.Line2.Value() + } + if s.City.IsValueSet() { + structMap["city"] = s.City.Value() + } + if s.State.IsValueSet() { + structMap["state"] = s.State.Value() + } + if s.Zip.IsValueSet() { + structMap["zip"] = s.Zip.Value() + } + if s.Country.IsValueSet() { + structMap["country"] = s.Country.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for ShippingAddress. +// UnmarshalJSON implements the json.Unmarshaler interface for ShippingAddress. // It customizes the JSON unmarshaling process for ShippingAddress objects. func (s *ShippingAddress) UnmarshalJSON(input []byte) error { - temp := &struct { - Street Optional[string] `json:"street"` - Line2 Optional[string] `json:"line2"` - City Optional[string] `json:"city"` - State Optional[string] `json:"state"` - Zip Optional[string] `json:"zip"` - Country Optional[string] `json:"country"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Street = temp.Street - s.Line2 = temp.Line2 - s.City = temp.City - s.State = temp.State - s.Zip = temp.Zip - s.Country = temp.Country - return nil + temp := &struct { + Street Optional[string] `json:"street"` + Line2 Optional[string] `json:"line2"` + City Optional[string] `json:"city"` + State Optional[string] `json:"state"` + Zip Optional[string] `json:"zip"` + Country Optional[string] `json:"country"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Street = temp.Street + s.Line2 = temp.Line2 + s.City = temp.City + s.State = temp.State + s.Zip = temp.Zip + s.Country = temp.Country + return nil } diff --git a/models/signup_proforma_preview.go b/models/signup_proforma_preview.go index 11335608..e68dd3a0 100644 --- a/models/signup_proforma_preview.go +++ b/models/signup_proforma_preview.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // SignupProformaPreview represents a SignupProformaPreview struct. type SignupProformaPreview struct { - CurrentProformaInvoice *ProformaInvoice `json:"current_proforma_invoice,omitempty"` - NextProformaInvoice *ProformaInvoice `json:"next_proforma_invoice,omitempty"` + CurrentProformaInvoice *ProformaInvoice `json:"current_proforma_invoice,omitempty"` + NextProformaInvoice *ProformaInvoice `json:"next_proforma_invoice,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SignupProformaPreview. +// MarshalJSON implements the json.Marshaler interface for SignupProformaPreview. // It customizes the JSON marshaling process for SignupProformaPreview objects. func (s *SignupProformaPreview) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SignupProformaPreview object to a map representation for JSON marshaling. func (s *SignupProformaPreview) toMap() map[string]any { - structMap := make(map[string]any) - if s.CurrentProformaInvoice != nil { - structMap["current_proforma_invoice"] = s.CurrentProformaInvoice - } - if s.NextProformaInvoice != nil { - structMap["next_proforma_invoice"] = s.NextProformaInvoice - } - return structMap + structMap := make(map[string]any) + if s.CurrentProformaInvoice != nil { + structMap["current_proforma_invoice"] = s.CurrentProformaInvoice.toMap() + } + if s.NextProformaInvoice != nil { + structMap["next_proforma_invoice"] = s.NextProformaInvoice.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreview. +// UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreview. // It customizes the JSON unmarshaling process for SignupProformaPreview objects. func (s *SignupProformaPreview) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrentProformaInvoice *ProformaInvoice `json:"current_proforma_invoice,omitempty"` - NextProformaInvoice *ProformaInvoice `json:"next_proforma_invoice,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.CurrentProformaInvoice = temp.CurrentProformaInvoice - s.NextProformaInvoice = temp.NextProformaInvoice - return nil + temp := &struct { + CurrentProformaInvoice *ProformaInvoice `json:"current_proforma_invoice,omitempty"` + NextProformaInvoice *ProformaInvoice `json:"next_proforma_invoice,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.CurrentProformaInvoice = temp.CurrentProformaInvoice + s.NextProformaInvoice = temp.NextProformaInvoice + return nil } diff --git a/models/signup_proforma_preview_response.go b/models/signup_proforma_preview_response.go index eb6bdc61..7ebbb180 100644 --- a/models/signup_proforma_preview_response.go +++ b/models/signup_proforma_preview_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SignupProformaPreviewResponse represents a SignupProformaPreviewResponse struct. type SignupProformaPreviewResponse struct { - ProformaInvoicePreview SignupProformaPreview `json:"proforma_invoice_preview"` + ProformaInvoicePreview SignupProformaPreview `json:"proforma_invoice_preview"` } -// MarshalJSON implements the json.Marshaler interface for SignupProformaPreviewResponse. +// MarshalJSON implements the json.Marshaler interface for SignupProformaPreviewResponse. // It customizes the JSON marshaling process for SignupProformaPreviewResponse objects. func (s *SignupProformaPreviewResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SignupProformaPreviewResponse object to a map representation for JSON marshaling. func (s *SignupProformaPreviewResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["proforma_invoice_preview"] = s.ProformaInvoicePreview - return structMap + structMap := make(map[string]any) + structMap["proforma_invoice_preview"] = s.ProformaInvoicePreview.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreviewResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreviewResponse. // It customizes the JSON unmarshaling process for SignupProformaPreviewResponse objects. func (s *SignupProformaPreviewResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - ProformaInvoicePreview SignupProformaPreview `json:"proforma_invoice_preview"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ProformaInvoicePreview = temp.ProformaInvoicePreview - return nil + temp := &struct { + ProformaInvoicePreview SignupProformaPreview `json:"proforma_invoice_preview"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ProformaInvoicePreview = temp.ProformaInvoicePreview + return nil } diff --git a/models/site.go b/models/site.go index 2a698f0e..5bcc7373 100644 --- a/models/site.go +++ b/models/site.go @@ -1,132 +1,132 @@ package models import ( - "encoding/json" + "encoding/json" ) // Site represents a Site struct. type Site struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Subdomain *string `json:"subdomain,omitempty"` - Currency *string `json:"currency,omitempty"` - SellerId *int `json:"seller_id,omitempty"` - NonPrimaryCurrencies []string `json:"non_primary_currencies,omitempty"` - RelationshipInvoicingEnabled *bool `json:"relationship_invoicing_enabled,omitempty"` - CustomerHierarchyEnabled *bool `json:"customer_hierarchy_enabled,omitempty"` - WhopaysEnabled *bool `json:"whopays_enabled,omitempty"` - WhopaysDefaultPayer *string `json:"whopays_default_payer,omitempty"` - AllocationSettings *AllocationSettings `json:"allocation_settings,omitempty"` - DefaultPaymentCollectionMethod *string `json:"default_payment_collection_method,omitempty"` - OrganizationAddress *OrganizationAddress `json:"organization_address,omitempty"` - TaxConfiguration *TaxConfiguration `json:"tax_configuration,omitempty"` - NetTerms *NetTerms `json:"net_terms,omitempty"` - Test *bool `json:"test,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Subdomain *string `json:"subdomain,omitempty"` + Currency *string `json:"currency,omitempty"` + SellerId *int `json:"seller_id,omitempty"` + NonPrimaryCurrencies []string `json:"non_primary_currencies,omitempty"` + RelationshipInvoicingEnabled *bool `json:"relationship_invoicing_enabled,omitempty"` + CustomerHierarchyEnabled *bool `json:"customer_hierarchy_enabled,omitempty"` + WhopaysEnabled *bool `json:"whopays_enabled,omitempty"` + WhopaysDefaultPayer *string `json:"whopays_default_payer,omitempty"` + AllocationSettings *AllocationSettings `json:"allocation_settings,omitempty"` + DefaultPaymentCollectionMethod *string `json:"default_payment_collection_method,omitempty"` + OrganizationAddress *OrganizationAddress `json:"organization_address,omitempty"` + TaxConfiguration *TaxConfiguration `json:"tax_configuration,omitempty"` + NetTerms *NetTerms `json:"net_terms,omitempty"` + Test *bool `json:"test,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Site. +// MarshalJSON implements the json.Marshaler interface for Site. // It customizes the JSON marshaling process for Site objects. func (s *Site) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the Site object to a map representation for JSON marshaling. func (s *Site) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.Name != nil { - structMap["name"] = s.Name - } - if s.Subdomain != nil { - structMap["subdomain"] = s.Subdomain - } - if s.Currency != nil { - structMap["currency"] = s.Currency - } - if s.SellerId != nil { - structMap["seller_id"] = s.SellerId - } - if s.NonPrimaryCurrencies != nil { - structMap["non_primary_currencies"] = s.NonPrimaryCurrencies - } - if s.RelationshipInvoicingEnabled != nil { - structMap["relationship_invoicing_enabled"] = s.RelationshipInvoicingEnabled - } - if s.CustomerHierarchyEnabled != nil { - structMap["customer_hierarchy_enabled"] = s.CustomerHierarchyEnabled - } - if s.WhopaysEnabled != nil { - structMap["whopays_enabled"] = s.WhopaysEnabled - } - if s.WhopaysDefaultPayer != nil { - structMap["whopays_default_payer"] = s.WhopaysDefaultPayer - } - if s.AllocationSettings != nil { - structMap["allocation_settings"] = s.AllocationSettings - } - if s.DefaultPaymentCollectionMethod != nil { - structMap["default_payment_collection_method"] = s.DefaultPaymentCollectionMethod - } - if s.OrganizationAddress != nil { - structMap["organization_address"] = s.OrganizationAddress - } - if s.TaxConfiguration != nil { - structMap["tax_configuration"] = s.TaxConfiguration - } - if s.NetTerms != nil { - structMap["net_terms"] = s.NetTerms - } - if s.Test != nil { - structMap["test"] = s.Test - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.Name != nil { + structMap["name"] = s.Name + } + if s.Subdomain != nil { + structMap["subdomain"] = s.Subdomain + } + if s.Currency != nil { + structMap["currency"] = s.Currency + } + if s.SellerId != nil { + structMap["seller_id"] = s.SellerId + } + if s.NonPrimaryCurrencies != nil { + structMap["non_primary_currencies"] = s.NonPrimaryCurrencies + } + if s.RelationshipInvoicingEnabled != nil { + structMap["relationship_invoicing_enabled"] = s.RelationshipInvoicingEnabled + } + if s.CustomerHierarchyEnabled != nil { + structMap["customer_hierarchy_enabled"] = s.CustomerHierarchyEnabled + } + if s.WhopaysEnabled != nil { + structMap["whopays_enabled"] = s.WhopaysEnabled + } + if s.WhopaysDefaultPayer != nil { + structMap["whopays_default_payer"] = s.WhopaysDefaultPayer + } + if s.AllocationSettings != nil { + structMap["allocation_settings"] = s.AllocationSettings.toMap() + } + if s.DefaultPaymentCollectionMethod != nil { + structMap["default_payment_collection_method"] = s.DefaultPaymentCollectionMethod + } + if s.OrganizationAddress != nil { + structMap["organization_address"] = s.OrganizationAddress.toMap() + } + if s.TaxConfiguration != nil { + structMap["tax_configuration"] = s.TaxConfiguration.toMap() + } + if s.NetTerms != nil { + structMap["net_terms"] = s.NetTerms.toMap() + } + if s.Test != nil { + structMap["test"] = s.Test + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Site. +// UnmarshalJSON implements the json.Unmarshaler interface for Site. // It customizes the JSON unmarshaling process for Site objects. func (s *Site) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Subdomain *string `json:"subdomain,omitempty"` - Currency *string `json:"currency,omitempty"` - SellerId *int `json:"seller_id,omitempty"` - NonPrimaryCurrencies []string `json:"non_primary_currencies,omitempty"` - RelationshipInvoicingEnabled *bool `json:"relationship_invoicing_enabled,omitempty"` - CustomerHierarchyEnabled *bool `json:"customer_hierarchy_enabled,omitempty"` - WhopaysEnabled *bool `json:"whopays_enabled,omitempty"` - WhopaysDefaultPayer *string `json:"whopays_default_payer,omitempty"` - AllocationSettings *AllocationSettings `json:"allocation_settings,omitempty"` - DefaultPaymentCollectionMethod *string `json:"default_payment_collection_method,omitempty"` - OrganizationAddress *OrganizationAddress `json:"organization_address,omitempty"` - TaxConfiguration *TaxConfiguration `json:"tax_configuration,omitempty"` - NetTerms *NetTerms `json:"net_terms,omitempty"` - Test *bool `json:"test,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.Name = temp.Name - s.Subdomain = temp.Subdomain - s.Currency = temp.Currency - s.SellerId = temp.SellerId - s.NonPrimaryCurrencies = temp.NonPrimaryCurrencies - s.RelationshipInvoicingEnabled = temp.RelationshipInvoicingEnabled - s.CustomerHierarchyEnabled = temp.CustomerHierarchyEnabled - s.WhopaysEnabled = temp.WhopaysEnabled - s.WhopaysDefaultPayer = temp.WhopaysDefaultPayer - s.AllocationSettings = temp.AllocationSettings - s.DefaultPaymentCollectionMethod = temp.DefaultPaymentCollectionMethod - s.OrganizationAddress = temp.OrganizationAddress - s.TaxConfiguration = temp.TaxConfiguration - s.NetTerms = temp.NetTerms - s.Test = temp.Test - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Subdomain *string `json:"subdomain,omitempty"` + Currency *string `json:"currency,omitempty"` + SellerId *int `json:"seller_id,omitempty"` + NonPrimaryCurrencies []string `json:"non_primary_currencies,omitempty"` + RelationshipInvoicingEnabled *bool `json:"relationship_invoicing_enabled,omitempty"` + CustomerHierarchyEnabled *bool `json:"customer_hierarchy_enabled,omitempty"` + WhopaysEnabled *bool `json:"whopays_enabled,omitempty"` + WhopaysDefaultPayer *string `json:"whopays_default_payer,omitempty"` + AllocationSettings *AllocationSettings `json:"allocation_settings,omitempty"` + DefaultPaymentCollectionMethod *string `json:"default_payment_collection_method,omitempty"` + OrganizationAddress *OrganizationAddress `json:"organization_address,omitempty"` + TaxConfiguration *TaxConfiguration `json:"tax_configuration,omitempty"` + NetTerms *NetTerms `json:"net_terms,omitempty"` + Test *bool `json:"test,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.Name = temp.Name + s.Subdomain = temp.Subdomain + s.Currency = temp.Currency + s.SellerId = temp.SellerId + s.NonPrimaryCurrencies = temp.NonPrimaryCurrencies + s.RelationshipInvoicingEnabled = temp.RelationshipInvoicingEnabled + s.CustomerHierarchyEnabled = temp.CustomerHierarchyEnabled + s.WhopaysEnabled = temp.WhopaysEnabled + s.WhopaysDefaultPayer = temp.WhopaysDefaultPayer + s.AllocationSettings = temp.AllocationSettings + s.DefaultPaymentCollectionMethod = temp.DefaultPaymentCollectionMethod + s.OrganizationAddress = temp.OrganizationAddress + s.TaxConfiguration = temp.TaxConfiguration + s.NetTerms = temp.NetTerms + s.Test = temp.Test + return nil } diff --git a/models/site_response.go b/models/site_response.go index 18f246af..e2203e28 100644 --- a/models/site_response.go +++ b/models/site_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SiteResponse represents a SiteResponse struct. type SiteResponse struct { - Site Site `json:"site"` + Site Site `json:"site"` } -// MarshalJSON implements the json.Marshaler interface for SiteResponse. +// MarshalJSON implements the json.Marshaler interface for SiteResponse. // It customizes the JSON marshaling process for SiteResponse objects. func (s *SiteResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SiteResponse object to a map representation for JSON marshaling. func (s *SiteResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["site"] = s.Site - return structMap + structMap := make(map[string]any) + structMap["site"] = s.Site.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SiteResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SiteResponse. // It customizes the JSON unmarshaling process for SiteResponse objects. func (s *SiteResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Site Site `json:"site"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Site = temp.Site - return nil + temp := &struct { + Site Site `json:"site"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Site = temp.Site + return nil } diff --git a/models/site_statistics.go b/models/site_statistics.go index 14625b45..e57a3b9c 100644 --- a/models/site_statistics.go +++ b/models/site_statistics.go @@ -1,102 +1,102 @@ package models import ( - "encoding/json" + "encoding/json" ) // SiteStatistics represents a SiteStatistics struct. type SiteStatistics struct { - TotalSubscriptions *int `json:"total_subscriptions,omitempty"` - SubscriptionsToday *int `json:"subscriptions_today,omitempty"` - TotalRevenue *string `json:"total_revenue,omitempty"` - RevenueToday *string `json:"revenue_today,omitempty"` - RevenueThisMonth *string `json:"revenue_this_month,omitempty"` - RevenueThisYear *string `json:"revenue_this_year,omitempty"` - TotalCanceledSubscriptions *int `json:"total_canceled_subscriptions,omitempty"` - TotalActiveSubscriptions *float64 `json:"total_active_subscriptions,omitempty"` - TotalPastDueSubscriptions *float64 `json:"total_past_due_subscriptions,omitempty"` - TotalUnpaidSubscriptions *float64 `json:"total_unpaid_subscriptions,omitempty"` - TotalDunningSubscriptions *float64 `json:"total_dunning_subscriptions,omitempty"` + TotalSubscriptions *int `json:"total_subscriptions,omitempty"` + SubscriptionsToday *int `json:"subscriptions_today,omitempty"` + TotalRevenue *string `json:"total_revenue,omitempty"` + RevenueToday *string `json:"revenue_today,omitempty"` + RevenueThisMonth *string `json:"revenue_this_month,omitempty"` + RevenueThisYear *string `json:"revenue_this_year,omitempty"` + TotalCanceledSubscriptions *int `json:"total_canceled_subscriptions,omitempty"` + TotalActiveSubscriptions *float64 `json:"total_active_subscriptions,omitempty"` + TotalPastDueSubscriptions *float64 `json:"total_past_due_subscriptions,omitempty"` + TotalUnpaidSubscriptions *float64 `json:"total_unpaid_subscriptions,omitempty"` + TotalDunningSubscriptions *float64 `json:"total_dunning_subscriptions,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SiteStatistics. +// MarshalJSON implements the json.Marshaler interface for SiteStatistics. // It customizes the JSON marshaling process for SiteStatistics objects. func (s *SiteStatistics) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SiteStatistics object to a map representation for JSON marshaling. func (s *SiteStatistics) toMap() map[string]any { - structMap := make(map[string]any) - if s.TotalSubscriptions != nil { - structMap["total_subscriptions"] = s.TotalSubscriptions - } - if s.SubscriptionsToday != nil { - structMap["subscriptions_today"] = s.SubscriptionsToday - } - if s.TotalRevenue != nil { - structMap["total_revenue"] = s.TotalRevenue - } - if s.RevenueToday != nil { - structMap["revenue_today"] = s.RevenueToday - } - if s.RevenueThisMonth != nil { - structMap["revenue_this_month"] = s.RevenueThisMonth - } - if s.RevenueThisYear != nil { - structMap["revenue_this_year"] = s.RevenueThisYear - } - if s.TotalCanceledSubscriptions != nil { - structMap["total_canceled_subscriptions"] = s.TotalCanceledSubscriptions - } - if s.TotalActiveSubscriptions != nil { - structMap["total_active_subscriptions"] = s.TotalActiveSubscriptions - } - if s.TotalPastDueSubscriptions != nil { - structMap["total_past_due_subscriptions"] = s.TotalPastDueSubscriptions - } - if s.TotalUnpaidSubscriptions != nil { - structMap["total_unpaid_subscriptions"] = s.TotalUnpaidSubscriptions - } - if s.TotalDunningSubscriptions != nil { - structMap["total_dunning_subscriptions"] = s.TotalDunningSubscriptions - } - return structMap + structMap := make(map[string]any) + if s.TotalSubscriptions != nil { + structMap["total_subscriptions"] = s.TotalSubscriptions + } + if s.SubscriptionsToday != nil { + structMap["subscriptions_today"] = s.SubscriptionsToday + } + if s.TotalRevenue != nil { + structMap["total_revenue"] = s.TotalRevenue + } + if s.RevenueToday != nil { + structMap["revenue_today"] = s.RevenueToday + } + if s.RevenueThisMonth != nil { + structMap["revenue_this_month"] = s.RevenueThisMonth + } + if s.RevenueThisYear != nil { + structMap["revenue_this_year"] = s.RevenueThisYear + } + if s.TotalCanceledSubscriptions != nil { + structMap["total_canceled_subscriptions"] = s.TotalCanceledSubscriptions + } + if s.TotalActiveSubscriptions != nil { + structMap["total_active_subscriptions"] = s.TotalActiveSubscriptions + } + if s.TotalPastDueSubscriptions != nil { + structMap["total_past_due_subscriptions"] = s.TotalPastDueSubscriptions + } + if s.TotalUnpaidSubscriptions != nil { + structMap["total_unpaid_subscriptions"] = s.TotalUnpaidSubscriptions + } + if s.TotalDunningSubscriptions != nil { + structMap["total_dunning_subscriptions"] = s.TotalDunningSubscriptions + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SiteStatistics. +// UnmarshalJSON implements the json.Unmarshaler interface for SiteStatistics. // It customizes the JSON unmarshaling process for SiteStatistics objects. func (s *SiteStatistics) UnmarshalJSON(input []byte) error { - temp := &struct { - TotalSubscriptions *int `json:"total_subscriptions,omitempty"` - SubscriptionsToday *int `json:"subscriptions_today,omitempty"` - TotalRevenue *string `json:"total_revenue,omitempty"` - RevenueToday *string `json:"revenue_today,omitempty"` - RevenueThisMonth *string `json:"revenue_this_month,omitempty"` - RevenueThisYear *string `json:"revenue_this_year,omitempty"` - TotalCanceledSubscriptions *int `json:"total_canceled_subscriptions,omitempty"` - TotalActiveSubscriptions *float64 `json:"total_active_subscriptions,omitempty"` - TotalPastDueSubscriptions *float64 `json:"total_past_due_subscriptions,omitempty"` - TotalUnpaidSubscriptions *float64 `json:"total_unpaid_subscriptions,omitempty"` - TotalDunningSubscriptions *float64 `json:"total_dunning_subscriptions,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.TotalSubscriptions = temp.TotalSubscriptions - s.SubscriptionsToday = temp.SubscriptionsToday - s.TotalRevenue = temp.TotalRevenue - s.RevenueToday = temp.RevenueToday - s.RevenueThisMonth = temp.RevenueThisMonth - s.RevenueThisYear = temp.RevenueThisYear - s.TotalCanceledSubscriptions = temp.TotalCanceledSubscriptions - s.TotalActiveSubscriptions = temp.TotalActiveSubscriptions - s.TotalPastDueSubscriptions = temp.TotalPastDueSubscriptions - s.TotalUnpaidSubscriptions = temp.TotalUnpaidSubscriptions - s.TotalDunningSubscriptions = temp.TotalDunningSubscriptions - return nil + temp := &struct { + TotalSubscriptions *int `json:"total_subscriptions,omitempty"` + SubscriptionsToday *int `json:"subscriptions_today,omitempty"` + TotalRevenue *string `json:"total_revenue,omitempty"` + RevenueToday *string `json:"revenue_today,omitempty"` + RevenueThisMonth *string `json:"revenue_this_month,omitempty"` + RevenueThisYear *string `json:"revenue_this_year,omitempty"` + TotalCanceledSubscriptions *int `json:"total_canceled_subscriptions,omitempty"` + TotalActiveSubscriptions *float64 `json:"total_active_subscriptions,omitempty"` + TotalPastDueSubscriptions *float64 `json:"total_past_due_subscriptions,omitempty"` + TotalUnpaidSubscriptions *float64 `json:"total_unpaid_subscriptions,omitempty"` + TotalDunningSubscriptions *float64 `json:"total_dunning_subscriptions,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.TotalSubscriptions = temp.TotalSubscriptions + s.SubscriptionsToday = temp.SubscriptionsToday + s.TotalRevenue = temp.TotalRevenue + s.RevenueToday = temp.RevenueToday + s.RevenueThisMonth = temp.RevenueThisMonth + s.RevenueThisYear = temp.RevenueThisYear + s.TotalCanceledSubscriptions = temp.TotalCanceledSubscriptions + s.TotalActiveSubscriptions = temp.TotalActiveSubscriptions + s.TotalPastDueSubscriptions = temp.TotalPastDueSubscriptions + s.TotalUnpaidSubscriptions = temp.TotalUnpaidSubscriptions + s.TotalDunningSubscriptions = temp.TotalDunningSubscriptions + return nil } diff --git a/models/site_summary.go b/models/site_summary.go index 0e8eaca1..2284f484 100644 --- a/models/site_summary.go +++ b/models/site_summary.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // SiteSummary represents a SiteSummary struct. type SiteSummary struct { - SellerName *string `json:"seller_name,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SiteId *int `json:"site_id,omitempty"` - SiteCurrency *string `json:"site_currency,omitempty"` - Stats *SiteStatistics `json:"stats,omitempty"` + SellerName *string `json:"seller_name,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SiteId *int `json:"site_id,omitempty"` + SiteCurrency *string `json:"site_currency,omitempty"` + Stats *SiteStatistics `json:"stats,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SiteSummary. +// MarshalJSON implements the json.Marshaler interface for SiteSummary. // It customizes the JSON marshaling process for SiteSummary objects. func (s *SiteSummary) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SiteSummary object to a map representation for JSON marshaling. func (s *SiteSummary) toMap() map[string]any { - structMap := make(map[string]any) - if s.SellerName != nil { - structMap["seller_name"] = s.SellerName - } - if s.SiteName != nil { - structMap["site_name"] = s.SiteName - } - if s.SiteId != nil { - structMap["site_id"] = s.SiteId - } - if s.SiteCurrency != nil { - structMap["site_currency"] = s.SiteCurrency - } - if s.Stats != nil { - structMap["stats"] = s.Stats - } - return structMap + structMap := make(map[string]any) + if s.SellerName != nil { + structMap["seller_name"] = s.SellerName + } + if s.SiteName != nil { + structMap["site_name"] = s.SiteName + } + if s.SiteId != nil { + structMap["site_id"] = s.SiteId + } + if s.SiteCurrency != nil { + structMap["site_currency"] = s.SiteCurrency + } + if s.Stats != nil { + structMap["stats"] = s.Stats.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SiteSummary. +// UnmarshalJSON implements the json.Unmarshaler interface for SiteSummary. // It customizes the JSON unmarshaling process for SiteSummary objects. func (s *SiteSummary) UnmarshalJSON(input []byte) error { - temp := &struct { - SellerName *string `json:"seller_name,omitempty"` - SiteName *string `json:"site_name,omitempty"` - SiteId *int `json:"site_id,omitempty"` - SiteCurrency *string `json:"site_currency,omitempty"` - Stats *SiteStatistics `json:"stats,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SellerName = temp.SellerName - s.SiteName = temp.SiteName - s.SiteId = temp.SiteId - s.SiteCurrency = temp.SiteCurrency - s.Stats = temp.Stats - return nil + temp := &struct { + SellerName *string `json:"seller_name,omitempty"` + SiteName *string `json:"site_name,omitempty"` + SiteId *int `json:"site_id,omitempty"` + SiteCurrency *string `json:"site_currency,omitempty"` + Stats *SiteStatistics `json:"stats,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SellerName = temp.SellerName + s.SiteName = temp.SiteName + s.SiteId = temp.SiteId + s.SiteCurrency = temp.SiteCurrency + s.Stats = temp.Stats + return nil } diff --git a/models/subscription.go b/models/subscription.go index 9fcce409..05a7ff1d 100644 --- a/models/subscription.go +++ b/models/subscription.go @@ -1,615 +1,615 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // Subscription represents a Subscription struct. type Subscription struct { - // The subscription unique id within Chargify. - Id *int `json:"id,omitempty"` - // 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. - // See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. - State *SubscriptionState `json:"state,omitempty"` - // Gives the current outstanding subscription balance in the number of cents. - BalanceInCents *int64 `json:"balance_in_cents,omitempty"` - // Gives the total revenue from the subscription in the number of cents. - TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` - // (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. - ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` - // The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. - ProductVersionNumber *int `json:"product_version_number,omitempty"` - // Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) - CurrentPeriodEndsAt *time.Time `json:"current_period_ends_at,omitempty"` - // 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) - NextAssessmentAt *time.Time `json:"next_assessment_at,omitempty"` - // Timestamp for when the trial period (if any) began - TrialStartedAt Optional[time.Time] `json:"trial_started_at"` - // Timestamp for when the trial period (if any) ended - TrialEndedAt Optional[time.Time] `json:"trial_ended_at"` - // Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) - ActivatedAt *time.Time `json:"activated_at,omitempty"` - // Timestamp giving the expiration date of this subscription (if any) - ExpiresAt Optional[time.Time] `json:"expires_at"` - // The creation date for this subscription - CreatedAt *time.Time `json:"created_at,omitempty"` - // The date of last update for this subscription - UpdatedAt *time.Time `json:"updated_at,omitempty"` - // Seller-provided reason for, or note about, the cancellation. - CancellationMessage Optional[string] `json:"cancellation_message"` - // The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. - CancellationMethod Optional[CancellationMethod] `json:"cancellation_method"` - // Whether or not the subscription will (or has) canceled at the end of the period. - CancelAtEndOfPeriod Optional[bool] `json:"cancel_at_end_of_period"` - // The timestamp of the most recent cancellation - CanceledAt Optional[time.Time] `json:"canceled_at"` - // Timestamp relating to the start of the current (recurring) period - CurrentPeriodStartedAt *time.Time `json:"current_period_started_at,omitempty"` - // 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) - PreviousState *SubscriptionState `json:"previous_state,omitempty"` - // The ID of the transaction that generated the revenue - SignupPaymentId *int `json:"signup_payment_id,omitempty"` - // The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) - SignupRevenue *string `json:"signup_revenue,omitempty"` - // Timestamp for when the subscription is currently set to cancel. - DelayedCancelAt Optional[time.Time] `json:"delayed_cancel_at"` - // (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. - CouponCode Optional[string] `json:"coupon_code"` // Deprecated - // The day of the month that the subscription will charge according to calendar billing rules, if used. - SnapDay Optional[string] `json:"snap_day"` - // 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`. - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - Customer *Customer `json:"customer,omitempty"` - Product *Product `json:"product,omitempty"` - CreditCard *CreditCardPaymentProfile `json:"credit_card,omitempty"` - Group Optional[NestedSubscriptionGroup] `json:"group"` - BankAccount *BankAccountPaymentProfile `json:"bank_account,omitempty"` - // The payment profile type for the active profile on file. - PaymentType Optional[string] `json:"payment_type"` - // The subscription's unique code that can be given to referrals. - ReferralCode Optional[string] `json:"referral_code"` - // If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal. - NextProductId Optional[int] `json:"next_product_id"` - // If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. - NextProductHandle Optional[string] `json:"next_product_handle"` - // (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. - CouponUseCount Optional[int] `json:"coupon_use_count"` // Deprecated - // (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. - CouponUsesAllowed Optional[int] `json:"coupon_uses_allowed"` // Deprecated - // If the subscription is canceled, this is their churn code. - ReasonCode Optional[string] `json:"reason_code"` - // The date the subscription is scheduled to automatically resume from the on_hold state. - AutomaticallyResumeAt Optional[time.Time] `json:"automatically_resume_at"` - // An array for all the coupons attached to the subscription. - CouponCodes []string `json:"coupon_codes,omitempty"` - // The ID of the offer associated with the subscription. - OfferId Optional[int] `json:"offer_id"` - // On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled. - PayerId Optional[int] `json:"payer_id"` - // The balance in cents plus the estimated renewal amount in cents. - CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` - // The product price point currently subscribed to. - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // 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. - ProductPricePointType *PricePointType `json:"product_price_point_type,omitempty"` - // 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. - NextProductPricePointId Optional[int] `json:"next_product_price_point_id"` - // On Relationship Invoicing, the number of days before a renewal invoice is due. - NetTerms Optional[int] `json:"net_terms"` - // 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. - StoredCredentialTransactionId Optional[int] `json:"stored_credential_transaction_id"` - // The reference value (provided by your app) for the subscription itelf. - Reference Optional[string] `json:"reference"` - // The timestamp of the most recent on hold action. - OnHoldAt Optional[time.Time] `json:"on_hold_at"` - // Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled - PrepaidDunning *bool `json:"prepaid_dunning,omitempty"` - // 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. - Coupons []SubscriptionIncludedCoupon `json:"coupons,omitempty"` - // 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. - DunningCommunicationDelayEnabled *bool `json:"dunning_communication_delay_enabled,omitempty"` - // Time zone for the Dunning Communication Delay feature. - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` - ReceivesInvoiceEmails Optional[bool] `json:"receives_invoice_emails"` - Locale Optional[string] `json:"locale"` - Currency *string `json:"currency,omitempty"` - ScheduledCancellationAt Optional[time.Time] `json:"scheduled_cancellation_at"` - CreditBalanceInCents *int64 `json:"credit_balance_in_cents,omitempty"` - PrepaymentBalanceInCents *int64 `json:"prepayment_balance_in_cents,omitempty"` - PrepaidConfiguration *PrepaidConfiguration `json:"prepaid_configuration,omitempty"` - // Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. - SelfServicePageToken *string `json:"self_service_page_token,omitempty"` + // The subscription unique id within Chargify. + Id *int `json:"id,omitempty"` + // 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. + // See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. + State *SubscriptionState `json:"state,omitempty"` + // Gives the current outstanding subscription balance in the number of cents. + BalanceInCents *int64 `json:"balance_in_cents,omitempty"` + // Gives the total revenue from the subscription in the number of cents. + TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` + // (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. + ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` + // The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. + ProductVersionNumber *int `json:"product_version_number,omitempty"` + // Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) + CurrentPeriodEndsAt *time.Time `json:"current_period_ends_at,omitempty"` + // 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) + NextAssessmentAt *time.Time `json:"next_assessment_at,omitempty"` + // Timestamp for when the trial period (if any) began + TrialStartedAt Optional[time.Time] `json:"trial_started_at"` + // Timestamp for when the trial period (if any) ended + TrialEndedAt Optional[time.Time] `json:"trial_ended_at"` + // Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) + ActivatedAt *time.Time `json:"activated_at,omitempty"` + // Timestamp giving the expiration date of this subscription (if any) + ExpiresAt Optional[time.Time] `json:"expires_at"` + // The creation date for this subscription + CreatedAt *time.Time `json:"created_at,omitempty"` + // The date of last update for this subscription + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // Seller-provided reason for, or note about, the cancellation. + CancellationMessage Optional[string] `json:"cancellation_message"` + // The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled. + CancellationMethod Optional[CancellationMethod] `json:"cancellation_method"` + // Whether or not the subscription will (or has) canceled at the end of the period. + CancelAtEndOfPeriod Optional[bool] `json:"cancel_at_end_of_period"` + // The timestamp of the most recent cancellation + CanceledAt Optional[time.Time] `json:"canceled_at"` + // Timestamp relating to the start of the current (recurring) period + CurrentPeriodStartedAt *time.Time `json:"current_period_started_at,omitempty"` + // 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) + PreviousState *SubscriptionState `json:"previous_state,omitempty"` + // The ID of the transaction that generated the revenue + SignupPaymentId *int `json:"signup_payment_id,omitempty"` + // The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) + SignupRevenue *string `json:"signup_revenue,omitempty"` + // Timestamp for when the subscription is currently set to cancel. + DelayedCancelAt Optional[time.Time] `json:"delayed_cancel_at"` + // (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. + CouponCode Optional[string] `json:"coupon_code"` // Deprecated + // The day of the month that the subscription will charge according to calendar billing rules, if used. + SnapDay Optional[string] `json:"snap_day"` + // 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`. + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + Customer *Customer `json:"customer,omitempty"` + Product *Product `json:"product,omitempty"` + CreditCard *CreditCardPaymentProfile `json:"credit_card,omitempty"` + Group Optional[NestedSubscriptionGroup] `json:"group"` + BankAccount *BankAccountPaymentProfile `json:"bank_account,omitempty"` + // The payment profile type for the active profile on file. + PaymentType Optional[string] `json:"payment_type"` + // The subscription's unique code that can be given to referrals. + ReferralCode Optional[string] `json:"referral_code"` + // If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal. + NextProductId Optional[int] `json:"next_product_id"` + // If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. + NextProductHandle Optional[string] `json:"next_product_handle"` + // (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. + CouponUseCount Optional[int] `json:"coupon_use_count"` // Deprecated + // (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. + CouponUsesAllowed Optional[int] `json:"coupon_uses_allowed"` // Deprecated + // If the subscription is canceled, this is their churn code. + ReasonCode Optional[string] `json:"reason_code"` + // The date the subscription is scheduled to automatically resume from the on_hold state. + AutomaticallyResumeAt Optional[time.Time] `json:"automatically_resume_at"` + // An array for all the coupons attached to the subscription. + CouponCodes []string `json:"coupon_codes,omitempty"` + // The ID of the offer associated with the subscription. + OfferId Optional[int] `json:"offer_id"` + // On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled. + PayerId Optional[int] `json:"payer_id"` + // The balance in cents plus the estimated renewal amount in cents. + CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` + // The product price point currently subscribed to. + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // 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. + ProductPricePointType *PricePointType `json:"product_price_point_type,omitempty"` + // 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. + NextProductPricePointId Optional[int] `json:"next_product_price_point_id"` + // On Relationship Invoicing, the number of days before a renewal invoice is due. + NetTerms Optional[int] `json:"net_terms"` + // 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. + StoredCredentialTransactionId Optional[int] `json:"stored_credential_transaction_id"` + // The reference value (provided by your app) for the subscription itelf. + Reference Optional[string] `json:"reference"` + // The timestamp of the most recent on hold action. + OnHoldAt Optional[time.Time] `json:"on_hold_at"` + // Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled + PrepaidDunning *bool `json:"prepaid_dunning,omitempty"` + // 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. + Coupons []SubscriptionIncludedCoupon `json:"coupons,omitempty"` + // 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. + DunningCommunicationDelayEnabled *bool `json:"dunning_communication_delay_enabled,omitempty"` + // Time zone for the Dunning Communication Delay feature. + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + ReceivesInvoiceEmails Optional[bool] `json:"receives_invoice_emails"` + Locale Optional[string] `json:"locale"` + Currency *string `json:"currency,omitempty"` + ScheduledCancellationAt Optional[time.Time] `json:"scheduled_cancellation_at"` + CreditBalanceInCents *int64 `json:"credit_balance_in_cents,omitempty"` + PrepaymentBalanceInCents *int64 `json:"prepayment_balance_in_cents,omitempty"` + PrepaidConfiguration *PrepaidConfiguration `json:"prepaid_configuration,omitempty"` + // Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. + SelfServicePageToken *string `json:"self_service_page_token,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Subscription. +// MarshalJSON implements the json.Marshaler interface for Subscription. // It customizes the JSON marshaling process for Subscription objects. func (s *Subscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the Subscription object to a map representation for JSON marshaling. func (s *Subscription) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.State != nil { - structMap["state"] = s.State - } - if s.BalanceInCents != nil { - structMap["balance_in_cents"] = s.BalanceInCents - } - if s.TotalRevenueInCents != nil { - structMap["total_revenue_in_cents"] = s.TotalRevenueInCents - } - if s.ProductPriceInCents != nil { - structMap["product_price_in_cents"] = s.ProductPriceInCents - } - if s.ProductVersionNumber != nil { - structMap["product_version_number"] = s.ProductVersionNumber - } - if s.CurrentPeriodEndsAt != nil { - structMap["current_period_ends_at"] = s.CurrentPeriodEndsAt.Format(time.RFC3339) - } - if s.NextAssessmentAt != nil { - structMap["next_assessment_at"] = s.NextAssessmentAt.Format(time.RFC3339) - } - if s.TrialStartedAt.IsValueSet() { - var TrialStartedAtVal *string = nil - if s.TrialStartedAt.Value() != nil { - val := s.TrialStartedAt.Value().Format(time.RFC3339) - TrialStartedAtVal = &val - } - structMap["trial_started_at"] = TrialStartedAtVal - } - if s.TrialEndedAt.IsValueSet() { - var TrialEndedAtVal *string = nil - if s.TrialEndedAt.Value() != nil { - val := s.TrialEndedAt.Value().Format(time.RFC3339) - TrialEndedAtVal = &val - } - structMap["trial_ended_at"] = TrialEndedAtVal - } - if s.ActivatedAt != nil { - structMap["activated_at"] = s.ActivatedAt.Format(time.RFC3339) - } - if s.ExpiresAt.IsValueSet() { - var ExpiresAtVal *string = nil - if s.ExpiresAt.Value() != nil { - val := s.ExpiresAt.Value().Format(time.RFC3339) - ExpiresAtVal = &val - } - structMap["expires_at"] = ExpiresAtVal - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt.Format(time.RFC3339) - } - if s.UpdatedAt != nil { - structMap["updated_at"] = s.UpdatedAt.Format(time.RFC3339) - } - if s.CancellationMessage.IsValueSet() { - structMap["cancellation_message"] = s.CancellationMessage.Value() - } - if s.CancellationMethod.IsValueSet() { - structMap["cancellation_method"] = s.CancellationMethod.Value() - } - if s.CancelAtEndOfPeriod.IsValueSet() { - structMap["cancel_at_end_of_period"] = s.CancelAtEndOfPeriod.Value() - } - if s.CanceledAt.IsValueSet() { - var CanceledAtVal *string = nil - if s.CanceledAt.Value() != nil { - val := s.CanceledAt.Value().Format(time.RFC3339) - CanceledAtVal = &val - } - structMap["canceled_at"] = CanceledAtVal - } - if s.CurrentPeriodStartedAt != nil { - structMap["current_period_started_at"] = s.CurrentPeriodStartedAt.Format(time.RFC3339) - } - if s.PreviousState != nil { - structMap["previous_state"] = s.PreviousState - } - if s.SignupPaymentId != nil { - structMap["signup_payment_id"] = s.SignupPaymentId - } - if s.SignupRevenue != nil { - structMap["signup_revenue"] = s.SignupRevenue - } - if s.DelayedCancelAt.IsValueSet() { - var DelayedCancelAtVal *string = nil - if s.DelayedCancelAt.Value() != nil { - val := s.DelayedCancelAt.Value().Format(time.RFC3339) - DelayedCancelAtVal = &val - } - structMap["delayed_cancel_at"] = DelayedCancelAtVal - } - if s.CouponCode.IsValueSet() { - structMap["coupon_code"] = s.CouponCode.Value() - } - if s.SnapDay.IsValueSet() { - structMap["snap_day"] = s.SnapDay.Value() - } - if s.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = s.PaymentCollectionMethod - } - if s.Customer != nil { - structMap["customer"] = s.Customer - } - if s.Product != nil { - structMap["product"] = s.Product - } - if s.CreditCard != nil { - structMap["credit_card"] = s.CreditCard - } - if s.Group.IsValueSet() { - structMap["group"] = s.Group.Value() - } - if s.BankAccount != nil { - structMap["bank_account"] = s.BankAccount - } - if s.PaymentType.IsValueSet() { - structMap["payment_type"] = s.PaymentType.Value() - } - if s.ReferralCode.IsValueSet() { - structMap["referral_code"] = s.ReferralCode.Value() - } - if s.NextProductId.IsValueSet() { - structMap["next_product_id"] = s.NextProductId.Value() - } - if s.NextProductHandle.IsValueSet() { - structMap["next_product_handle"] = s.NextProductHandle.Value() - } - if s.CouponUseCount.IsValueSet() { - structMap["coupon_use_count"] = s.CouponUseCount.Value() - } - if s.CouponUsesAllowed.IsValueSet() { - structMap["coupon_uses_allowed"] = s.CouponUsesAllowed.Value() - } - if s.ReasonCode.IsValueSet() { - structMap["reason_code"] = s.ReasonCode.Value() - } - if s.AutomaticallyResumeAt.IsValueSet() { - var AutomaticallyResumeAtVal *string = nil - if s.AutomaticallyResumeAt.Value() != nil { - val := s.AutomaticallyResumeAt.Value().Format(time.RFC3339) - AutomaticallyResumeAtVal = &val - } - structMap["automatically_resume_at"] = AutomaticallyResumeAtVal - } - if s.CouponCodes != nil { - structMap["coupon_codes"] = s.CouponCodes - } - if s.OfferId.IsValueSet() { - structMap["offer_id"] = s.OfferId.Value() - } - if s.PayerId.IsValueSet() { - structMap["payer_id"] = s.PayerId.Value() - } - if s.CurrentBillingAmountInCents != nil { - structMap["current_billing_amount_in_cents"] = s.CurrentBillingAmountInCents - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.ProductPricePointType != nil { - structMap["product_price_point_type"] = s.ProductPricePointType - } - if s.NextProductPricePointId.IsValueSet() { - structMap["next_product_price_point_id"] = s.NextProductPricePointId.Value() - } - if s.NetTerms.IsValueSet() { - structMap["net_terms"] = s.NetTerms.Value() - } - if s.StoredCredentialTransactionId.IsValueSet() { - structMap["stored_credential_transaction_id"] = s.StoredCredentialTransactionId.Value() - } - if s.Reference.IsValueSet() { - structMap["reference"] = s.Reference.Value() - } - if s.OnHoldAt.IsValueSet() { - var OnHoldAtVal *string = nil - if s.OnHoldAt.Value() != nil { - val := s.OnHoldAt.Value().Format(time.RFC3339) - OnHoldAtVal = &val - } - structMap["on_hold_at"] = OnHoldAtVal - } - if s.PrepaidDunning != nil { - structMap["prepaid_dunning"] = s.PrepaidDunning - } - if s.Coupons != nil { - structMap["coupons"] = s.Coupons - } - if s.DunningCommunicationDelayEnabled != nil { - structMap["dunning_communication_delay_enabled"] = s.DunningCommunicationDelayEnabled - } - if s.DunningCommunicationDelayTimeZone.IsValueSet() { - structMap["dunning_communication_delay_time_zone"] = s.DunningCommunicationDelayTimeZone.Value() - } - if s.ReceivesInvoiceEmails.IsValueSet() { - structMap["receives_invoice_emails"] = s.ReceivesInvoiceEmails.Value() - } - if s.Locale.IsValueSet() { - structMap["locale"] = s.Locale.Value() - } - if s.Currency != nil { - structMap["currency"] = s.Currency - } - if s.ScheduledCancellationAt.IsValueSet() { - var ScheduledCancellationAtVal *string = nil - if s.ScheduledCancellationAt.Value() != nil { - val := s.ScheduledCancellationAt.Value().Format(time.RFC3339) - ScheduledCancellationAtVal = &val - } - structMap["scheduled_cancellation_at"] = ScheduledCancellationAtVal - } - if s.CreditBalanceInCents != nil { - structMap["credit_balance_in_cents"] = s.CreditBalanceInCents - } - if s.PrepaymentBalanceInCents != nil { - structMap["prepayment_balance_in_cents"] = s.PrepaymentBalanceInCents - } - if s.PrepaidConfiguration != nil { - structMap["prepaid_configuration"] = s.PrepaidConfiguration - } - if s.SelfServicePageToken != nil { - structMap["self_service_page_token"] = s.SelfServicePageToken - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.State != nil { + structMap["state"] = s.State + } + if s.BalanceInCents != nil { + structMap["balance_in_cents"] = s.BalanceInCents + } + if s.TotalRevenueInCents != nil { + structMap["total_revenue_in_cents"] = s.TotalRevenueInCents + } + if s.ProductPriceInCents != nil { + structMap["product_price_in_cents"] = s.ProductPriceInCents + } + if s.ProductVersionNumber != nil { + structMap["product_version_number"] = s.ProductVersionNumber + } + if s.CurrentPeriodEndsAt != nil { + structMap["current_period_ends_at"] = s.CurrentPeriodEndsAt.Format(time.RFC3339) + } + if s.NextAssessmentAt != nil { + structMap["next_assessment_at"] = s.NextAssessmentAt.Format(time.RFC3339) + } + if s.TrialStartedAt.IsValueSet() { + var TrialStartedAtVal *string = nil + if s.TrialStartedAt.Value() != nil { + val := s.TrialStartedAt.Value().Format(time.RFC3339) + TrialStartedAtVal = &val + } + structMap["trial_started_at"] = TrialStartedAtVal + } + if s.TrialEndedAt.IsValueSet() { + var TrialEndedAtVal *string = nil + if s.TrialEndedAt.Value() != nil { + val := s.TrialEndedAt.Value().Format(time.RFC3339) + TrialEndedAtVal = &val + } + structMap["trial_ended_at"] = TrialEndedAtVal + } + if s.ActivatedAt != nil { + structMap["activated_at"] = s.ActivatedAt.Format(time.RFC3339) + } + if s.ExpiresAt.IsValueSet() { + var ExpiresAtVal *string = nil + if s.ExpiresAt.Value() != nil { + val := s.ExpiresAt.Value().Format(time.RFC3339) + ExpiresAtVal = &val + } + structMap["expires_at"] = ExpiresAtVal + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt.Format(time.RFC3339) + } + if s.UpdatedAt != nil { + structMap["updated_at"] = s.UpdatedAt.Format(time.RFC3339) + } + if s.CancellationMessage.IsValueSet() { + structMap["cancellation_message"] = s.CancellationMessage.Value() + } + if s.CancellationMethod.IsValueSet() { + structMap["cancellation_method"] = s.CancellationMethod.Value() + } + if s.CancelAtEndOfPeriod.IsValueSet() { + structMap["cancel_at_end_of_period"] = s.CancelAtEndOfPeriod.Value() + } + if s.CanceledAt.IsValueSet() { + var CanceledAtVal *string = nil + if s.CanceledAt.Value() != nil { + val := s.CanceledAt.Value().Format(time.RFC3339) + CanceledAtVal = &val + } + structMap["canceled_at"] = CanceledAtVal + } + if s.CurrentPeriodStartedAt != nil { + structMap["current_period_started_at"] = s.CurrentPeriodStartedAt.Format(time.RFC3339) + } + if s.PreviousState != nil { + structMap["previous_state"] = s.PreviousState + } + if s.SignupPaymentId != nil { + structMap["signup_payment_id"] = s.SignupPaymentId + } + if s.SignupRevenue != nil { + structMap["signup_revenue"] = s.SignupRevenue + } + if s.DelayedCancelAt.IsValueSet() { + var DelayedCancelAtVal *string = nil + if s.DelayedCancelAt.Value() != nil { + val := s.DelayedCancelAt.Value().Format(time.RFC3339) + DelayedCancelAtVal = &val + } + structMap["delayed_cancel_at"] = DelayedCancelAtVal + } + if s.CouponCode.IsValueSet() { + structMap["coupon_code"] = s.CouponCode.Value() + } + if s.SnapDay.IsValueSet() { + structMap["snap_day"] = s.SnapDay.Value() + } + if s.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = s.PaymentCollectionMethod + } + if s.Customer != nil { + structMap["customer"] = s.Customer.toMap() + } + if s.Product != nil { + structMap["product"] = s.Product.toMap() + } + if s.CreditCard != nil { + structMap["credit_card"] = s.CreditCard.toMap() + } + if s.Group.IsValueSet() { + structMap["group"] = s.Group.Value() + } + if s.BankAccount != nil { + structMap["bank_account"] = s.BankAccount.toMap() + } + if s.PaymentType.IsValueSet() { + structMap["payment_type"] = s.PaymentType.Value() + } + if s.ReferralCode.IsValueSet() { + structMap["referral_code"] = s.ReferralCode.Value() + } + if s.NextProductId.IsValueSet() { + structMap["next_product_id"] = s.NextProductId.Value() + } + if s.NextProductHandle.IsValueSet() { + structMap["next_product_handle"] = s.NextProductHandle.Value() + } + if s.CouponUseCount.IsValueSet() { + structMap["coupon_use_count"] = s.CouponUseCount.Value() + } + if s.CouponUsesAllowed.IsValueSet() { + structMap["coupon_uses_allowed"] = s.CouponUsesAllowed.Value() + } + if s.ReasonCode.IsValueSet() { + structMap["reason_code"] = s.ReasonCode.Value() + } + if s.AutomaticallyResumeAt.IsValueSet() { + var AutomaticallyResumeAtVal *string = nil + if s.AutomaticallyResumeAt.Value() != nil { + val := s.AutomaticallyResumeAt.Value().Format(time.RFC3339) + AutomaticallyResumeAtVal = &val + } + structMap["automatically_resume_at"] = AutomaticallyResumeAtVal + } + if s.CouponCodes != nil { + structMap["coupon_codes"] = s.CouponCodes + } + if s.OfferId.IsValueSet() { + structMap["offer_id"] = s.OfferId.Value() + } + if s.PayerId.IsValueSet() { + structMap["payer_id"] = s.PayerId.Value() + } + if s.CurrentBillingAmountInCents != nil { + structMap["current_billing_amount_in_cents"] = s.CurrentBillingAmountInCents + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.ProductPricePointType != nil { + structMap["product_price_point_type"] = s.ProductPricePointType + } + if s.NextProductPricePointId.IsValueSet() { + structMap["next_product_price_point_id"] = s.NextProductPricePointId.Value() + } + if s.NetTerms.IsValueSet() { + structMap["net_terms"] = s.NetTerms.Value() + } + if s.StoredCredentialTransactionId.IsValueSet() { + structMap["stored_credential_transaction_id"] = s.StoredCredentialTransactionId.Value() + } + if s.Reference.IsValueSet() { + structMap["reference"] = s.Reference.Value() + } + if s.OnHoldAt.IsValueSet() { + var OnHoldAtVal *string = nil + if s.OnHoldAt.Value() != nil { + val := s.OnHoldAt.Value().Format(time.RFC3339) + OnHoldAtVal = &val + } + structMap["on_hold_at"] = OnHoldAtVal + } + if s.PrepaidDunning != nil { + structMap["prepaid_dunning"] = s.PrepaidDunning + } + if s.Coupons != nil { + structMap["coupons"] = s.Coupons + } + if s.DunningCommunicationDelayEnabled != nil { + structMap["dunning_communication_delay_enabled"] = s.DunningCommunicationDelayEnabled + } + if s.DunningCommunicationDelayTimeZone.IsValueSet() { + structMap["dunning_communication_delay_time_zone"] = s.DunningCommunicationDelayTimeZone.Value() + } + if s.ReceivesInvoiceEmails.IsValueSet() { + structMap["receives_invoice_emails"] = s.ReceivesInvoiceEmails.Value() + } + if s.Locale.IsValueSet() { + structMap["locale"] = s.Locale.Value() + } + if s.Currency != nil { + structMap["currency"] = s.Currency + } + if s.ScheduledCancellationAt.IsValueSet() { + var ScheduledCancellationAtVal *string = nil + if s.ScheduledCancellationAt.Value() != nil { + val := s.ScheduledCancellationAt.Value().Format(time.RFC3339) + ScheduledCancellationAtVal = &val + } + structMap["scheduled_cancellation_at"] = ScheduledCancellationAtVal + } + if s.CreditBalanceInCents != nil { + structMap["credit_balance_in_cents"] = s.CreditBalanceInCents + } + if s.PrepaymentBalanceInCents != nil { + structMap["prepayment_balance_in_cents"] = s.PrepaymentBalanceInCents + } + if s.PrepaidConfiguration != nil { + structMap["prepaid_configuration"] = s.PrepaidConfiguration.toMap() + } + if s.SelfServicePageToken != nil { + structMap["self_service_page_token"] = s.SelfServicePageToken + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Subscription. +// UnmarshalJSON implements the json.Unmarshaler interface for Subscription. // It customizes the JSON unmarshaling process for Subscription objects. func (s *Subscription) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - State *SubscriptionState `json:"state,omitempty"` - BalanceInCents *int64 `json:"balance_in_cents,omitempty"` - TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` - ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` - ProductVersionNumber *int `json:"product_version_number,omitempty"` - CurrentPeriodEndsAt *string `json:"current_period_ends_at,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - TrialStartedAt Optional[string] `json:"trial_started_at"` - TrialEndedAt Optional[string] `json:"trial_ended_at"` - ActivatedAt *string `json:"activated_at,omitempty"` - ExpiresAt Optional[string] `json:"expires_at"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - CancellationMessage Optional[string] `json:"cancellation_message"` - CancellationMethod Optional[CancellationMethod] `json:"cancellation_method"` - CancelAtEndOfPeriod Optional[bool] `json:"cancel_at_end_of_period"` - CanceledAt Optional[string] `json:"canceled_at"` - CurrentPeriodStartedAt *string `json:"current_period_started_at,omitempty"` - PreviousState *SubscriptionState `json:"previous_state,omitempty"` - SignupPaymentId *int `json:"signup_payment_id,omitempty"` - SignupRevenue *string `json:"signup_revenue,omitempty"` - DelayedCancelAt Optional[string] `json:"delayed_cancel_at"` - CouponCode Optional[string] `json:"coupon_code"` - SnapDay Optional[string] `json:"snap_day"` - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - Customer *Customer `json:"customer,omitempty"` - Product *Product `json:"product,omitempty"` - CreditCard *CreditCardPaymentProfile `json:"credit_card,omitempty"` - Group Optional[NestedSubscriptionGroup] `json:"group"` - BankAccount *BankAccountPaymentProfile `json:"bank_account,omitempty"` - PaymentType Optional[string] `json:"payment_type"` - ReferralCode Optional[string] `json:"referral_code"` - NextProductId Optional[int] `json:"next_product_id"` - NextProductHandle Optional[string] `json:"next_product_handle"` - CouponUseCount Optional[int] `json:"coupon_use_count"` - CouponUsesAllowed Optional[int] `json:"coupon_uses_allowed"` - ReasonCode Optional[string] `json:"reason_code"` - AutomaticallyResumeAt Optional[string] `json:"automatically_resume_at"` - CouponCodes []string `json:"coupon_codes,omitempty"` - OfferId Optional[int] `json:"offer_id"` - PayerId Optional[int] `json:"payer_id"` - CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointType *PricePointType `json:"product_price_point_type,omitempty"` - NextProductPricePointId Optional[int] `json:"next_product_price_point_id"` - NetTerms Optional[int] `json:"net_terms"` - StoredCredentialTransactionId Optional[int] `json:"stored_credential_transaction_id"` - Reference Optional[string] `json:"reference"` - OnHoldAt Optional[string] `json:"on_hold_at"` - PrepaidDunning *bool `json:"prepaid_dunning,omitempty"` - Coupons []SubscriptionIncludedCoupon `json:"coupons,omitempty"` - DunningCommunicationDelayEnabled *bool `json:"dunning_communication_delay_enabled,omitempty"` - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` - ReceivesInvoiceEmails Optional[bool] `json:"receives_invoice_emails"` - Locale Optional[string] `json:"locale"` - Currency *string `json:"currency,omitempty"` - ScheduledCancellationAt Optional[string] `json:"scheduled_cancellation_at"` - CreditBalanceInCents *int64 `json:"credit_balance_in_cents,omitempty"` - PrepaymentBalanceInCents *int64 `json:"prepayment_balance_in_cents,omitempty"` - PrepaidConfiguration *PrepaidConfiguration `json:"prepaid_configuration,omitempty"` - SelfServicePageToken *string `json:"self_service_page_token,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.State = temp.State - s.BalanceInCents = temp.BalanceInCents - s.TotalRevenueInCents = temp.TotalRevenueInCents - s.ProductPriceInCents = temp.ProductPriceInCents - s.ProductVersionNumber = temp.ProductVersionNumber - if temp.CurrentPeriodEndsAt != nil { - CurrentPeriodEndsAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodEndsAt) - if err != nil { - log.Fatalf("Cannot Parse current_period_ends_at as % s format.", time.RFC3339) - } - s.CurrentPeriodEndsAt = &CurrentPeriodEndsAtVal - } - if temp.NextAssessmentAt != nil { - NextAssessmentAtVal, err := time.Parse(time.RFC3339, *temp.NextAssessmentAt) - if err != nil { - log.Fatalf("Cannot Parse next_assessment_at as % s format.", time.RFC3339) - } - s.NextAssessmentAt = &NextAssessmentAtVal - } - s.TrialStartedAt.ShouldSetValue(temp.TrialStartedAt.IsValueSet()) - if temp.TrialStartedAt.Value() != nil { - TrialStartedAtVal, err := time.Parse(time.RFC3339, (*temp.TrialStartedAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse trial_started_at as % s format.", time.RFC3339) - } - s.TrialStartedAt.SetValue(&TrialStartedAtVal) - } - s.TrialEndedAt.ShouldSetValue(temp.TrialEndedAt.IsValueSet()) - if temp.TrialEndedAt.Value() != nil { - TrialEndedAtVal, err := time.Parse(time.RFC3339, (*temp.TrialEndedAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse trial_ended_at as % s format.", time.RFC3339) - } - s.TrialEndedAt.SetValue(&TrialEndedAtVal) - } - if temp.ActivatedAt != nil { - ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) - if err != nil { - log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) - } - s.ActivatedAt = &ActivatedAtVal - } - s.ExpiresAt.ShouldSetValue(temp.ExpiresAt.IsValueSet()) - if temp.ExpiresAt.Value() != nil { - ExpiresAtVal, err := time.Parse(time.RFC3339, (*temp.ExpiresAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) - } - s.ExpiresAt.SetValue(&ExpiresAtVal) - } - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - s.CreatedAt = &CreatedAtVal - } - if temp.UpdatedAt != nil { - UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) - if err != nil { - log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) - } - s.UpdatedAt = &UpdatedAtVal - } - s.CancellationMessage = temp.CancellationMessage - s.CancellationMethod = temp.CancellationMethod - s.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod - s.CanceledAt.ShouldSetValue(temp.CanceledAt.IsValueSet()) - if temp.CanceledAt.Value() != nil { - CanceledAtVal, err := time.Parse(time.RFC3339, (*temp.CanceledAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse canceled_at as % s format.", time.RFC3339) - } - s.CanceledAt.SetValue(&CanceledAtVal) - } - if temp.CurrentPeriodStartedAt != nil { - CurrentPeriodStartedAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodStartedAt) - if err != nil { - log.Fatalf("Cannot Parse current_period_started_at as % s format.", time.RFC3339) - } - s.CurrentPeriodStartedAt = &CurrentPeriodStartedAtVal - } - s.PreviousState = temp.PreviousState - s.SignupPaymentId = temp.SignupPaymentId - s.SignupRevenue = temp.SignupRevenue - s.DelayedCancelAt.ShouldSetValue(temp.DelayedCancelAt.IsValueSet()) - if temp.DelayedCancelAt.Value() != nil { - DelayedCancelAtVal, err := time.Parse(time.RFC3339, (*temp.DelayedCancelAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse delayed_cancel_at as % s format.", time.RFC3339) - } - s.DelayedCancelAt.SetValue(&DelayedCancelAtVal) - } - s.CouponCode = temp.CouponCode - s.SnapDay = temp.SnapDay - s.PaymentCollectionMethod = temp.PaymentCollectionMethod - s.Customer = temp.Customer - s.Product = temp.Product - s.CreditCard = temp.CreditCard - s.Group = temp.Group - s.BankAccount = temp.BankAccount - s.PaymentType = temp.PaymentType - s.ReferralCode = temp.ReferralCode - s.NextProductId = temp.NextProductId - s.NextProductHandle = temp.NextProductHandle - s.CouponUseCount = temp.CouponUseCount - s.CouponUsesAllowed = temp.CouponUsesAllowed - s.ReasonCode = temp.ReasonCode - s.AutomaticallyResumeAt.ShouldSetValue(temp.AutomaticallyResumeAt.IsValueSet()) - if temp.AutomaticallyResumeAt.Value() != nil { - AutomaticallyResumeAtVal, err := time.Parse(time.RFC3339, (*temp.AutomaticallyResumeAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse automatically_resume_at as % s format.", time.RFC3339) - } - s.AutomaticallyResumeAt.SetValue(&AutomaticallyResumeAtVal) - } - s.CouponCodes = temp.CouponCodes - s.OfferId = temp.OfferId - s.PayerId = temp.PayerId - s.CurrentBillingAmountInCents = temp.CurrentBillingAmountInCents - s.ProductPricePointId = temp.ProductPricePointId - s.ProductPricePointType = temp.ProductPricePointType - s.NextProductPricePointId = temp.NextProductPricePointId - s.NetTerms = temp.NetTerms - s.StoredCredentialTransactionId = temp.StoredCredentialTransactionId - s.Reference = temp.Reference - s.OnHoldAt.ShouldSetValue(temp.OnHoldAt.IsValueSet()) - if temp.OnHoldAt.Value() != nil { - OnHoldAtVal, err := time.Parse(time.RFC3339, (*temp.OnHoldAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse on_hold_at as % s format.", time.RFC3339) - } - s.OnHoldAt.SetValue(&OnHoldAtVal) - } - s.PrepaidDunning = temp.PrepaidDunning - s.Coupons = temp.Coupons - s.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled - s.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone - s.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails - s.Locale = temp.Locale - s.Currency = temp.Currency - s.ScheduledCancellationAt.ShouldSetValue(temp.ScheduledCancellationAt.IsValueSet()) - if temp.ScheduledCancellationAt.Value() != nil { - ScheduledCancellationAtVal, err := time.Parse(time.RFC3339, (*temp.ScheduledCancellationAt.Value())) - if err != nil { - log.Fatalf("Cannot Parse scheduled_cancellation_at as % s format.", time.RFC3339) - } - s.ScheduledCancellationAt.SetValue(&ScheduledCancellationAtVal) - } - s.CreditBalanceInCents = temp.CreditBalanceInCents - s.PrepaymentBalanceInCents = temp.PrepaymentBalanceInCents - s.PrepaidConfiguration = temp.PrepaidConfiguration - s.SelfServicePageToken = temp.SelfServicePageToken - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + State *SubscriptionState `json:"state,omitempty"` + BalanceInCents *int64 `json:"balance_in_cents,omitempty"` + TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` + ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"` + ProductVersionNumber *int `json:"product_version_number,omitempty"` + CurrentPeriodEndsAt *string `json:"current_period_ends_at,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + TrialStartedAt Optional[string] `json:"trial_started_at"` + TrialEndedAt Optional[string] `json:"trial_ended_at"` + ActivatedAt *string `json:"activated_at,omitempty"` + ExpiresAt Optional[string] `json:"expires_at"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + CancellationMessage Optional[string] `json:"cancellation_message"` + CancellationMethod Optional[CancellationMethod] `json:"cancellation_method"` + CancelAtEndOfPeriod Optional[bool] `json:"cancel_at_end_of_period"` + CanceledAt Optional[string] `json:"canceled_at"` + CurrentPeriodStartedAt *string `json:"current_period_started_at,omitempty"` + PreviousState *SubscriptionState `json:"previous_state,omitempty"` + SignupPaymentId *int `json:"signup_payment_id,omitempty"` + SignupRevenue *string `json:"signup_revenue,omitempty"` + DelayedCancelAt Optional[string] `json:"delayed_cancel_at"` + CouponCode Optional[string] `json:"coupon_code"` + SnapDay Optional[string] `json:"snap_day"` + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + Customer *Customer `json:"customer,omitempty"` + Product *Product `json:"product,omitempty"` + CreditCard *CreditCardPaymentProfile `json:"credit_card,omitempty"` + Group Optional[NestedSubscriptionGroup] `json:"group"` + BankAccount *BankAccountPaymentProfile `json:"bank_account,omitempty"` + PaymentType Optional[string] `json:"payment_type"` + ReferralCode Optional[string] `json:"referral_code"` + NextProductId Optional[int] `json:"next_product_id"` + NextProductHandle Optional[string] `json:"next_product_handle"` + CouponUseCount Optional[int] `json:"coupon_use_count"` + CouponUsesAllowed Optional[int] `json:"coupon_uses_allowed"` + ReasonCode Optional[string] `json:"reason_code"` + AutomaticallyResumeAt Optional[string] `json:"automatically_resume_at"` + CouponCodes []string `json:"coupon_codes,omitempty"` + OfferId Optional[int] `json:"offer_id"` + PayerId Optional[int] `json:"payer_id"` + CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointType *PricePointType `json:"product_price_point_type,omitempty"` + NextProductPricePointId Optional[int] `json:"next_product_price_point_id"` + NetTerms Optional[int] `json:"net_terms"` + StoredCredentialTransactionId Optional[int] `json:"stored_credential_transaction_id"` + Reference Optional[string] `json:"reference"` + OnHoldAt Optional[string] `json:"on_hold_at"` + PrepaidDunning *bool `json:"prepaid_dunning,omitempty"` + Coupons []SubscriptionIncludedCoupon `json:"coupons,omitempty"` + DunningCommunicationDelayEnabled *bool `json:"dunning_communication_delay_enabled,omitempty"` + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + ReceivesInvoiceEmails Optional[bool] `json:"receives_invoice_emails"` + Locale Optional[string] `json:"locale"` + Currency *string `json:"currency,omitempty"` + ScheduledCancellationAt Optional[string] `json:"scheduled_cancellation_at"` + CreditBalanceInCents *int64 `json:"credit_balance_in_cents,omitempty"` + PrepaymentBalanceInCents *int64 `json:"prepayment_balance_in_cents,omitempty"` + PrepaidConfiguration *PrepaidConfiguration `json:"prepaid_configuration,omitempty"` + SelfServicePageToken *string `json:"self_service_page_token,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.State = temp.State + s.BalanceInCents = temp.BalanceInCents + s.TotalRevenueInCents = temp.TotalRevenueInCents + s.ProductPriceInCents = temp.ProductPriceInCents + s.ProductVersionNumber = temp.ProductVersionNumber + if temp.CurrentPeriodEndsAt != nil { + CurrentPeriodEndsAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodEndsAt) + if err != nil { + log.Fatalf("Cannot Parse current_period_ends_at as % s format.", time.RFC3339) + } + s.CurrentPeriodEndsAt = &CurrentPeriodEndsAtVal + } + if temp.NextAssessmentAt != nil { + NextAssessmentAtVal, err := time.Parse(time.RFC3339, *temp.NextAssessmentAt) + if err != nil { + log.Fatalf("Cannot Parse next_assessment_at as % s format.", time.RFC3339) + } + s.NextAssessmentAt = &NextAssessmentAtVal + } + s.TrialStartedAt.ShouldSetValue(temp.TrialStartedAt.IsValueSet()) + if temp.TrialStartedAt.Value() != nil { + TrialStartedAtVal, err := time.Parse(time.RFC3339, (*temp.TrialStartedAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse trial_started_at as % s format.", time.RFC3339) + } + s.TrialStartedAt.SetValue(&TrialStartedAtVal) + } + s.TrialEndedAt.ShouldSetValue(temp.TrialEndedAt.IsValueSet()) + if temp.TrialEndedAt.Value() != nil { + TrialEndedAtVal, err := time.Parse(time.RFC3339, (*temp.TrialEndedAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse trial_ended_at as % s format.", time.RFC3339) + } + s.TrialEndedAt.SetValue(&TrialEndedAtVal) + } + if temp.ActivatedAt != nil { + ActivatedAtVal, err := time.Parse(time.RFC3339, *temp.ActivatedAt) + if err != nil { + log.Fatalf("Cannot Parse activated_at as % s format.", time.RFC3339) + } + s.ActivatedAt = &ActivatedAtVal + } + s.ExpiresAt.ShouldSetValue(temp.ExpiresAt.IsValueSet()) + if temp.ExpiresAt.Value() != nil { + ExpiresAtVal, err := time.Parse(time.RFC3339, (*temp.ExpiresAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse expires_at as % s format.", time.RFC3339) + } + s.ExpiresAt.SetValue(&ExpiresAtVal) + } + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + s.CreatedAt = &CreatedAtVal + } + if temp.UpdatedAt != nil { + UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) + if err != nil { + log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) + } + s.UpdatedAt = &UpdatedAtVal + } + s.CancellationMessage = temp.CancellationMessage + s.CancellationMethod = temp.CancellationMethod + s.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod + s.CanceledAt.ShouldSetValue(temp.CanceledAt.IsValueSet()) + if temp.CanceledAt.Value() != nil { + CanceledAtVal, err := time.Parse(time.RFC3339, (*temp.CanceledAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse canceled_at as % s format.", time.RFC3339) + } + s.CanceledAt.SetValue(&CanceledAtVal) + } + if temp.CurrentPeriodStartedAt != nil { + CurrentPeriodStartedAtVal, err := time.Parse(time.RFC3339, *temp.CurrentPeriodStartedAt) + if err != nil { + log.Fatalf("Cannot Parse current_period_started_at as % s format.", time.RFC3339) + } + s.CurrentPeriodStartedAt = &CurrentPeriodStartedAtVal + } + s.PreviousState = temp.PreviousState + s.SignupPaymentId = temp.SignupPaymentId + s.SignupRevenue = temp.SignupRevenue + s.DelayedCancelAt.ShouldSetValue(temp.DelayedCancelAt.IsValueSet()) + if temp.DelayedCancelAt.Value() != nil { + DelayedCancelAtVal, err := time.Parse(time.RFC3339, (*temp.DelayedCancelAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse delayed_cancel_at as % s format.", time.RFC3339) + } + s.DelayedCancelAt.SetValue(&DelayedCancelAtVal) + } + s.CouponCode = temp.CouponCode + s.SnapDay = temp.SnapDay + s.PaymentCollectionMethod = temp.PaymentCollectionMethod + s.Customer = temp.Customer + s.Product = temp.Product + s.CreditCard = temp.CreditCard + s.Group = temp.Group + s.BankAccount = temp.BankAccount + s.PaymentType = temp.PaymentType + s.ReferralCode = temp.ReferralCode + s.NextProductId = temp.NextProductId + s.NextProductHandle = temp.NextProductHandle + s.CouponUseCount = temp.CouponUseCount + s.CouponUsesAllowed = temp.CouponUsesAllowed + s.ReasonCode = temp.ReasonCode + s.AutomaticallyResumeAt.ShouldSetValue(temp.AutomaticallyResumeAt.IsValueSet()) + if temp.AutomaticallyResumeAt.Value() != nil { + AutomaticallyResumeAtVal, err := time.Parse(time.RFC3339, (*temp.AutomaticallyResumeAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse automatically_resume_at as % s format.", time.RFC3339) + } + s.AutomaticallyResumeAt.SetValue(&AutomaticallyResumeAtVal) + } + s.CouponCodes = temp.CouponCodes + s.OfferId = temp.OfferId + s.PayerId = temp.PayerId + s.CurrentBillingAmountInCents = temp.CurrentBillingAmountInCents + s.ProductPricePointId = temp.ProductPricePointId + s.ProductPricePointType = temp.ProductPricePointType + s.NextProductPricePointId = temp.NextProductPricePointId + s.NetTerms = temp.NetTerms + s.StoredCredentialTransactionId = temp.StoredCredentialTransactionId + s.Reference = temp.Reference + s.OnHoldAt.ShouldSetValue(temp.OnHoldAt.IsValueSet()) + if temp.OnHoldAt.Value() != nil { + OnHoldAtVal, err := time.Parse(time.RFC3339, (*temp.OnHoldAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse on_hold_at as % s format.", time.RFC3339) + } + s.OnHoldAt.SetValue(&OnHoldAtVal) + } + s.PrepaidDunning = temp.PrepaidDunning + s.Coupons = temp.Coupons + s.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled + s.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone + s.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails + s.Locale = temp.Locale + s.Currency = temp.Currency + s.ScheduledCancellationAt.ShouldSetValue(temp.ScheduledCancellationAt.IsValueSet()) + if temp.ScheduledCancellationAt.Value() != nil { + ScheduledCancellationAtVal, err := time.Parse(time.RFC3339, (*temp.ScheduledCancellationAt.Value())) + if err != nil { + log.Fatalf("Cannot Parse scheduled_cancellation_at as % s format.", time.RFC3339) + } + s.ScheduledCancellationAt.SetValue(&ScheduledCancellationAtVal) + } + s.CreditBalanceInCents = temp.CreditBalanceInCents + s.PrepaymentBalanceInCents = temp.PrepaymentBalanceInCents + s.PrepaidConfiguration = temp.PrepaidConfiguration + s.SelfServicePageToken = temp.SelfServicePageToken + return nil } diff --git a/models/subscription_component.go b/models/subscription_component.go index b23b3cf5..cc8ba944 100644 --- a/models/subscription_component.go +++ b/models/subscription_component.go @@ -1,246 +1,246 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // SubscriptionComponent represents a SubscriptionComponent struct. type SubscriptionComponent struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // A handle for the component type - Kind *ComponentKind `json:"kind,omitempty"` - UnitName *string `json:"unit_name,omitempty"` - // (for on/off components) indicates if the component is enabled for the subscription - Enabled *bool `json:"enabled,omitempty"` - UnitBalance *int `json:"unit_balance,omitempty"` - Currency *string `json:"currency,omitempty"` - // For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off. - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - PricingScheme Optional[PricingScheme] `json:"pricing_scheme"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle Optional[string] `json:"component_handle"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Recurring *bool `json:"recurring,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - ArchivedAt Optional[string] `json:"archived_at"` - PricePointId Optional[int] `json:"price_point_id"` - PricePointHandle Optional[string] `json:"price_point_handle"` - PricePointType *interface{} `json:"price_point_type,omitempty"` - PricePointName Optional[string] `json:"price_point_name"` - ProductFamilyId *int `json:"product_family_id,omitempty"` - ProductFamilyHandle *string `json:"product_family_handle,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` - Description Optional[string] `json:"description"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - // An optional object, will be returned if provided `include=subscription` query param. - Subscription *SubscriptionComponentSubscription `json:"subscription,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // A handle for the component type + Kind *ComponentKind `json:"kind,omitempty"` + UnitName *string `json:"unit_name,omitempty"` + // (for on/off components) indicates if the component is enabled for the subscription + Enabled *bool `json:"enabled,omitempty"` + UnitBalance *int `json:"unit_balance,omitempty"` + Currency *string `json:"currency,omitempty"` + // For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off. + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + PricingScheme Optional[PricingScheme] `json:"pricing_scheme"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle Optional[string] `json:"component_handle"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Recurring *bool `json:"recurring,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + ArchivedAt Optional[string] `json:"archived_at"` + PricePointId Optional[int] `json:"price_point_id"` + PricePointHandle Optional[string] `json:"price_point_handle"` + PricePointType *interface{} `json:"price_point_type,omitempty"` + PricePointName Optional[string] `json:"price_point_name"` + ProductFamilyId *int `json:"product_family_id,omitempty"` + ProductFamilyHandle *string `json:"product_family_handle,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` + Description Optional[string] `json:"description"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + // An optional object, will be returned if provided `include=subscription` query param. + Subscription *SubscriptionComponentSubscription `json:"subscription,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionComponent. +// MarshalJSON implements the json.Marshaler interface for SubscriptionComponent. // It customizes the JSON marshaling process for SubscriptionComponent objects. func (s *SubscriptionComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionComponent object to a map representation for JSON marshaling. func (s *SubscriptionComponent) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.Name != nil { - structMap["name"] = s.Name - } - if s.Kind != nil { - structMap["kind"] = s.Kind - } - if s.UnitName != nil { - structMap["unit_name"] = s.UnitName - } - if s.Enabled != nil { - structMap["enabled"] = s.Enabled - } - if s.UnitBalance != nil { - structMap["unit_balance"] = s.UnitBalance - } - if s.Currency != nil { - structMap["currency"] = s.Currency - } - if s.AllocatedQuantity != nil { - structMap["allocated_quantity"] = s.AllocatedQuantity - } - if s.PricingScheme.IsValueSet() { - structMap["pricing_scheme"] = s.PricingScheme.Value() - } - if s.ComponentId != nil { - structMap["component_id"] = s.ComponentId - } - if s.ComponentHandle.IsValueSet() { - structMap["component_handle"] = s.ComponentHandle.Value() - } - if s.SubscriptionId != nil { - structMap["subscription_id"] = s.SubscriptionId - } - if s.Recurring != nil { - structMap["recurring"] = s.Recurring - } - if s.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = s.UpgradeCharge.Value() - } - if s.DowngradeCredit.IsValueSet() { - structMap["downgrade_credit"] = s.DowngradeCredit.Value() - } - if s.ArchivedAt.IsValueSet() { - structMap["archived_at"] = s.ArchivedAt.Value() - } - if s.PricePointId.IsValueSet() { - structMap["price_point_id"] = s.PricePointId.Value() - } - if s.PricePointHandle.IsValueSet() { - structMap["price_point_handle"] = s.PricePointHandle.Value() - } - if s.PricePointType != nil { - structMap["price_point_type"] = s.PricePointType - } - if s.PricePointName.IsValueSet() { - structMap["price_point_name"] = s.PricePointName.Value() - } - if s.ProductFamilyId != nil { - structMap["product_family_id"] = s.ProductFamilyId - } - if s.ProductFamilyHandle != nil { - structMap["product_family_handle"] = s.ProductFamilyHandle - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt.Format(time.RFC3339) - } - if s.UpdatedAt != nil { - structMap["updated_at"] = s.UpdatedAt.Format(time.RFC3339) - } - if s.UseSiteExchangeRate.IsValueSet() { - structMap["use_site_exchange_rate"] = s.UseSiteExchangeRate.Value() - } - if s.Description.IsValueSet() { - structMap["description"] = s.Description.Value() - } - if s.AllowFractionalQuantities != nil { - structMap["allow_fractional_quantities"] = s.AllowFractionalQuantities - } - if s.Subscription != nil { - structMap["subscription"] = s.Subscription - } - if s.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = s.DisplayOnHostedPage - } - if s.Interval != nil { - structMap["interval"] = s.Interval - } - if s.IntervalUnit != nil { - structMap["interval_unit"] = s.IntervalUnit - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.Name != nil { + structMap["name"] = s.Name + } + if s.Kind != nil { + structMap["kind"] = s.Kind + } + if s.UnitName != nil { + structMap["unit_name"] = s.UnitName + } + if s.Enabled != nil { + structMap["enabled"] = s.Enabled + } + if s.UnitBalance != nil { + structMap["unit_balance"] = s.UnitBalance + } + if s.Currency != nil { + structMap["currency"] = s.Currency + } + if s.AllocatedQuantity != nil { + structMap["allocated_quantity"] = s.AllocatedQuantity + } + if s.PricingScheme.IsValueSet() { + structMap["pricing_scheme"] = s.PricingScheme.Value() + } + if s.ComponentId != nil { + structMap["component_id"] = s.ComponentId + } + if s.ComponentHandle.IsValueSet() { + structMap["component_handle"] = s.ComponentHandle.Value() + } + if s.SubscriptionId != nil { + structMap["subscription_id"] = s.SubscriptionId + } + if s.Recurring != nil { + structMap["recurring"] = s.Recurring + } + if s.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = s.UpgradeCharge.Value() + } + if s.DowngradeCredit.IsValueSet() { + structMap["downgrade_credit"] = s.DowngradeCredit.Value() + } + if s.ArchivedAt.IsValueSet() { + structMap["archived_at"] = s.ArchivedAt.Value() + } + if s.PricePointId.IsValueSet() { + structMap["price_point_id"] = s.PricePointId.Value() + } + if s.PricePointHandle.IsValueSet() { + structMap["price_point_handle"] = s.PricePointHandle.Value() + } + if s.PricePointType != nil { + structMap["price_point_type"] = s.PricePointType + } + if s.PricePointName.IsValueSet() { + structMap["price_point_name"] = s.PricePointName.Value() + } + if s.ProductFamilyId != nil { + structMap["product_family_id"] = s.ProductFamilyId + } + if s.ProductFamilyHandle != nil { + structMap["product_family_handle"] = s.ProductFamilyHandle + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt.Format(time.RFC3339) + } + if s.UpdatedAt != nil { + structMap["updated_at"] = s.UpdatedAt.Format(time.RFC3339) + } + if s.UseSiteExchangeRate.IsValueSet() { + structMap["use_site_exchange_rate"] = s.UseSiteExchangeRate.Value() + } + if s.Description.IsValueSet() { + structMap["description"] = s.Description.Value() + } + if s.AllowFractionalQuantities != nil { + structMap["allow_fractional_quantities"] = s.AllowFractionalQuantities + } + if s.Subscription != nil { + structMap["subscription"] = s.Subscription.toMap() + } + if s.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = s.DisplayOnHostedPage + } + if s.Interval != nil { + structMap["interval"] = s.Interval + } + if s.IntervalUnit != nil { + structMap["interval_unit"] = s.IntervalUnit + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponent. // It customizes the JSON unmarshaling process for SubscriptionComponent objects. func (s *SubscriptionComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Kind *ComponentKind `json:"kind,omitempty"` - UnitName *string `json:"unit_name,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - UnitBalance *int `json:"unit_balance,omitempty"` - Currency *string `json:"currency,omitempty"` - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - PricingScheme Optional[PricingScheme] `json:"pricing_scheme"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle Optional[string] `json:"component_handle"` - SubscriptionId *int `json:"subscription_id,omitempty"` - Recurring *bool `json:"recurring,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` - ArchivedAt Optional[string] `json:"archived_at"` - PricePointId Optional[int] `json:"price_point_id"` - PricePointHandle Optional[string] `json:"price_point_handle"` - PricePointType *interface{} `json:"price_point_type,omitempty"` - PricePointName Optional[string] `json:"price_point_name"` - ProductFamilyId *int `json:"product_family_id,omitempty"` - ProductFamilyHandle *string `json:"product_family_handle,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` - Description Optional[string] `json:"description"` - AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` - Subscription *SubscriptionComponentSubscription `json:"subscription,omitempty"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.Name = temp.Name - s.Kind = temp.Kind - s.UnitName = temp.UnitName - s.Enabled = temp.Enabled - s.UnitBalance = temp.UnitBalance - s.Currency = temp.Currency - s.AllocatedQuantity = temp.AllocatedQuantity - s.PricingScheme = temp.PricingScheme - s.ComponentId = temp.ComponentId - s.ComponentHandle = temp.ComponentHandle - s.SubscriptionId = temp.SubscriptionId - s.Recurring = temp.Recurring - s.UpgradeCharge = temp.UpgradeCharge - s.DowngradeCredit = temp.DowngradeCredit - s.ArchivedAt = temp.ArchivedAt - s.PricePointId = temp.PricePointId - s.PricePointHandle = temp.PricePointHandle - s.PricePointType = temp.PricePointType - s.PricePointName = temp.PricePointName - s.ProductFamilyId = temp.ProductFamilyId - s.ProductFamilyHandle = temp.ProductFamilyHandle - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - s.CreatedAt = &CreatedAtVal - } - if temp.UpdatedAt != nil { - UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) - if err != nil { - log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) - } - s.UpdatedAt = &UpdatedAtVal - } - s.UseSiteExchangeRate = temp.UseSiteExchangeRate - s.Description = temp.Description - s.AllowFractionalQuantities = temp.AllowFractionalQuantities - s.Subscription = temp.Subscription - s.DisplayOnHostedPage = temp.DisplayOnHostedPage - s.Interval = temp.Interval - s.IntervalUnit = temp.IntervalUnit - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Kind *ComponentKind `json:"kind,omitempty"` + UnitName *string `json:"unit_name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + UnitBalance *int `json:"unit_balance,omitempty"` + Currency *string `json:"currency,omitempty"` + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + PricingScheme Optional[PricingScheme] `json:"pricing_scheme"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle Optional[string] `json:"component_handle"` + SubscriptionId *int `json:"subscription_id,omitempty"` + Recurring *bool `json:"recurring,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + DowngradeCredit Optional[CreditType] `json:"downgrade_credit"` + ArchivedAt Optional[string] `json:"archived_at"` + PricePointId Optional[int] `json:"price_point_id"` + PricePointHandle Optional[string] `json:"price_point_handle"` + PricePointType *interface{} `json:"price_point_type,omitempty"` + PricePointName Optional[string] `json:"price_point_name"` + ProductFamilyId *int `json:"product_family_id,omitempty"` + ProductFamilyHandle *string `json:"product_family_handle,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + UseSiteExchangeRate Optional[bool] `json:"use_site_exchange_rate"` + Description Optional[string] `json:"description"` + AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"` + Subscription *SubscriptionComponentSubscription `json:"subscription,omitempty"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.Name = temp.Name + s.Kind = temp.Kind + s.UnitName = temp.UnitName + s.Enabled = temp.Enabled + s.UnitBalance = temp.UnitBalance + s.Currency = temp.Currency + s.AllocatedQuantity = temp.AllocatedQuantity + s.PricingScheme = temp.PricingScheme + s.ComponentId = temp.ComponentId + s.ComponentHandle = temp.ComponentHandle + s.SubscriptionId = temp.SubscriptionId + s.Recurring = temp.Recurring + s.UpgradeCharge = temp.UpgradeCharge + s.DowngradeCredit = temp.DowngradeCredit + s.ArchivedAt = temp.ArchivedAt + s.PricePointId = temp.PricePointId + s.PricePointHandle = temp.PricePointHandle + s.PricePointType = temp.PricePointType + s.PricePointName = temp.PricePointName + s.ProductFamilyId = temp.ProductFamilyId + s.ProductFamilyHandle = temp.ProductFamilyHandle + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + s.CreatedAt = &CreatedAtVal + } + if temp.UpdatedAt != nil { + UpdatedAtVal, err := time.Parse(time.RFC3339, *temp.UpdatedAt) + if err != nil { + log.Fatalf("Cannot Parse updated_at as % s format.", time.RFC3339) + } + s.UpdatedAt = &UpdatedAtVal + } + s.UseSiteExchangeRate = temp.UseSiteExchangeRate + s.Description = temp.Description + s.AllowFractionalQuantities = temp.AllowFractionalQuantities + s.Subscription = temp.Subscription + s.DisplayOnHostedPage = temp.DisplayOnHostedPage + s.Interval = temp.Interval + s.IntervalUnit = temp.IntervalUnit + return nil } diff --git a/models/subscription_component_allocation_error_item.go b/models/subscription_component_allocation_error_item.go index 88c9efa3..8f1e680e 100644 --- a/models/subscription_component_allocation_error_item.go +++ b/models/subscription_component_allocation_error_item.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionComponentAllocationErrorItem represents a SubscriptionComponentAllocationErrorItem struct. type SubscriptionComponentAllocationErrorItem struct { - Kind *string `json:"kind,omitempty"` - Message *string `json:"message,omitempty"` + Kind *string `json:"kind,omitempty"` + Message *string `json:"message,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentAllocationErrorItem. +// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentAllocationErrorItem. // It customizes the JSON marshaling process for SubscriptionComponentAllocationErrorItem objects. func (s *SubscriptionComponentAllocationErrorItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionComponentAllocationErrorItem object to a map representation for JSON marshaling. func (s *SubscriptionComponentAllocationErrorItem) toMap() map[string]any { - structMap := make(map[string]any) - if s.Kind != nil { - structMap["kind"] = s.Kind - } - if s.Message != nil { - structMap["message"] = s.Message - } - return structMap + structMap := make(map[string]any) + if s.Kind != nil { + structMap["kind"] = s.Kind + } + if s.Message != nil { + structMap["message"] = s.Message + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentAllocationErrorItem. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentAllocationErrorItem. // It customizes the JSON unmarshaling process for SubscriptionComponentAllocationErrorItem objects. func (s *SubscriptionComponentAllocationErrorItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Kind *string `json:"kind,omitempty"` - Message *string `json:"message,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Kind = temp.Kind - s.Message = temp.Message - return nil + temp := &struct { + Kind *string `json:"kind,omitempty"` + Message *string `json:"message,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Kind = temp.Kind + s.Message = temp.Message + return nil } diff --git a/models/subscription_component_response.go b/models/subscription_component_response.go index 957f7ec7..fa93fc00 100644 --- a/models/subscription_component_response.go +++ b/models/subscription_component_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionComponentResponse represents a SubscriptionComponentResponse struct. type SubscriptionComponentResponse struct { - Component *SubscriptionComponent `json:"component,omitempty"` + Component *SubscriptionComponent `json:"component,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentResponse. // It customizes the JSON marshaling process for SubscriptionComponentResponse objects. func (s *SubscriptionComponentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionComponentResponse object to a map representation for JSON marshaling. func (s *SubscriptionComponentResponse) toMap() map[string]any { - structMap := make(map[string]any) - if s.Component != nil { - structMap["component"] = s.Component - } - return structMap + structMap := make(map[string]any) + if s.Component != nil { + structMap["component"] = s.Component.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentResponse. // It customizes the JSON unmarshaling process for SubscriptionComponentResponse objects. func (s *SubscriptionComponentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Component *SubscriptionComponent `json:"component,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Component = temp.Component - return nil + temp := &struct { + Component *SubscriptionComponent `json:"component,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Component = temp.Component + return nil } diff --git a/models/subscription_component_subscription.go b/models/subscription_component_subscription.go index f55805e5..9f7d95fd 100644 --- a/models/subscription_component_subscription.go +++ b/models/subscription_component_subscription.go @@ -1,69 +1,69 @@ package models import ( - "encoding/json" + "encoding/json" ) -// SubscriptionComponentSubscription represents a SubscriptionComponentSubscription struct. +// SubscriptionComponentSubscription represents a SubscriptionComponentSubscription struct. // An optional object, will be returned if provided `include=subscription` query param. type SubscriptionComponentSubscription struct { - // 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. - // See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. - State *SubscriptionState `json:"state,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + // 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) 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-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) 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-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details. + // See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions. + State *SubscriptionState `json:"state,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentSubscription. +// MarshalJSON implements the json.Marshaler interface for SubscriptionComponentSubscription. // It customizes the JSON marshaling process for SubscriptionComponentSubscription objects. func (s *SubscriptionComponentSubscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionComponentSubscription object to a map representation for JSON marshaling. func (s *SubscriptionComponentSubscription) toMap() map[string]any { - structMap := make(map[string]any) - if s.State != nil { - structMap["state"] = s.State - } - if s.UpdatedAt != nil { - structMap["updated_at"] = s.UpdatedAt - } - return structMap + structMap := make(map[string]any) + if s.State != nil { + structMap["state"] = s.State + } + if s.UpdatedAt != nil { + structMap["updated_at"] = s.UpdatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentSubscription. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentSubscription. // It customizes the JSON unmarshaling process for SubscriptionComponentSubscription objects. func (s *SubscriptionComponentSubscription) UnmarshalJSON(input []byte) error { - temp := &struct { - State *SubscriptionState `json:"state,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.State = temp.State - s.UpdatedAt = temp.UpdatedAt - return nil + temp := &struct { + State *SubscriptionState `json:"state,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.State = temp.State + s.UpdatedAt = temp.UpdatedAt + return nil } diff --git a/models/subscription_custom_price.go b/models/subscription_custom_price.go index eda20ec3..1d828341 100644 --- a/models/subscription_custom_price.go +++ b/models/subscription_custom_price.go @@ -1,122 +1,122 @@ package models import ( - "encoding/json" + "encoding/json" ) -// SubscriptionCustomPrice represents a SubscriptionCustomPrice struct. +// SubscriptionCustomPrice represents a SubscriptionCustomPrice struct. // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription type SubscriptionCustomPrice struct { - // (Optional) - Name *string `json:"name,omitempty"` - // (Optional) - Handle *string `json:"handle,omitempty"` - // Required if using `custom_price` attribute. - PriceInCents interface{} `json:"price_in_cents"` - // Required if using `custom_price` attribute. - Interval interface{} `json:"interval"` - // Required if using `custom_price` attribute. - IntervalUnit IntervalUnit `json:"interval_unit"` - // (Optional) - TrialPriceInCents *interface{} `json:"trial_price_in_cents,omitempty"` - // (Optional) - TrialInterval *interface{} `json:"trial_interval,omitempty"` - // (Optional) - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - // (Optional) - InitialChargeInCents *interface{} `json:"initial_charge_in_cents,omitempty"` - // (Optional) - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - // (Optional) - ExpirationInterval *interface{} `json:"expiration_interval,omitempty"` - // (Optional) - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - // (Optional) - TaxIncluded *bool `json:"tax_included,omitempty"` + // (Optional) + Name *string `json:"name,omitempty"` + // (Optional) + Handle *string `json:"handle,omitempty"` + // Required if using `custom_price` attribute. + PriceInCents interface{} `json:"price_in_cents"` + // Required if using `custom_price` attribute. + Interval interface{} `json:"interval"` + // Required if using `custom_price` attribute. + IntervalUnit IntervalUnit `json:"interval_unit"` + // (Optional) + TrialPriceInCents *interface{} `json:"trial_price_in_cents,omitempty"` + // (Optional) + TrialInterval *interface{} `json:"trial_interval,omitempty"` + // (Optional) + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + // (Optional) + InitialChargeInCents *interface{} `json:"initial_charge_in_cents,omitempty"` + // (Optional) + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + // (Optional) + ExpirationInterval *interface{} `json:"expiration_interval,omitempty"` + // (Optional) + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + // (Optional) + TaxIncluded *bool `json:"tax_included,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionCustomPrice. +// MarshalJSON implements the json.Marshaler interface for SubscriptionCustomPrice. // It customizes the JSON marshaling process for SubscriptionCustomPrice objects. func (s *SubscriptionCustomPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionCustomPrice object to a map representation for JSON marshaling. func (s *SubscriptionCustomPrice) toMap() map[string]any { - structMap := make(map[string]any) - if s.Name != nil { - structMap["name"] = s.Name - } - if s.Handle != nil { - structMap["handle"] = s.Handle - } - structMap["price_in_cents"] = s.PriceInCents - structMap["interval"] = s.Interval - structMap["interval_unit"] = s.IntervalUnit - if s.TrialPriceInCents != nil { - structMap["trial_price_in_cents"] = s.TrialPriceInCents - } - if s.TrialInterval != nil { - structMap["trial_interval"] = s.TrialInterval - } - if s.TrialIntervalUnit != nil { - structMap["trial_interval_unit"] = s.TrialIntervalUnit - } - if s.InitialChargeInCents != nil { - structMap["initial_charge_in_cents"] = s.InitialChargeInCents - } - if s.InitialChargeAfterTrial != nil { - structMap["initial_charge_after_trial"] = s.InitialChargeAfterTrial - } - if s.ExpirationInterval != nil { - structMap["expiration_interval"] = s.ExpirationInterval - } - if s.ExpirationIntervalUnit != nil { - structMap["expiration_interval_unit"] = s.ExpirationIntervalUnit - } - if s.TaxIncluded != nil { - structMap["tax_included"] = s.TaxIncluded - } - return structMap + structMap := make(map[string]any) + if s.Name != nil { + structMap["name"] = s.Name + } + if s.Handle != nil { + structMap["handle"] = s.Handle + } + structMap["price_in_cents"] = s.PriceInCents + structMap["interval"] = s.Interval + structMap["interval_unit"] = s.IntervalUnit + if s.TrialPriceInCents != nil { + structMap["trial_price_in_cents"] = s.TrialPriceInCents + } + if s.TrialInterval != nil { + structMap["trial_interval"] = s.TrialInterval + } + if s.TrialIntervalUnit != nil { + structMap["trial_interval_unit"] = s.TrialIntervalUnit + } + if s.InitialChargeInCents != nil { + structMap["initial_charge_in_cents"] = s.InitialChargeInCents + } + if s.InitialChargeAfterTrial != nil { + structMap["initial_charge_after_trial"] = s.InitialChargeAfterTrial + } + if s.ExpirationInterval != nil { + structMap["expiration_interval"] = s.ExpirationInterval + } + if s.ExpirationIntervalUnit != nil { + structMap["expiration_interval_unit"] = s.ExpirationIntervalUnit + } + if s.TaxIncluded != nil { + structMap["tax_included"] = s.TaxIncluded + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionCustomPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionCustomPrice. // It customizes the JSON unmarshaling process for SubscriptionCustomPrice objects. func (s *SubscriptionCustomPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - PriceInCents interface{} `json:"price_in_cents"` - Interval interface{} `json:"interval"` - IntervalUnit IntervalUnit `json:"interval_unit"` - TrialPriceInCents *interface{} `json:"trial_price_in_cents,omitempty"` - TrialInterval *interface{} `json:"trial_interval,omitempty"` - TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` - InitialChargeInCents *interface{} `json:"initial_charge_in_cents,omitempty"` - InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` - ExpirationInterval *interface{} `json:"expiration_interval,omitempty"` - ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` - TaxIncluded *bool `json:"tax_included,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Name = temp.Name - s.Handle = temp.Handle - s.PriceInCents = temp.PriceInCents - s.Interval = temp.Interval - s.IntervalUnit = temp.IntervalUnit - s.TrialPriceInCents = temp.TrialPriceInCents - s.TrialInterval = temp.TrialInterval - s.TrialIntervalUnit = temp.TrialIntervalUnit - s.InitialChargeInCents = temp.InitialChargeInCents - s.InitialChargeAfterTrial = temp.InitialChargeAfterTrial - s.ExpirationInterval = temp.ExpirationInterval - s.ExpirationIntervalUnit = temp.ExpirationIntervalUnit - s.TaxIncluded = temp.TaxIncluded - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + PriceInCents interface{} `json:"price_in_cents"` + Interval interface{} `json:"interval"` + IntervalUnit IntervalUnit `json:"interval_unit"` + TrialPriceInCents *interface{} `json:"trial_price_in_cents,omitempty"` + TrialInterval *interface{} `json:"trial_interval,omitempty"` + TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"` + InitialChargeInCents *interface{} `json:"initial_charge_in_cents,omitempty"` + InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"` + ExpirationInterval *interface{} `json:"expiration_interval,omitempty"` + ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"` + TaxIncluded *bool `json:"tax_included,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Name = temp.Name + s.Handle = temp.Handle + s.PriceInCents = temp.PriceInCents + s.Interval = temp.Interval + s.IntervalUnit = temp.IntervalUnit + s.TrialPriceInCents = temp.TrialPriceInCents + s.TrialInterval = temp.TrialInterval + s.TrialIntervalUnit = temp.TrialIntervalUnit + s.InitialChargeInCents = temp.InitialChargeInCents + s.InitialChargeAfterTrial = temp.InitialChargeAfterTrial + s.ExpirationInterval = temp.ExpirationInterval + s.ExpirationIntervalUnit = temp.ExpirationIntervalUnit + s.TaxIncluded = temp.TaxIncluded + return nil } diff --git a/models/subscription_group.go b/models/subscription_group.go index b00c8815..c9bd7236 100644 --- a/models/subscription_group.go +++ b/models/subscription_group.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroup represents a SubscriptionGroup struct. type SubscriptionGroup struct { - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfile *SubscriptionGroupPaymentProfile `json:"payment_profile,omitempty"` - PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfile *SubscriptionGroupPaymentProfile `json:"payment_profile,omitempty"` + PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroup. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroup. // It customizes the JSON marshaling process for SubscriptionGroup objects. func (s *SubscriptionGroup) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroup object to a map representation for JSON marshaling. func (s *SubscriptionGroup) toMap() map[string]any { - structMap := make(map[string]any) - if s.CustomerId != nil { - structMap["customer_id"] = s.CustomerId - } - if s.PaymentProfile != nil { - structMap["payment_profile"] = s.PaymentProfile - } - if s.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = s.PaymentCollectionMethod - } - if s.SubscriptionIds != nil { - structMap["subscription_ids"] = s.SubscriptionIds - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt - } - return structMap + structMap := make(map[string]any) + if s.CustomerId != nil { + structMap["customer_id"] = s.CustomerId + } + if s.PaymentProfile != nil { + structMap["payment_profile"] = s.PaymentProfile.toMap() + } + if s.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = s.PaymentCollectionMethod + } + if s.SubscriptionIds != nil { + structMap["subscription_ids"] = s.SubscriptionIds + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroup. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroup. // It customizes the JSON unmarshaling process for SubscriptionGroup objects. func (s *SubscriptionGroup) UnmarshalJSON(input []byte) error { - temp := &struct { - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfile *SubscriptionGroupPaymentProfile `json:"payment_profile,omitempty"` - PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.CustomerId = temp.CustomerId - s.PaymentProfile = temp.PaymentProfile - s.PaymentCollectionMethod = temp.PaymentCollectionMethod - s.SubscriptionIds = temp.SubscriptionIds - s.CreatedAt = temp.CreatedAt - return nil + temp := &struct { + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfile *SubscriptionGroupPaymentProfile `json:"payment_profile,omitempty"` + PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.CustomerId = temp.CustomerId + s.PaymentProfile = temp.PaymentProfile + s.PaymentCollectionMethod = temp.PaymentCollectionMethod + s.SubscriptionIds = temp.SubscriptionIds + s.CreatedAt = temp.CreatedAt + return nil } diff --git a/models/subscription_group_balances.go b/models/subscription_group_balances.go index bc0b503d..1da5d58e 100644 --- a/models/subscription_group_balances.go +++ b/models/subscription_group_balances.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupBalances represents a SubscriptionGroupBalances struct. type SubscriptionGroupBalances struct { - Prepayments *AccountBalance `json:"prepayments,omitempty"` - ServiceCredits *AccountBalance `json:"service_credits,omitempty"` - OpenInvoices *AccountBalance `json:"open_invoices,omitempty"` - PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"` + Prepayments *AccountBalance `json:"prepayments,omitempty"` + ServiceCredits *AccountBalance `json:"service_credits,omitempty"` + OpenInvoices *AccountBalance `json:"open_invoices,omitempty"` + PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBalances. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBalances. // It customizes the JSON marshaling process for SubscriptionGroupBalances objects. func (s *SubscriptionGroupBalances) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupBalances object to a map representation for JSON marshaling. func (s *SubscriptionGroupBalances) toMap() map[string]any { - structMap := make(map[string]any) - if s.Prepayments != nil { - structMap["prepayments"] = s.Prepayments - } - if s.ServiceCredits != nil { - structMap["service_credits"] = s.ServiceCredits - } - if s.OpenInvoices != nil { - structMap["open_invoices"] = s.OpenInvoices - } - if s.PendingDiscounts != nil { - structMap["pending_discounts"] = s.PendingDiscounts - } - return structMap + structMap := make(map[string]any) + if s.Prepayments != nil { + structMap["prepayments"] = s.Prepayments.toMap() + } + if s.ServiceCredits != nil { + structMap["service_credits"] = s.ServiceCredits.toMap() + } + if s.OpenInvoices != nil { + structMap["open_invoices"] = s.OpenInvoices.toMap() + } + if s.PendingDiscounts != nil { + structMap["pending_discounts"] = s.PendingDiscounts.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBalances. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBalances. // It customizes the JSON unmarshaling process for SubscriptionGroupBalances objects. func (s *SubscriptionGroupBalances) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayments *AccountBalance `json:"prepayments,omitempty"` - ServiceCredits *AccountBalance `json:"service_credits,omitempty"` - OpenInvoices *AccountBalance `json:"open_invoices,omitempty"` - PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Prepayments = temp.Prepayments - s.ServiceCredits = temp.ServiceCredits - s.OpenInvoices = temp.OpenInvoices - s.PendingDiscounts = temp.PendingDiscounts - return nil + temp := &struct { + Prepayments *AccountBalance `json:"prepayments,omitempty"` + ServiceCredits *AccountBalance `json:"service_credits,omitempty"` + OpenInvoices *AccountBalance `json:"open_invoices,omitempty"` + PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Prepayments = temp.Prepayments + s.ServiceCredits = temp.ServiceCredits + s.OpenInvoices = temp.OpenInvoices + s.PendingDiscounts = temp.PendingDiscounts + return nil } diff --git a/models/subscription_group_bank_account.go b/models/subscription_group_bank_account.go index 0b70cac8..422590bd 100644 --- a/models/subscription_group_bank_account.go +++ b/models/subscription_group_bank_account.go @@ -1,140 +1,140 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupBankAccount represents a SubscriptionGroupBankAccount struct. type SubscriptionGroupBankAccount struct { - // (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides - BankName *string `json:"bank_name,omitempty"` - // (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 - BankAccountNumber *string `json:"bank_account_number,omitempty"` - // (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 - BankRoutingNumber *string `json:"bank_routing_number,omitempty"` - // (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided - BankIban *string `json:"bank_iban,omitempty"` - // (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided - BankBranchCode *string `json:"bank_branch_code,omitempty"` - // Defaults to checking - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - // Defaults to personal - BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - ChargifyToken *string `json:"chargify_token,omitempty"` - // The vault that stores the payment profile with the provided vault_token. - CurrentVault *BankAccountVault `json:"current_vault,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` + // (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides + BankName *string `json:"bank_name,omitempty"` + // (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 + BankAccountNumber *string `json:"bank_account_number,omitempty"` + // (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 + BankRoutingNumber *string `json:"bank_routing_number,omitempty"` + // (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided + BankIban *string `json:"bank_iban,omitempty"` + // (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided + BankBranchCode *string `json:"bank_branch_code,omitempty"` + // Defaults to checking + BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` + // Defaults to personal + BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + ChargifyToken *string `json:"chargify_token,omitempty"` + // The vault that stores the payment profile with the provided vault_token. + CurrentVault *BankAccountVault `json:"current_vault,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBankAccount. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBankAccount. // It customizes the JSON marshaling process for SubscriptionGroupBankAccount objects. func (s *SubscriptionGroupBankAccount) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupBankAccount object to a map representation for JSON marshaling. func (s *SubscriptionGroupBankAccount) toMap() map[string]any { - structMap := make(map[string]any) - if s.BankName != nil { - structMap["bank_name"] = s.BankName - } - if s.BankAccountNumber != nil { - structMap["bank_account_number"] = s.BankAccountNumber - } - if s.BankRoutingNumber != nil { - structMap["bank_routing_number"] = s.BankRoutingNumber - } - if s.BankIban != nil { - structMap["bank_iban"] = s.BankIban - } - if s.BankBranchCode != nil { - structMap["bank_branch_code"] = s.BankBranchCode - } - if s.BankAccountType != nil { - structMap["bank_account_type"] = s.BankAccountType - } - if s.BankAccountHolderType != nil { - structMap["bank_account_holder_type"] = s.BankAccountHolderType - } - if s.PaymentType != nil { - structMap["payment_type"] = s.PaymentType - } - if s.BillingAddress != nil { - structMap["billing_address"] = s.BillingAddress - } - if s.BillingCity != nil { - structMap["billing_city"] = s.BillingCity - } - if s.BillingState != nil { - structMap["billing_state"] = s.BillingState - } - if s.BillingZip != nil { - structMap["billing_zip"] = s.BillingZip - } - if s.BillingCountry != nil { - structMap["billing_country"] = s.BillingCountry - } - if s.ChargifyToken != nil { - structMap["chargify_token"] = s.ChargifyToken - } - if s.CurrentVault != nil { - structMap["current_vault"] = s.CurrentVault - } - if s.GatewayHandle != nil { - structMap["gateway_handle"] = s.GatewayHandle - } - return structMap + structMap := make(map[string]any) + if s.BankName != nil { + structMap["bank_name"] = s.BankName + } + if s.BankAccountNumber != nil { + structMap["bank_account_number"] = s.BankAccountNumber + } + if s.BankRoutingNumber != nil { + structMap["bank_routing_number"] = s.BankRoutingNumber + } + if s.BankIban != nil { + structMap["bank_iban"] = s.BankIban + } + if s.BankBranchCode != nil { + structMap["bank_branch_code"] = s.BankBranchCode + } + if s.BankAccountType != nil { + structMap["bank_account_type"] = s.BankAccountType + } + if s.BankAccountHolderType != nil { + structMap["bank_account_holder_type"] = s.BankAccountHolderType + } + if s.PaymentType != nil { + structMap["payment_type"] = s.PaymentType + } + if s.BillingAddress != nil { + structMap["billing_address"] = s.BillingAddress + } + if s.BillingCity != nil { + structMap["billing_city"] = s.BillingCity + } + if s.BillingState != nil { + structMap["billing_state"] = s.BillingState + } + if s.BillingZip != nil { + structMap["billing_zip"] = s.BillingZip + } + if s.BillingCountry != nil { + structMap["billing_country"] = s.BillingCountry + } + if s.ChargifyToken != nil { + structMap["chargify_token"] = s.ChargifyToken + } + if s.CurrentVault != nil { + structMap["current_vault"] = s.CurrentVault + } + if s.GatewayHandle != nil { + structMap["gateway_handle"] = s.GatewayHandle + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBankAccount. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBankAccount. // It customizes the JSON unmarshaling process for SubscriptionGroupBankAccount objects. func (s *SubscriptionGroupBankAccount) UnmarshalJSON(input []byte) error { - temp := &struct { - BankName *string `json:"bank_name,omitempty"` - BankAccountNumber *string `json:"bank_account_number,omitempty"` - BankRoutingNumber *string `json:"bank_routing_number,omitempty"` - BankIban *string `json:"bank_iban,omitempty"` - BankBranchCode *string `json:"bank_branch_code,omitempty"` - BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` - BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` - PaymentType *PaymentType `json:"payment_type,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - ChargifyToken *string `json:"chargify_token,omitempty"` - CurrentVault *BankAccountVault `json:"current_vault,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.BankName = temp.BankName - s.BankAccountNumber = temp.BankAccountNumber - s.BankRoutingNumber = temp.BankRoutingNumber - s.BankIban = temp.BankIban - s.BankBranchCode = temp.BankBranchCode - s.BankAccountType = temp.BankAccountType - s.BankAccountHolderType = temp.BankAccountHolderType - s.PaymentType = temp.PaymentType - s.BillingAddress = temp.BillingAddress - s.BillingCity = temp.BillingCity - s.BillingState = temp.BillingState - s.BillingZip = temp.BillingZip - s.BillingCountry = temp.BillingCountry - s.ChargifyToken = temp.ChargifyToken - s.CurrentVault = temp.CurrentVault - s.GatewayHandle = temp.GatewayHandle - return nil + temp := &struct { + BankName *string `json:"bank_name,omitempty"` + BankAccountNumber *string `json:"bank_account_number,omitempty"` + BankRoutingNumber *string `json:"bank_routing_number,omitempty"` + BankIban *string `json:"bank_iban,omitempty"` + BankBranchCode *string `json:"bank_branch_code,omitempty"` + BankAccountType *BankAccountType `json:"bank_account_type,omitempty"` + BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"` + PaymentType *PaymentType `json:"payment_type,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + ChargifyToken *string `json:"chargify_token,omitempty"` + CurrentVault *BankAccountVault `json:"current_vault,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.BankName = temp.BankName + s.BankAccountNumber = temp.BankAccountNumber + s.BankRoutingNumber = temp.BankRoutingNumber + s.BankIban = temp.BankIban + s.BankBranchCode = temp.BankBranchCode + s.BankAccountType = temp.BankAccountType + s.BankAccountHolderType = temp.BankAccountHolderType + s.PaymentType = temp.PaymentType + s.BillingAddress = temp.BillingAddress + s.BillingCity = temp.BillingCity + s.BillingState = temp.BillingState + s.BillingZip = temp.BillingZip + s.BillingCountry = temp.BillingCountry + s.ChargifyToken = temp.ChargifyToken + s.CurrentVault = temp.CurrentVault + s.GatewayHandle = temp.GatewayHandle + return nil } diff --git a/models/subscription_group_component_custom_price.go b/models/subscription_group_component_custom_price.go index 3c3f6a64..b7000ddd 100644 --- a/models/subscription_group_component_custom_price.go +++ b/models/subscription_group_component_custom_price.go @@ -1,56 +1,56 @@ package models import ( - "encoding/json" + "encoding/json" ) -// SubscriptionGroupComponentCustomPrice represents a SubscriptionGroupComponentCustomPrice struct. +// SubscriptionGroupComponentCustomPrice represents a SubscriptionGroupComponentCustomPrice struct. // Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. type SubscriptionGroupComponentCustomPrice struct { - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - OveragePricing []ComponentCustomPrice `json:"overage_pricing,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + OveragePricing []ComponentCustomPrice `json:"overage_pricing,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupComponentCustomPrice. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupComponentCustomPrice. // It customizes the JSON marshaling process for SubscriptionGroupComponentCustomPrice objects. func (s *SubscriptionGroupComponentCustomPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupComponentCustomPrice object to a map representation for JSON marshaling. func (s *SubscriptionGroupComponentCustomPrice) toMap() map[string]any { - structMap := make(map[string]any) - if s.PricingScheme != nil { - structMap["pricing_scheme"] = s.PricingScheme - } - if s.Prices != nil { - structMap["prices"] = s.Prices - } - if s.OveragePricing != nil { - structMap["overage_pricing"] = s.OveragePricing - } - return structMap + structMap := make(map[string]any) + if s.PricingScheme != nil { + structMap["pricing_scheme"] = s.PricingScheme + } + if s.Prices != nil { + structMap["prices"] = s.Prices + } + if s.OveragePricing != nil { + structMap["overage_pricing"] = s.OveragePricing + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupComponentCustomPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupComponentCustomPrice. // It customizes the JSON unmarshaling process for SubscriptionGroupComponentCustomPrice objects. func (s *SubscriptionGroupComponentCustomPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - Prices []Price `json:"prices,omitempty"` - OveragePricing []ComponentCustomPrice `json:"overage_pricing,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.PricingScheme = temp.PricingScheme - s.Prices = temp.Prices - s.OveragePricing = temp.OveragePricing - return nil + temp := &struct { + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + Prices []Price `json:"prices,omitempty"` + OveragePricing []ComponentCustomPrice `json:"overage_pricing,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.PricingScheme = temp.PricingScheme + s.Prices = temp.Prices + s.OveragePricing = temp.OveragePricing + return nil } diff --git a/models/subscription_group_credit_card.go b/models/subscription_group_credit_card.go index cb883934..30b7fe49 100644 --- a/models/subscription_group_credit_card.go +++ b/models/subscription_group_credit_card.go @@ -1,158 +1,158 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupCreditCard represents a SubscriptionGroupCreditCard struct. type SubscriptionGroupCreditCard struct { - FullNumber *interface{} `json:"full_number,omitempty"` - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - ChargifyToken *string `json:"chargify_token,omitempty"` - VaultToken *string `json:"vault_token,omitempty"` - // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingAddress2 *string `json:"billing_address_2,omitempty"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - LastFour *string `json:"last_four,omitempty"` - // The type of card used. - CardType *CardType `json:"card_type,omitempty"` - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - Cvv *string `json:"cvv,omitempty"` - PaymentType *string `json:"payment_type,omitempty"` + FullNumber *interface{} `json:"full_number,omitempty"` + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + ChargifyToken *string `json:"chargify_token,omitempty"` + VaultToken *string `json:"vault_token,omitempty"` + // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingAddress2 *string `json:"billing_address_2,omitempty"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + LastFour *string `json:"last_four,omitempty"` + // The type of card used. + CardType *CardType `json:"card_type,omitempty"` + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + Cvv *string `json:"cvv,omitempty"` + PaymentType *string `json:"payment_type,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCreditCard. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCreditCard. // It customizes the JSON marshaling process for SubscriptionGroupCreditCard objects. func (s *SubscriptionGroupCreditCard) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupCreditCard object to a map representation for JSON marshaling. func (s *SubscriptionGroupCreditCard) toMap() map[string]any { - structMap := make(map[string]any) - if s.FullNumber != nil { - structMap["full_number"] = s.FullNumber - } - if s.ExpirationMonth != nil { - structMap["expiration_month"] = s.ExpirationMonth - } - if s.ExpirationYear != nil { - structMap["expiration_year"] = s.ExpirationYear - } - if s.ChargifyToken != nil { - structMap["chargify_token"] = s.ChargifyToken - } - if s.VaultToken != nil { - structMap["vault_token"] = s.VaultToken - } - if s.CurrentVault != nil { - structMap["current_vault"] = s.CurrentVault - } - if s.GatewayHandle != nil { - structMap["gateway_handle"] = s.GatewayHandle - } - if s.FirstName != nil { - structMap["first_name"] = s.FirstName - } - if s.LastName != nil { - structMap["last_name"] = s.LastName - } - if s.BillingAddress != nil { - structMap["billing_address"] = s.BillingAddress - } - if s.BillingAddress2 != nil { - structMap["billing_address_2"] = s.BillingAddress2 - } - if s.BillingCity != nil { - structMap["billing_city"] = s.BillingCity - } - if s.BillingState != nil { - structMap["billing_state"] = s.BillingState - } - if s.BillingZip != nil { - structMap["billing_zip"] = s.BillingZip - } - if s.BillingCountry != nil { - structMap["billing_country"] = s.BillingCountry - } - if s.LastFour != nil { - structMap["last_four"] = s.LastFour - } - if s.CardType != nil { - structMap["card_type"] = s.CardType - } - if s.CustomerVaultToken != nil { - structMap["customer_vault_token"] = s.CustomerVaultToken - } - if s.Cvv != nil { - structMap["cvv"] = s.Cvv - } - if s.PaymentType != nil { - structMap["payment_type"] = s.PaymentType - } - return structMap + structMap := make(map[string]any) + if s.FullNumber != nil { + structMap["full_number"] = s.FullNumber + } + if s.ExpirationMonth != nil { + structMap["expiration_month"] = s.ExpirationMonth + } + if s.ExpirationYear != nil { + structMap["expiration_year"] = s.ExpirationYear + } + if s.ChargifyToken != nil { + structMap["chargify_token"] = s.ChargifyToken + } + if s.VaultToken != nil { + structMap["vault_token"] = s.VaultToken + } + if s.CurrentVault != nil { + structMap["current_vault"] = s.CurrentVault + } + if s.GatewayHandle != nil { + structMap["gateway_handle"] = s.GatewayHandle + } + if s.FirstName != nil { + structMap["first_name"] = s.FirstName + } + if s.LastName != nil { + structMap["last_name"] = s.LastName + } + if s.BillingAddress != nil { + structMap["billing_address"] = s.BillingAddress + } + if s.BillingAddress2 != nil { + structMap["billing_address_2"] = s.BillingAddress2 + } + if s.BillingCity != nil { + structMap["billing_city"] = s.BillingCity + } + if s.BillingState != nil { + structMap["billing_state"] = s.BillingState + } + if s.BillingZip != nil { + structMap["billing_zip"] = s.BillingZip + } + if s.BillingCountry != nil { + structMap["billing_country"] = s.BillingCountry + } + if s.LastFour != nil { + structMap["last_four"] = s.LastFour + } + if s.CardType != nil { + structMap["card_type"] = s.CardType + } + if s.CustomerVaultToken != nil { + structMap["customer_vault_token"] = s.CustomerVaultToken + } + if s.Cvv != nil { + structMap["cvv"] = s.Cvv + } + if s.PaymentType != nil { + structMap["payment_type"] = s.PaymentType + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCreditCard. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCreditCard. // It customizes the JSON unmarshaling process for SubscriptionGroupCreditCard objects. func (s *SubscriptionGroupCreditCard) UnmarshalJSON(input []byte) error { - temp := &struct { - FullNumber *interface{} `json:"full_number,omitempty"` - ExpirationMonth *interface{} `json:"expiration_month,omitempty"` - ExpirationYear *interface{} `json:"expiration_year,omitempty"` - ChargifyToken *string `json:"chargify_token,omitempty"` - VaultToken *string `json:"vault_token,omitempty"` - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - GatewayHandle *string `json:"gateway_handle,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingAddress2 *string `json:"billing_address_2,omitempty"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - LastFour *string `json:"last_four,omitempty"` - CardType *CardType `json:"card_type,omitempty"` - CustomerVaultToken *string `json:"customer_vault_token,omitempty"` - Cvv *string `json:"cvv,omitempty"` - PaymentType *string `json:"payment_type,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.FullNumber = temp.FullNumber - s.ExpirationMonth = temp.ExpirationMonth - s.ExpirationYear = temp.ExpirationYear - s.ChargifyToken = temp.ChargifyToken - s.VaultToken = temp.VaultToken - s.CurrentVault = temp.CurrentVault - s.GatewayHandle = temp.GatewayHandle - s.FirstName = temp.FirstName - s.LastName = temp.LastName - s.BillingAddress = temp.BillingAddress - s.BillingAddress2 = temp.BillingAddress2 - s.BillingCity = temp.BillingCity - s.BillingState = temp.BillingState - s.BillingZip = temp.BillingZip - s.BillingCountry = temp.BillingCountry - s.LastFour = temp.LastFour - s.CardType = temp.CardType - s.CustomerVaultToken = temp.CustomerVaultToken - s.Cvv = temp.Cvv - s.PaymentType = temp.PaymentType - return nil + temp := &struct { + FullNumber *interface{} `json:"full_number,omitempty"` + ExpirationMonth *interface{} `json:"expiration_month,omitempty"` + ExpirationYear *interface{} `json:"expiration_year,omitempty"` + ChargifyToken *string `json:"chargify_token,omitempty"` + VaultToken *string `json:"vault_token,omitempty"` + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + GatewayHandle *string `json:"gateway_handle,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingAddress2 *string `json:"billing_address_2,omitempty"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + LastFour *string `json:"last_four,omitempty"` + CardType *CardType `json:"card_type,omitempty"` + CustomerVaultToken *string `json:"customer_vault_token,omitempty"` + Cvv *string `json:"cvv,omitempty"` + PaymentType *string `json:"payment_type,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.FullNumber = temp.FullNumber + s.ExpirationMonth = temp.ExpirationMonth + s.ExpirationYear = temp.ExpirationYear + s.ChargifyToken = temp.ChargifyToken + s.VaultToken = temp.VaultToken + s.CurrentVault = temp.CurrentVault + s.GatewayHandle = temp.GatewayHandle + s.FirstName = temp.FirstName + s.LastName = temp.LastName + s.BillingAddress = temp.BillingAddress + s.BillingAddress2 = temp.BillingAddress2 + s.BillingCity = temp.BillingCity + s.BillingState = temp.BillingState + s.BillingZip = temp.BillingZip + s.BillingCountry = temp.BillingCountry + s.LastFour = temp.LastFour + s.CardType = temp.CardType + s.CustomerVaultToken = temp.CustomerVaultToken + s.Cvv = temp.Cvv + s.PaymentType = temp.PaymentType + return nil } diff --git a/models/subscription_group_customer.go b/models/subscription_group_customer.go index 6187cbee..a0f97445 100644 --- a/models/subscription_group_customer.go +++ b/models/subscription_group_customer.go @@ -1,66 +1,66 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupCustomer represents a SubscriptionGroupCustomer struct. type SubscriptionGroupCustomer struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization *string `json:"organization,omitempty"` - Email *string `json:"email,omitempty"` - Reference *string `json:"reference,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization *string `json:"organization,omitempty"` + Email *string `json:"email,omitempty"` + Reference *string `json:"reference,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCustomer. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCustomer. // It customizes the JSON marshaling process for SubscriptionGroupCustomer objects. func (s *SubscriptionGroupCustomer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupCustomer object to a map representation for JSON marshaling. func (s *SubscriptionGroupCustomer) toMap() map[string]any { - structMap := make(map[string]any) - if s.FirstName != nil { - structMap["first_name"] = s.FirstName - } - if s.LastName != nil { - structMap["last_name"] = s.LastName - } - if s.Organization != nil { - structMap["organization"] = s.Organization - } - if s.Email != nil { - structMap["email"] = s.Email - } - if s.Reference != nil { - structMap["reference"] = s.Reference - } - return structMap + structMap := make(map[string]any) + if s.FirstName != nil { + structMap["first_name"] = s.FirstName + } + if s.LastName != nil { + structMap["last_name"] = s.LastName + } + if s.Organization != nil { + structMap["organization"] = s.Organization + } + if s.Email != nil { + structMap["email"] = s.Email + } + if s.Reference != nil { + structMap["reference"] = s.Reference + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCustomer. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCustomer. // It customizes the JSON unmarshaling process for SubscriptionGroupCustomer objects. func (s *SubscriptionGroupCustomer) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Organization *string `json:"organization,omitempty"` - Email *string `json:"email,omitempty"` - Reference *string `json:"reference,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.FirstName = temp.FirstName - s.LastName = temp.LastName - s.Organization = temp.Organization - s.Email = temp.Email - s.Reference = temp.Reference - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Organization *string `json:"organization,omitempty"` + Email *string `json:"email,omitempty"` + Reference *string `json:"reference,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.FirstName = temp.FirstName + s.LastName = temp.LastName + s.Organization = temp.Organization + s.Email = temp.Email + s.Reference = temp.Reference + return nil } diff --git a/models/subscription_group_item.go b/models/subscription_group_item.go index bd043b9f..6e33993d 100644 --- a/models/subscription_group_item.go +++ b/models/subscription_group_item.go @@ -1,96 +1,96 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupItem represents a SubscriptionGroupItem struct. type SubscriptionGroupItem struct { - Id *int `json:"id,omitempty"` - Reference Optional[string] `json:"reference"` - ProductId *int `json:"product_id,omitempty"` - ProductHandle Optional[string] `json:"product_handle"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Currency *string `json:"currency,omitempty"` - CouponCode Optional[string] `json:"coupon_code"` - TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` - BalanceInCents *int64 `json:"balance_in_cents,omitempty"` + Id *int `json:"id,omitempty"` + Reference Optional[string] `json:"reference"` + ProductId *int `json:"product_id,omitempty"` + ProductHandle Optional[string] `json:"product_handle"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Currency *string `json:"currency,omitempty"` + CouponCode Optional[string] `json:"coupon_code"` + TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` + BalanceInCents *int64 `json:"balance_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupItem. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupItem. // It customizes the JSON marshaling process for SubscriptionGroupItem objects. func (s *SubscriptionGroupItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupItem object to a map representation for JSON marshaling. func (s *SubscriptionGroupItem) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.Reference.IsValueSet() { - structMap["reference"] = s.Reference.Value() - } - if s.ProductId != nil { - structMap["product_id"] = s.ProductId - } - if s.ProductHandle.IsValueSet() { - structMap["product_handle"] = s.ProductHandle.Value() - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.ProductPricePointHandle != nil { - structMap["product_price_point_handle"] = s.ProductPricePointHandle - } - if s.Currency != nil { - structMap["currency"] = s.Currency - } - if s.CouponCode.IsValueSet() { - structMap["coupon_code"] = s.CouponCode.Value() - } - if s.TotalRevenueInCents != nil { - structMap["total_revenue_in_cents"] = s.TotalRevenueInCents - } - if s.BalanceInCents != nil { - structMap["balance_in_cents"] = s.BalanceInCents - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.Reference.IsValueSet() { + structMap["reference"] = s.Reference.Value() + } + if s.ProductId != nil { + structMap["product_id"] = s.ProductId + } + if s.ProductHandle.IsValueSet() { + structMap["product_handle"] = s.ProductHandle.Value() + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.ProductPricePointHandle != nil { + structMap["product_price_point_handle"] = s.ProductPricePointHandle + } + if s.Currency != nil { + structMap["currency"] = s.Currency + } + if s.CouponCode.IsValueSet() { + structMap["coupon_code"] = s.CouponCode.Value() + } + if s.TotalRevenueInCents != nil { + structMap["total_revenue_in_cents"] = s.TotalRevenueInCents + } + if s.BalanceInCents != nil { + structMap["balance_in_cents"] = s.BalanceInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupItem. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupItem. // It customizes the JSON unmarshaling process for SubscriptionGroupItem objects. func (s *SubscriptionGroupItem) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Reference Optional[string] `json:"reference"` - ProductId *int `json:"product_id,omitempty"` - ProductHandle Optional[string] `json:"product_handle"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Currency *string `json:"currency,omitempty"` - CouponCode Optional[string] `json:"coupon_code"` - TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` - BalanceInCents *int64 `json:"balance_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.Reference = temp.Reference - s.ProductId = temp.ProductId - s.ProductHandle = temp.ProductHandle - s.ProductPricePointId = temp.ProductPricePointId - s.ProductPricePointHandle = temp.ProductPricePointHandle - s.Currency = temp.Currency - s.CouponCode = temp.CouponCode - s.TotalRevenueInCents = temp.TotalRevenueInCents - s.BalanceInCents = temp.BalanceInCents - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Reference Optional[string] `json:"reference"` + ProductId *int `json:"product_id,omitempty"` + ProductHandle Optional[string] `json:"product_handle"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Currency *string `json:"currency,omitempty"` + CouponCode Optional[string] `json:"coupon_code"` + TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"` + BalanceInCents *int64 `json:"balance_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.Reference = temp.Reference + s.ProductId = temp.ProductId + s.ProductHandle = temp.ProductHandle + s.ProductPricePointId = temp.ProductPricePointId + s.ProductPricePointHandle = temp.ProductPricePointHandle + s.Currency = temp.Currency + s.CouponCode = temp.CouponCode + s.TotalRevenueInCents = temp.TotalRevenueInCents + s.BalanceInCents = temp.BalanceInCents + return nil } diff --git a/models/subscription_group_member_error.go b/models/subscription_group_member_error.go index 2740ea13..e475d2ba 100644 --- a/models/subscription_group_member_error.go +++ b/models/subscription_group_member_error.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupMemberError represents a SubscriptionGroupMemberError struct. type SubscriptionGroupMemberError struct { - Id *int `json:"id,omitempty"` - Type *string `json:"type,omitempty"` - Message *string `json:"message,omitempty"` + Id *int `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Message *string `json:"message,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupMemberError. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupMemberError. // It customizes the JSON marshaling process for SubscriptionGroupMemberError objects. func (s *SubscriptionGroupMemberError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupMemberError object to a map representation for JSON marshaling. func (s *SubscriptionGroupMemberError) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.Type != nil { - structMap["type"] = s.Type - } - if s.Message != nil { - structMap["message"] = s.Message - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.Type != nil { + structMap["type"] = s.Type + } + if s.Message != nil { + structMap["message"] = s.Message + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupMemberError. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupMemberError. // It customizes the JSON unmarshaling process for SubscriptionGroupMemberError objects. func (s *SubscriptionGroupMemberError) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Type *string `json:"type,omitempty"` - Message *string `json:"message,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.Type = temp.Type - s.Message = temp.Message - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Message *string `json:"message,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.Type = temp.Type + s.Message = temp.Message + return nil } diff --git a/models/subscription_group_payment_profile.go b/models/subscription_group_payment_profile.go index ead040f9..88632afd 100644 --- a/models/subscription_group_payment_profile.go +++ b/models/subscription_group_payment_profile.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupPaymentProfile represents a SubscriptionGroupPaymentProfile struct. type SubscriptionGroupPaymentProfile struct { - Id *int `json:"id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` + Id *int `json:"id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPaymentProfile. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPaymentProfile. // It customizes the JSON marshaling process for SubscriptionGroupPaymentProfile objects. func (s *SubscriptionGroupPaymentProfile) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupPaymentProfile object to a map representation for JSON marshaling. func (s *SubscriptionGroupPaymentProfile) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.FirstName != nil { - structMap["first_name"] = s.FirstName - } - if s.LastName != nil { - structMap["last_name"] = s.LastName - } - if s.MaskedCardNumber != nil { - structMap["masked_card_number"] = s.MaskedCardNumber - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.FirstName != nil { + structMap["first_name"] = s.FirstName + } + if s.LastName != nil { + structMap["last_name"] = s.LastName + } + if s.MaskedCardNumber != nil { + structMap["masked_card_number"] = s.MaskedCardNumber + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPaymentProfile. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPaymentProfile. // It customizes the JSON unmarshaling process for SubscriptionGroupPaymentProfile objects. func (s *SubscriptionGroupPaymentProfile) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - MaskedCardNumber *string `json:"masked_card_number,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.FirstName = temp.FirstName - s.LastName = temp.LastName - s.MaskedCardNumber = temp.MaskedCardNumber - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaskedCardNumber *string `json:"masked_card_number,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.FirstName = temp.FirstName + s.LastName = temp.LastName + s.MaskedCardNumber = temp.MaskedCardNumber + return nil } diff --git a/models/subscription_group_prepayment.go b/models/subscription_group_prepayment.go index 046a0663..fc2e8c0b 100644 --- a/models/subscription_group_prepayment.go +++ b/models/subscription_group_prepayment.go @@ -1,52 +1,52 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupPrepayment represents a SubscriptionGroupPrepayment struct. type SubscriptionGroupPrepayment struct { - Amount int `json:"amount"` - Details string `json:"details"` - Memo string `json:"memo"` - Method SubscriptionGroupPrepaymentMethod `json:"method"` + Amount int `json:"amount"` + Details string `json:"details"` + Memo string `json:"memo"` + Method SubscriptionGroupPrepaymentMethod `json:"method"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepayment. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepayment. // It customizes the JSON marshaling process for SubscriptionGroupPrepayment objects. func (s *SubscriptionGroupPrepayment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupPrepayment object to a map representation for JSON marshaling. func (s *SubscriptionGroupPrepayment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["amount"] = s.Amount - structMap["details"] = s.Details - structMap["memo"] = s.Memo - structMap["method"] = s.Method - return structMap + structMap := make(map[string]any) + structMap["amount"] = s.Amount + structMap["details"] = s.Details + structMap["memo"] = s.Memo + structMap["method"] = s.Method + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepayment. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepayment. // It customizes the JSON unmarshaling process for SubscriptionGroupPrepayment objects. func (s *SubscriptionGroupPrepayment) UnmarshalJSON(input []byte) error { - temp := &struct { - Amount int `json:"amount"` - Details string `json:"details"` - Memo string `json:"memo"` - Method SubscriptionGroupPrepaymentMethod `json:"method"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Amount = temp.Amount - s.Details = temp.Details - s.Memo = temp.Memo - s.Method = temp.Method - return nil + temp := &struct { + Amount int `json:"amount"` + Details string `json:"details"` + Memo string `json:"memo"` + Method SubscriptionGroupPrepaymentMethod `json:"method"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Amount = temp.Amount + s.Details = temp.Details + s.Memo = temp.Memo + s.Method = temp.Method + return nil } diff --git a/models/subscription_group_prepayment_request.go b/models/subscription_group_prepayment_request.go index 2d2c7ba4..061f0959 100644 --- a/models/subscription_group_prepayment_request.go +++ b/models/subscription_group_prepayment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupPrepaymentRequest represents a SubscriptionGroupPrepaymentRequest struct. type SubscriptionGroupPrepaymentRequest struct { - Prepayment SubscriptionGroupPrepayment `json:"prepayment"` + Prepayment SubscriptionGroupPrepayment `json:"prepayment"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentRequest. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentRequest. // It customizes the JSON marshaling process for SubscriptionGroupPrepaymentRequest objects. func (s *SubscriptionGroupPrepaymentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupPrepaymentRequest object to a map representation for JSON marshaling. func (s *SubscriptionGroupPrepaymentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepayment"] = s.Prepayment - return structMap + structMap := make(map[string]any) + structMap["prepayment"] = s.Prepayment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentRequest. // It customizes the JSON unmarshaling process for SubscriptionGroupPrepaymentRequest objects. func (s *SubscriptionGroupPrepaymentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Prepayment SubscriptionGroupPrepayment `json:"prepayment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Prepayment = temp.Prepayment - return nil + temp := &struct { + Prepayment SubscriptionGroupPrepayment `json:"prepayment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Prepayment = temp.Prepayment + return nil } diff --git a/models/subscription_group_prepayment_response.go b/models/subscription_group_prepayment_response.go index 20f14227..1d76b871 100644 --- a/models/subscription_group_prepayment_response.go +++ b/models/subscription_group_prepayment_response.go @@ -1,70 +1,70 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupPrepaymentResponse represents a SubscriptionGroupPrepaymentResponse struct. type SubscriptionGroupPrepaymentResponse struct { - Id *int `json:"id,omitempty"` - // The amount in cents of the entry. - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - // The ending balance in cents of the account. - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` - // The type of entry - EntryType *ServiceCreditType `json:"entry_type,omitempty"` - // A memo attached to the entry. - Memo *string `json:"memo,omitempty"` + Id *int `json:"id,omitempty"` + // The amount in cents of the entry. + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + // The ending balance in cents of the account. + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + // The type of entry + EntryType *ServiceCreditType `json:"entry_type,omitempty"` + // A memo attached to the entry. + Memo *string `json:"memo,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentResponse. // It customizes the JSON marshaling process for SubscriptionGroupPrepaymentResponse objects. func (s *SubscriptionGroupPrepaymentResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupPrepaymentResponse object to a map representation for JSON marshaling. func (s *SubscriptionGroupPrepaymentResponse) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.AmountInCents != nil { - structMap["amount_in_cents"] = s.AmountInCents - } - if s.EndingBalanceInCents != nil { - structMap["ending_balance_in_cents"] = s.EndingBalanceInCents - } - if s.EntryType != nil { - structMap["entry_type"] = s.EntryType - } - if s.Memo != nil { - structMap["memo"] = s.Memo - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.AmountInCents != nil { + structMap["amount_in_cents"] = s.AmountInCents + } + if s.EndingBalanceInCents != nil { + structMap["ending_balance_in_cents"] = s.EndingBalanceInCents + } + if s.EntryType != nil { + structMap["entry_type"] = s.EntryType + } + if s.Memo != nil { + structMap["memo"] = s.Memo + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentResponse. // It customizes the JSON unmarshaling process for SubscriptionGroupPrepaymentResponse objects. func (s *SubscriptionGroupPrepaymentResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - AmountInCents *int64 `json:"amount_in_cents,omitempty"` - EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` - EntryType *ServiceCreditType `json:"entry_type,omitempty"` - Memo *string `json:"memo,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.AmountInCents = temp.AmountInCents - s.EndingBalanceInCents = temp.EndingBalanceInCents - s.EntryType = temp.EntryType - s.Memo = temp.Memo - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + AmountInCents *int64 `json:"amount_in_cents,omitempty"` + EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"` + EntryType *ServiceCreditType `json:"entry_type,omitempty"` + Memo *string `json:"memo,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.AmountInCents = temp.AmountInCents + s.EndingBalanceInCents = temp.EndingBalanceInCents + s.EntryType = temp.EntryType + s.Memo = temp.Memo + return nil } diff --git a/models/subscription_group_response.go b/models/subscription_group_response.go index ef883a4f..feae7c03 100644 --- a/models/subscription_group_response.go +++ b/models/subscription_group_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupResponse represents a SubscriptionGroupResponse struct. type SubscriptionGroupResponse struct { - SubscriptionGroup SubscriptionGroup `json:"subscription_group"` + SubscriptionGroup SubscriptionGroup `json:"subscription_group"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupResponse. // It customizes the JSON marshaling process for SubscriptionGroupResponse objects. func (s *SubscriptionGroupResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupResponse object to a map representation for JSON marshaling. func (s *SubscriptionGroupResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_group"] = s.SubscriptionGroup - return structMap + structMap := make(map[string]any) + structMap["subscription_group"] = s.SubscriptionGroup.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupResponse. // It customizes the JSON unmarshaling process for SubscriptionGroupResponse objects. func (s *SubscriptionGroupResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionGroup SubscriptionGroup `json:"subscription_group"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SubscriptionGroup = temp.SubscriptionGroup - return nil + temp := &struct { + SubscriptionGroup SubscriptionGroup `json:"subscription_group"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SubscriptionGroup = temp.SubscriptionGroup + return nil } diff --git a/models/subscription_group_signup.go b/models/subscription_group_signup.go index fdbbe187..90245690 100644 --- a/models/subscription_group_signup.go +++ b/models/subscription_group_signup.go @@ -1,83 +1,83 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignup represents a SubscriptionGroupSignup struct. type SubscriptionGroupSignup struct { - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - PayerId *int `json:"payer_id,omitempty"` - PayerReference *string `json:"payer_reference,omitempty"` - // 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`. - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - PayerAttributes *PayerAttributes `json:"payer_attributes,omitempty"` - CreditCardAttributes *SubscriptionGroupCreditCard `json:"credit_card_attributes,omitempty"` - BankAccountAttributes *SubscriptionGroupBankAccount `json:"bank_account_attributes,omitempty"` - Subscriptions []SubscriptionGroupSignupItem `json:"subscriptions"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + PayerId *int `json:"payer_id,omitempty"` + PayerReference *string `json:"payer_reference,omitempty"` + // 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`. + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + PayerAttributes *PayerAttributes `json:"payer_attributes,omitempty"` + CreditCardAttributes *SubscriptionGroupCreditCard `json:"credit_card_attributes,omitempty"` + BankAccountAttributes *SubscriptionGroupBankAccount `json:"bank_account_attributes,omitempty"` + Subscriptions []SubscriptionGroupSignupItem `json:"subscriptions"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignup. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignup. // It customizes the JSON marshaling process for SubscriptionGroupSignup objects. func (s *SubscriptionGroupSignup) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignup object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignup) toMap() map[string]any { - structMap := make(map[string]any) - if s.PaymentProfileId != nil { - structMap["payment_profile_id"] = s.PaymentProfileId - } - if s.PayerId != nil { - structMap["payer_id"] = s.PayerId - } - if s.PayerReference != nil { - structMap["payer_reference"] = s.PayerReference - } - if s.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = s.PaymentCollectionMethod - } - if s.PayerAttributes != nil { - structMap["payer_attributes"] = s.PayerAttributes - } - if s.CreditCardAttributes != nil { - structMap["credit_card_attributes"] = s.CreditCardAttributes - } - if s.BankAccountAttributes != nil { - structMap["bank_account_attributes"] = s.BankAccountAttributes - } - structMap["subscriptions"] = s.Subscriptions - return structMap + structMap := make(map[string]any) + if s.PaymentProfileId != nil { + structMap["payment_profile_id"] = s.PaymentProfileId + } + if s.PayerId != nil { + structMap["payer_id"] = s.PayerId + } + if s.PayerReference != nil { + structMap["payer_reference"] = s.PayerReference + } + if s.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = s.PaymentCollectionMethod + } + if s.PayerAttributes != nil { + structMap["payer_attributes"] = s.PayerAttributes.toMap() + } + if s.CreditCardAttributes != nil { + structMap["credit_card_attributes"] = s.CreditCardAttributes.toMap() + } + if s.BankAccountAttributes != nil { + structMap["bank_account_attributes"] = s.BankAccountAttributes.toMap() + } + structMap["subscriptions"] = s.Subscriptions + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignup. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignup. // It customizes the JSON unmarshaling process for SubscriptionGroupSignup objects. func (s *SubscriptionGroupSignup) UnmarshalJSON(input []byte) error { - temp := &struct { - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - PayerId *int `json:"payer_id,omitempty"` - PayerReference *string `json:"payer_reference,omitempty"` - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - PayerAttributes *PayerAttributes `json:"payer_attributes,omitempty"` - CreditCardAttributes *SubscriptionGroupCreditCard `json:"credit_card_attributes,omitempty"` - BankAccountAttributes *SubscriptionGroupBankAccount `json:"bank_account_attributes,omitempty"` - Subscriptions []SubscriptionGroupSignupItem `json:"subscriptions"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.PaymentProfileId = temp.PaymentProfileId - s.PayerId = temp.PayerId - s.PayerReference = temp.PayerReference - s.PaymentCollectionMethod = temp.PaymentCollectionMethod - s.PayerAttributes = temp.PayerAttributes - s.CreditCardAttributes = temp.CreditCardAttributes - s.BankAccountAttributes = temp.BankAccountAttributes - s.Subscriptions = temp.Subscriptions - return nil + temp := &struct { + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + PayerId *int `json:"payer_id,omitempty"` + PayerReference *string `json:"payer_reference,omitempty"` + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + PayerAttributes *PayerAttributes `json:"payer_attributes,omitempty"` + CreditCardAttributes *SubscriptionGroupCreditCard `json:"credit_card_attributes,omitempty"` + BankAccountAttributes *SubscriptionGroupBankAccount `json:"bank_account_attributes,omitempty"` + Subscriptions []SubscriptionGroupSignupItem `json:"subscriptions"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.PaymentProfileId = temp.PaymentProfileId + s.PayerId = temp.PayerId + s.PayerReference = temp.PayerReference + s.PaymentCollectionMethod = temp.PaymentCollectionMethod + s.PayerAttributes = temp.PayerAttributes + s.CreditCardAttributes = temp.CreditCardAttributes + s.BankAccountAttributes = temp.BankAccountAttributes + s.Subscriptions = temp.Subscriptions + return nil } diff --git a/models/subscription_group_signup_component.go b/models/subscription_group_signup_component.go index cd2acb30..d30a4fd3 100644 --- a/models/subscription_group_signup_component.go +++ b/models/subscription_group_signup_component.go @@ -1,68 +1,68 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignupComponent represents a SubscriptionGroupSignupComponent struct. type SubscriptionGroupSignupComponent struct { - // Required if passing any component to `components` attribute. - ComponentId *interface{} `json:"component_id,omitempty"` - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - UnitBalance *interface{} `json:"unit_balance,omitempty"` - PricePointId *interface{} `json:"price_point_id,omitempty"` - // Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. - CustomPrice *SubscriptionGroupComponentCustomPrice `json:"custom_price,omitempty"` + // Required if passing any component to `components` attribute. + ComponentId *interface{} `json:"component_id,omitempty"` + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + UnitBalance *interface{} `json:"unit_balance,omitempty"` + PricePointId *interface{} `json:"price_point_id,omitempty"` + // Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. + CustomPrice *SubscriptionGroupComponentCustomPrice `json:"custom_price,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupComponent. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupComponent. // It customizes the JSON marshaling process for SubscriptionGroupSignupComponent objects. func (s *SubscriptionGroupSignupComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignupComponent object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignupComponent) toMap() map[string]any { - structMap := make(map[string]any) - if s.ComponentId != nil { - structMap["component_id"] = s.ComponentId - } - if s.AllocatedQuantity != nil { - structMap["allocated_quantity"] = s.AllocatedQuantity - } - if s.UnitBalance != nil { - structMap["unit_balance"] = s.UnitBalance - } - if s.PricePointId != nil { - structMap["price_point_id"] = s.PricePointId - } - if s.CustomPrice != nil { - structMap["custom_price"] = s.CustomPrice - } - return structMap + structMap := make(map[string]any) + if s.ComponentId != nil { + structMap["component_id"] = s.ComponentId + } + if s.AllocatedQuantity != nil { + structMap["allocated_quantity"] = s.AllocatedQuantity + } + if s.UnitBalance != nil { + structMap["unit_balance"] = s.UnitBalance + } + if s.PricePointId != nil { + structMap["price_point_id"] = s.PricePointId + } + if s.CustomPrice != nil { + structMap["custom_price"] = s.CustomPrice.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupComponent. // It customizes the JSON unmarshaling process for SubscriptionGroupSignupComponent objects. func (s *SubscriptionGroupSignupComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *interface{} `json:"component_id,omitempty"` - AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` - UnitBalance *interface{} `json:"unit_balance,omitempty"` - PricePointId *interface{} `json:"price_point_id,omitempty"` - CustomPrice *SubscriptionGroupComponentCustomPrice `json:"custom_price,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ComponentId = temp.ComponentId - s.AllocatedQuantity = temp.AllocatedQuantity - s.UnitBalance = temp.UnitBalance - s.PricePointId = temp.PricePointId - s.CustomPrice = temp.CustomPrice - return nil + temp := &struct { + ComponentId *interface{} `json:"component_id,omitempty"` + AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"` + UnitBalance *interface{} `json:"unit_balance,omitempty"` + PricePointId *interface{} `json:"price_point_id,omitempty"` + CustomPrice *SubscriptionGroupComponentCustomPrice `json:"custom_price,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ComponentId = temp.ComponentId + s.AllocatedQuantity = temp.AllocatedQuantity + s.UnitBalance = temp.UnitBalance + s.PricePointId = temp.PricePointId + s.CustomPrice = temp.CustomPrice + return nil } diff --git a/models/subscription_group_signup_error.go b/models/subscription_group_signup_error.go index e72f34da..3c692567 100644 --- a/models/subscription_group_signup_error.go +++ b/models/subscription_group_signup_error.go @@ -1,73 +1,73 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignupError represents a SubscriptionGroupSignupError struct. type SubscriptionGroupSignupError struct { - // Object that as key have subscription position in request subscriptions array and as value subscription errors object. - Subscriptions map[string]SubscriptionGroupSubscriptionError `json:"subscriptions,omitempty"` - PayerReference *string `json:"payer_reference,omitempty"` - Payer *PayerError `json:"payer,omitempty"` - SubscriptionGroup []string `json:"subscription_group,omitempty"` - PaymentProfileId *string `json:"payment_profile_id,omitempty"` - PayerId *string `json:"payer_id,omitempty"` + // Object that as key have subscription position in request subscriptions array and as value subscription errors object. + Subscriptions map[string]SubscriptionGroupSubscriptionError `json:"subscriptions,omitempty"` + PayerReference *string `json:"payer_reference,omitempty"` + Payer *PayerError `json:"payer,omitempty"` + SubscriptionGroup []string `json:"subscription_group,omitempty"` + PaymentProfileId *string `json:"payment_profile_id,omitempty"` + PayerId *string `json:"payer_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupError. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupError. // It customizes the JSON marshaling process for SubscriptionGroupSignupError objects. func (s *SubscriptionGroupSignupError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignupError object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignupError) toMap() map[string]any { - structMap := make(map[string]any) - if s.Subscriptions != nil { - structMap["subscriptions"] = s.Subscriptions - } - if s.PayerReference != nil { - structMap["payer_reference"] = s.PayerReference - } - if s.Payer != nil { - structMap["payer"] = s.Payer - } - if s.SubscriptionGroup != nil { - structMap["subscription_group"] = s.SubscriptionGroup - } - if s.PaymentProfileId != nil { - structMap["payment_profile_id"] = s.PaymentProfileId - } - if s.PayerId != nil { - structMap["payer_id"] = s.PayerId - } - return structMap + structMap := make(map[string]any) + if s.Subscriptions != nil { + structMap["subscriptions"] = s.Subscriptions + } + if s.PayerReference != nil { + structMap["payer_reference"] = s.PayerReference + } + if s.Payer != nil { + structMap["payer"] = s.Payer.toMap() + } + if s.SubscriptionGroup != nil { + structMap["subscription_group"] = s.SubscriptionGroup + } + if s.PaymentProfileId != nil { + structMap["payment_profile_id"] = s.PaymentProfileId + } + if s.PayerId != nil { + structMap["payer_id"] = s.PayerId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupError. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupError. // It customizes the JSON unmarshaling process for SubscriptionGroupSignupError objects. func (s *SubscriptionGroupSignupError) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscriptions map[string]SubscriptionGroupSubscriptionError `json:"subscriptions,omitempty"` - PayerReference *string `json:"payer_reference,omitempty"` - Payer *PayerError `json:"payer,omitempty"` - SubscriptionGroup []string `json:"subscription_group,omitempty"` - PaymentProfileId *string `json:"payment_profile_id,omitempty"` - PayerId *string `json:"payer_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Subscriptions = temp.Subscriptions - s.PayerReference = temp.PayerReference - s.Payer = temp.Payer - s.SubscriptionGroup = temp.SubscriptionGroup - s.PaymentProfileId = temp.PaymentProfileId - s.PayerId = temp.PayerId - return nil + temp := &struct { + Subscriptions map[string]SubscriptionGroupSubscriptionError `json:"subscriptions,omitempty"` + PayerReference *string `json:"payer_reference,omitempty"` + Payer *PayerError `json:"payer,omitempty"` + SubscriptionGroup []string `json:"subscription_group,omitempty"` + PaymentProfileId *string `json:"payment_profile_id,omitempty"` + PayerId *string `json:"payer_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Subscriptions = temp.Subscriptions + s.PayerReference = temp.PayerReference + s.Payer = temp.Payer + s.SubscriptionGroup = temp.SubscriptionGroup + s.PaymentProfileId = temp.PaymentProfileId + s.PayerId = temp.PayerId + return nil } diff --git a/models/subscription_group_signup_item.go b/models/subscription_group_signup_item.go index e29206b7..2a6c5407 100644 --- a/models/subscription_group_signup_item.go +++ b/models/subscription_group_signup_item.go @@ -1,126 +1,126 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignupItem represents a SubscriptionGroupSignupItem struct. type SubscriptionGroupSignupItem struct { - // The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. - ProductHandle *string `json:"product_handle,omitempty"` - // The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. - ProductId *int `json:"product_id,omitempty"` - // The ID of the particular price point on the product. - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // The user-friendly API handle of a product's particular price point. - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - // 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:` - OfferId *int `json:"offer_id,omitempty"` - // The reference value (provided by your app) for the subscription itelf. - Reference *string `json:"reference,omitempty"` - // One of the subscriptions must be marked as primary in the group. - Primary *bool `json:"primary,omitempty"` - // (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. - Currency *string `json:"currency,omitempty"` - // An array for all the coupons attached to the subscription. - CouponCodes []string `json:"coupon_codes,omitempty"` - Components []SubscriptionGroupSignupComponent `json:"components,omitempty"` - // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - // (Optional). Cannot be used when also specifying next_billing_at - CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` - // (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. - Metafields map[string]string `json:"metafields,omitempty"` + // The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead. + ProductHandle *string `json:"product_handle,omitempty"` + // The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. + ProductId *int `json:"product_id,omitempty"` + // The ID of the particular price point on the product. + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // The user-friendly API handle of a product's particular price point. + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + // 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:` + OfferId *int `json:"offer_id,omitempty"` + // The reference value (provided by your app) for the subscription itelf. + Reference *string `json:"reference,omitempty"` + // One of the subscriptions must be marked as primary in the group. + Primary *bool `json:"primary,omitempty"` + // (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. + Currency *string `json:"currency,omitempty"` + // An array for all the coupons attached to the subscription. + CouponCodes []string `json:"coupon_codes,omitempty"` + Components []SubscriptionGroupSignupComponent `json:"components,omitempty"` + // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + // (Optional). Cannot be used when also specifying next_billing_at + CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` + // (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. + Metafields map[string]string `json:"metafields,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupItem. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupItem. // It customizes the JSON marshaling process for SubscriptionGroupSignupItem objects. func (s *SubscriptionGroupSignupItem) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignupItem object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignupItem) toMap() map[string]any { - structMap := make(map[string]any) - if s.ProductHandle != nil { - structMap["product_handle"] = s.ProductHandle - } - if s.ProductId != nil { - structMap["product_id"] = s.ProductId - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.ProductPricePointHandle != nil { - structMap["product_price_point_handle"] = s.ProductPricePointHandle - } - if s.OfferId != nil { - structMap["offer_id"] = s.OfferId - } - if s.Reference != nil { - structMap["reference"] = s.Reference - } - if s.Primary != nil { - structMap["primary"] = s.Primary - } - if s.Currency != nil { - structMap["currency"] = s.Currency - } - if s.CouponCodes != nil { - structMap["coupon_codes"] = s.CouponCodes - } - if s.Components != nil { - structMap["components"] = s.Components - } - if s.CustomPrice != nil { - structMap["custom_price"] = s.CustomPrice - } - if s.CalendarBilling != nil { - structMap["calendar_billing"] = s.CalendarBilling - } - if s.Metafields != nil { - structMap["metafields"] = s.Metafields - } - return structMap + structMap := make(map[string]any) + if s.ProductHandle != nil { + structMap["product_handle"] = s.ProductHandle + } + if s.ProductId != nil { + structMap["product_id"] = s.ProductId + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.ProductPricePointHandle != nil { + structMap["product_price_point_handle"] = s.ProductPricePointHandle + } + if s.OfferId != nil { + structMap["offer_id"] = s.OfferId + } + if s.Reference != nil { + structMap["reference"] = s.Reference + } + if s.Primary != nil { + structMap["primary"] = s.Primary + } + if s.Currency != nil { + structMap["currency"] = s.Currency + } + if s.CouponCodes != nil { + structMap["coupon_codes"] = s.CouponCodes + } + if s.Components != nil { + structMap["components"] = s.Components + } + if s.CustomPrice != nil { + structMap["custom_price"] = s.CustomPrice.toMap() + } + if s.CalendarBilling != nil { + structMap["calendar_billing"] = s.CalendarBilling.toMap() + } + if s.Metafields != nil { + structMap["metafields"] = s.Metafields + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupItem. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupItem. // It customizes the JSON unmarshaling process for SubscriptionGroupSignupItem objects. func (s *SubscriptionGroupSignupItem) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductHandle *string `json:"product_handle,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - OfferId *int `json:"offer_id,omitempty"` - Reference *string `json:"reference,omitempty"` - Primary *bool `json:"primary,omitempty"` - Currency *string `json:"currency,omitempty"` - CouponCodes []string `json:"coupon_codes,omitempty"` - Components []SubscriptionGroupSignupComponent `json:"components,omitempty"` - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` - Metafields map[string]string `json:"metafields,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ProductHandle = temp.ProductHandle - s.ProductId = temp.ProductId - s.ProductPricePointId = temp.ProductPricePointId - s.ProductPricePointHandle = temp.ProductPricePointHandle - s.OfferId = temp.OfferId - s.Reference = temp.Reference - s.Primary = temp.Primary - s.Currency = temp.Currency - s.CouponCodes = temp.CouponCodes - s.Components = temp.Components - s.CustomPrice = temp.CustomPrice - s.CalendarBilling = temp.CalendarBilling - s.Metafields = temp.Metafields - return nil + temp := &struct { + ProductHandle *string `json:"product_handle,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + OfferId *int `json:"offer_id,omitempty"` + Reference *string `json:"reference,omitempty"` + Primary *bool `json:"primary,omitempty"` + Currency *string `json:"currency,omitempty"` + CouponCodes []string `json:"coupon_codes,omitempty"` + Components []SubscriptionGroupSignupComponent `json:"components,omitempty"` + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"` + Metafields map[string]string `json:"metafields,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ProductHandle = temp.ProductHandle + s.ProductId = temp.ProductId + s.ProductPricePointId = temp.ProductPricePointId + s.ProductPricePointHandle = temp.ProductPricePointHandle + s.OfferId = temp.OfferId + s.Reference = temp.Reference + s.Primary = temp.Primary + s.Currency = temp.Currency + s.CouponCodes = temp.CouponCodes + s.Components = temp.Components + s.CustomPrice = temp.CustomPrice + s.CalendarBilling = temp.CalendarBilling + s.Metafields = temp.Metafields + return nil } diff --git a/models/subscription_group_signup_request.go b/models/subscription_group_signup_request.go index 7bd05ede..5be749f2 100644 --- a/models/subscription_group_signup_request.go +++ b/models/subscription_group_signup_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignupRequest represents a SubscriptionGroupSignupRequest struct. type SubscriptionGroupSignupRequest struct { - SubscriptionGroup SubscriptionGroupSignup `json:"subscription_group"` + SubscriptionGroup SubscriptionGroupSignup `json:"subscription_group"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupRequest. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupRequest. // It customizes the JSON marshaling process for SubscriptionGroupSignupRequest objects. func (s *SubscriptionGroupSignupRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignupRequest object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignupRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_group"] = s.SubscriptionGroup - return structMap + structMap := make(map[string]any) + structMap["subscription_group"] = s.SubscriptionGroup.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupRequest. // It customizes the JSON unmarshaling process for SubscriptionGroupSignupRequest objects. func (s *SubscriptionGroupSignupRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionGroup SubscriptionGroupSignup `json:"subscription_group"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SubscriptionGroup = temp.SubscriptionGroup - return nil + temp := &struct { + SubscriptionGroup SubscriptionGroupSignup `json:"subscription_group"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SubscriptionGroup = temp.SubscriptionGroup + return nil } diff --git a/models/subscription_group_signup_response.go b/models/subscription_group_signup_response.go index d580477a..1d88fd10 100644 --- a/models/subscription_group_signup_response.go +++ b/models/subscription_group_signup_response.go @@ -1,103 +1,103 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupSignupResponse represents a SubscriptionGroupSignupResponse struct. type SubscriptionGroupSignupResponse struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - Subscriptions []SubscriptionGroupItem `json:"subscriptions,omitempty"` - // 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`. - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + Subscriptions []SubscriptionGroupItem `json:"subscriptions,omitempty"` + // 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`. + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupResponse. // It customizes the JSON marshaling process for SubscriptionGroupSignupResponse objects. func (s *SubscriptionGroupSignupResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSignupResponse object to a map representation for JSON marshaling. func (s *SubscriptionGroupSignupResponse) toMap() map[string]any { - structMap := make(map[string]any) - if s.Uid != nil { - structMap["uid"] = s.Uid - } - if s.Scheme != nil { - structMap["scheme"] = s.Scheme - } - if s.CustomerId != nil { - structMap["customer_id"] = s.CustomerId - } - if s.PaymentProfileId != nil { - structMap["payment_profile_id"] = s.PaymentProfileId - } - if s.SubscriptionIds != nil { - structMap["subscription_ids"] = s.SubscriptionIds - } - if s.PrimarySubscriptionId != nil { - structMap["primary_subscription_id"] = s.PrimarySubscriptionId - } - if s.NextAssessmentAt != nil { - structMap["next_assessment_at"] = s.NextAssessmentAt - } - if s.State != nil { - structMap["state"] = s.State - } - if s.CancelAtEndOfPeriod != nil { - structMap["cancel_at_end_of_period"] = s.CancelAtEndOfPeriod - } - if s.Subscriptions != nil { - structMap["subscriptions"] = s.Subscriptions - } - if s.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = s.PaymentCollectionMethod - } - return structMap + structMap := make(map[string]any) + if s.Uid != nil { + structMap["uid"] = s.Uid + } + if s.Scheme != nil { + structMap["scheme"] = s.Scheme + } + if s.CustomerId != nil { + structMap["customer_id"] = s.CustomerId + } + if s.PaymentProfileId != nil { + structMap["payment_profile_id"] = s.PaymentProfileId + } + if s.SubscriptionIds != nil { + structMap["subscription_ids"] = s.SubscriptionIds + } + if s.PrimarySubscriptionId != nil { + structMap["primary_subscription_id"] = s.PrimarySubscriptionId + } + if s.NextAssessmentAt != nil { + structMap["next_assessment_at"] = s.NextAssessmentAt + } + if s.State != nil { + structMap["state"] = s.State + } + if s.CancelAtEndOfPeriod != nil { + structMap["cancel_at_end_of_period"] = s.CancelAtEndOfPeriod + } + if s.Subscriptions != nil { + structMap["subscriptions"] = s.Subscriptions + } + if s.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = s.PaymentCollectionMethod + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupResponse. // It customizes the JSON unmarshaling process for SubscriptionGroupSignupResponse objects. func (s *SubscriptionGroupSignupResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Uid *string `json:"uid,omitempty"` - Scheme *int `json:"scheme,omitempty"` - CustomerId *int `json:"customer_id,omitempty"` - PaymentProfileId *int `json:"payment_profile_id,omitempty"` - SubscriptionIds []int `json:"subscription_ids,omitempty"` - PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` - NextAssessmentAt *string `json:"next_assessment_at,omitempty"` - State *string `json:"state,omitempty"` - CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` - Subscriptions []SubscriptionGroupItem `json:"subscriptions,omitempty"` - PaymentCollectionMethod *PaymentCollectionMethod `json:"payment_collection_method,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Uid = temp.Uid - s.Scheme = temp.Scheme - s.CustomerId = temp.CustomerId - s.PaymentProfileId = temp.PaymentProfileId - s.SubscriptionIds = temp.SubscriptionIds - s.PrimarySubscriptionId = temp.PrimarySubscriptionId - s.NextAssessmentAt = temp.NextAssessmentAt - s.State = temp.State - s.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod - s.Subscriptions = temp.Subscriptions - s.PaymentCollectionMethod = temp.PaymentCollectionMethod - return nil + temp := &struct { + Uid *string `json:"uid,omitempty"` + Scheme *int `json:"scheme,omitempty"` + CustomerId *int `json:"customer_id,omitempty"` + PaymentProfileId *int `json:"payment_profile_id,omitempty"` + SubscriptionIds []int `json:"subscription_ids,omitempty"` + PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"` + NextAssessmentAt *string `json:"next_assessment_at,omitempty"` + State *string `json:"state,omitempty"` + CancelAtEndOfPeriod *bool `json:"cancel_at_end_of_period,omitempty"` + Subscriptions []SubscriptionGroupItem `json:"subscriptions,omitempty"` + PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Uid = temp.Uid + s.Scheme = temp.Scheme + s.CustomerId = temp.CustomerId + s.PaymentProfileId = temp.PaymentProfileId + s.SubscriptionIds = temp.SubscriptionIds + s.PrimarySubscriptionId = temp.PrimarySubscriptionId + s.NextAssessmentAt = temp.NextAssessmentAt + s.State = temp.State + s.CancelAtEndOfPeriod = temp.CancelAtEndOfPeriod + s.Subscriptions = temp.Subscriptions + s.PaymentCollectionMethod = temp.PaymentCollectionMethod + return nil } diff --git a/models/subscription_group_subscription_error.go b/models/subscription_group_subscription_error.go index 8583be13..dc7b7d29 100644 --- a/models/subscription_group_subscription_error.go +++ b/models/subscription_group_subscription_error.go @@ -1,61 +1,61 @@ package models import ( - "encoding/json" + "encoding/json" ) -// SubscriptionGroupSubscriptionError represents a SubscriptionGroupSubscriptionError struct. +// SubscriptionGroupSubscriptionError represents a SubscriptionGroupSubscriptionError struct. // Object which contains subscription errors. type SubscriptionGroupSubscriptionError struct { - Product []string `json:"product,omitempty"` - ProductPricePointId []string `json:"product_price_point_id,omitempty"` - PaymentProfile []string `json:"payment_profile,omitempty"` - PaymentProfileChargifyToken []string `json:"payment_profile.chargify_token,omitempty"` + Product []string `json:"product,omitempty"` + ProductPricePointId []string `json:"product_price_point_id,omitempty"` + PaymentProfile []string `json:"payment_profile,omitempty"` + PaymentProfileChargifyToken []string `json:"payment_profile.chargify_token,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSubscriptionError. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSubscriptionError. // It customizes the JSON marshaling process for SubscriptionGroupSubscriptionError objects. func (s *SubscriptionGroupSubscriptionError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupSubscriptionError object to a map representation for JSON marshaling. func (s *SubscriptionGroupSubscriptionError) toMap() map[string]any { - structMap := make(map[string]any) - if s.Product != nil { - structMap["product"] = s.Product - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.PaymentProfile != nil { - structMap["payment_profile"] = s.PaymentProfile - } - if s.PaymentProfileChargifyToken != nil { - structMap["payment_profile.chargify_token"] = s.PaymentProfileChargifyToken - } - return structMap + structMap := make(map[string]any) + if s.Product != nil { + structMap["product"] = s.Product + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.PaymentProfile != nil { + structMap["payment_profile"] = s.PaymentProfile + } + if s.PaymentProfileChargifyToken != nil { + structMap["payment_profile.chargify_token"] = s.PaymentProfileChargifyToken + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSubscriptionError. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSubscriptionError. // It customizes the JSON unmarshaling process for SubscriptionGroupSubscriptionError objects. func (s *SubscriptionGroupSubscriptionError) UnmarshalJSON(input []byte) error { - temp := &struct { - Product []string `json:"product,omitempty"` - ProductPricePointId []string `json:"product_price_point_id,omitempty"` - PaymentProfile []string `json:"payment_profile,omitempty"` - PaymentProfileChargifyToken []string `json:"payment_profile.chargify_token,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Product = temp.Product - s.ProductPricePointId = temp.ProductPricePointId - s.PaymentProfile = temp.PaymentProfile - s.PaymentProfileChargifyToken = temp.PaymentProfileChargifyToken - return nil + temp := &struct { + Product []string `json:"product,omitempty"` + ProductPricePointId []string `json:"product_price_point_id,omitempty"` + PaymentProfile []string `json:"payment_profile,omitempty"` + PaymentProfileChargifyToken []string `json:"payment_profile.chargify_token,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Product = temp.Product + s.ProductPricePointId = temp.ProductPricePointId + s.PaymentProfile = temp.PaymentProfile + s.PaymentProfileChargifyToken = temp.PaymentProfileChargifyToken + return nil } diff --git a/models/subscription_group_update_error.go b/models/subscription_group_update_error.go index 36e82ba8..f86a10e7 100644 --- a/models/subscription_group_update_error.go +++ b/models/subscription_group_update_error.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionGroupUpdateError represents a SubscriptionGroupUpdateError struct. type SubscriptionGroupUpdateError struct { - Members []SubscriptionGroupMemberError `json:"members,omitempty"` + Members []SubscriptionGroupMemberError `json:"members,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupUpdateError. +// MarshalJSON implements the json.Marshaler interface for SubscriptionGroupUpdateError. // It customizes the JSON marshaling process for SubscriptionGroupUpdateError objects. func (s *SubscriptionGroupUpdateError) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionGroupUpdateError object to a map representation for JSON marshaling. func (s *SubscriptionGroupUpdateError) toMap() map[string]any { - structMap := make(map[string]any) - if s.Members != nil { - structMap["members"] = s.Members - } - return structMap + structMap := make(map[string]any) + if s.Members != nil { + structMap["members"] = s.Members + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupUpdateError. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupUpdateError. // It customizes the JSON unmarshaling process for SubscriptionGroupUpdateError objects. func (s *SubscriptionGroupUpdateError) UnmarshalJSON(input []byte) error { - temp := &struct { - Members []SubscriptionGroupMemberError `json:"members,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Members = temp.Members - return nil + temp := &struct { + Members []SubscriptionGroupMemberError `json:"members,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Members = temp.Members + return nil } diff --git a/models/subscription_included_coupon.go b/models/subscription_included_coupon.go index b00f1afe..f370f10e 100644 --- a/models/subscription_included_coupon.go +++ b/models/subscription_included_coupon.go @@ -1,78 +1,78 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionIncludedCoupon represents a SubscriptionIncludedCoupon struct. type SubscriptionIncludedCoupon struct { - Code *string `json:"code,omitempty"` - UseCount *int `json:"use_count,omitempty"` - UsesAllowed *int `json:"uses_allowed,omitempty"` - ExpiresAt Optional[string] `json:"expires_at"` - Recurring *bool `json:"recurring,omitempty"` - AmountInCents Optional[int64] `json:"amount_in_cents"` - Percentage Optional[string] `json:"percentage"` + Code *string `json:"code,omitempty"` + UseCount *int `json:"use_count,omitempty"` + UsesAllowed *int `json:"uses_allowed,omitempty"` + ExpiresAt Optional[string] `json:"expires_at"` + Recurring *bool `json:"recurring,omitempty"` + AmountInCents Optional[int64] `json:"amount_in_cents"` + Percentage Optional[string] `json:"percentage"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionIncludedCoupon. +// MarshalJSON implements the json.Marshaler interface for SubscriptionIncludedCoupon. // It customizes the JSON marshaling process for SubscriptionIncludedCoupon objects. func (s *SubscriptionIncludedCoupon) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionIncludedCoupon object to a map representation for JSON marshaling. func (s *SubscriptionIncludedCoupon) toMap() map[string]any { - structMap := make(map[string]any) - if s.Code != nil { - structMap["code"] = s.Code - } - if s.UseCount != nil { - structMap["use_count"] = s.UseCount - } - if s.UsesAllowed != nil { - structMap["uses_allowed"] = s.UsesAllowed - } - if s.ExpiresAt.IsValueSet() { - structMap["expires_at"] = s.ExpiresAt.Value() - } - if s.Recurring != nil { - structMap["recurring"] = s.Recurring - } - if s.AmountInCents.IsValueSet() { - structMap["amount_in_cents"] = s.AmountInCents.Value() - } - if s.Percentage.IsValueSet() { - structMap["percentage"] = s.Percentage.Value() - } - return structMap + structMap := make(map[string]any) + if s.Code != nil { + structMap["code"] = s.Code + } + if s.UseCount != nil { + structMap["use_count"] = s.UseCount + } + if s.UsesAllowed != nil { + structMap["uses_allowed"] = s.UsesAllowed + } + if s.ExpiresAt.IsValueSet() { + structMap["expires_at"] = s.ExpiresAt.Value() + } + if s.Recurring != nil { + structMap["recurring"] = s.Recurring + } + if s.AmountInCents.IsValueSet() { + structMap["amount_in_cents"] = s.AmountInCents.Value() + } + if s.Percentage.IsValueSet() { + structMap["percentage"] = s.Percentage.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionIncludedCoupon. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionIncludedCoupon. // It customizes the JSON unmarshaling process for SubscriptionIncludedCoupon objects. func (s *SubscriptionIncludedCoupon) UnmarshalJSON(input []byte) error { - temp := &struct { - Code *string `json:"code,omitempty"` - UseCount *int `json:"use_count,omitempty"` - UsesAllowed *int `json:"uses_allowed,omitempty"` - ExpiresAt Optional[string] `json:"expires_at"` - Recurring *bool `json:"recurring,omitempty"` - AmountInCents Optional[int64] `json:"amount_in_cents"` - Percentage Optional[string] `json:"percentage"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Code = temp.Code - s.UseCount = temp.UseCount - s.UsesAllowed = temp.UsesAllowed - s.ExpiresAt = temp.ExpiresAt - s.Recurring = temp.Recurring - s.AmountInCents = temp.AmountInCents - s.Percentage = temp.Percentage - return nil + temp := &struct { + Code *string `json:"code,omitempty"` + UseCount *int `json:"use_count,omitempty"` + UsesAllowed *int `json:"uses_allowed,omitempty"` + ExpiresAt Optional[string] `json:"expires_at"` + Recurring *bool `json:"recurring,omitempty"` + AmountInCents Optional[int64] `json:"amount_in_cents"` + Percentage Optional[string] `json:"percentage"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Code = temp.Code + s.UseCount = temp.UseCount + s.UsesAllowed = temp.UsesAllowed + s.ExpiresAt = temp.ExpiresAt + s.Recurring = temp.Recurring + s.AmountInCents = temp.AmountInCents + s.Percentage = temp.Percentage + return nil } diff --git a/models/subscription_migration_preview.go b/models/subscription_migration_preview.go index f9259741..acb9c89c 100644 --- a/models/subscription_migration_preview.go +++ b/models/subscription_migration_preview.go @@ -1,64 +1,64 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMigrationPreview represents a SubscriptionMigrationPreview struct. type SubscriptionMigrationPreview struct { - // The amount of the prorated adjustment that would be issued for the current subscription. - ProratedAdjustmentInCents *int64 `json:"prorated_adjustment_in_cents,omitempty"` - // The amount of the charge that would be created for the new product. - ChargeInCents *int64 `json:"charge_in_cents,omitempty"` - // The amount of the payment due in the case of an upgrade. - PaymentDueInCents *int64 `json:"payment_due_in_cents,omitempty"` - // 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. - CreditAppliedInCents *int64 `json:"credit_applied_in_cents,omitempty"` + // The amount of the prorated adjustment that would be issued for the current subscription. + ProratedAdjustmentInCents *int64 `json:"prorated_adjustment_in_cents,omitempty"` + // The amount of the charge that would be created for the new product. + ChargeInCents *int64 `json:"charge_in_cents,omitempty"` + // The amount of the payment due in the case of an upgrade. + PaymentDueInCents *int64 `json:"payment_due_in_cents,omitempty"` + // 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. + CreditAppliedInCents *int64 `json:"credit_applied_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreview. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreview. // It customizes the JSON marshaling process for SubscriptionMigrationPreview objects. func (s *SubscriptionMigrationPreview) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMigrationPreview object to a map representation for JSON marshaling. func (s *SubscriptionMigrationPreview) toMap() map[string]any { - structMap := make(map[string]any) - if s.ProratedAdjustmentInCents != nil { - structMap["prorated_adjustment_in_cents"] = s.ProratedAdjustmentInCents - } - if s.ChargeInCents != nil { - structMap["charge_in_cents"] = s.ChargeInCents - } - if s.PaymentDueInCents != nil { - structMap["payment_due_in_cents"] = s.PaymentDueInCents - } - if s.CreditAppliedInCents != nil { - structMap["credit_applied_in_cents"] = s.CreditAppliedInCents - } - return structMap + structMap := make(map[string]any) + if s.ProratedAdjustmentInCents != nil { + structMap["prorated_adjustment_in_cents"] = s.ProratedAdjustmentInCents + } + if s.ChargeInCents != nil { + structMap["charge_in_cents"] = s.ChargeInCents + } + if s.PaymentDueInCents != nil { + structMap["payment_due_in_cents"] = s.PaymentDueInCents + } + if s.CreditAppliedInCents != nil { + structMap["credit_applied_in_cents"] = s.CreditAppliedInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreview. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreview. // It customizes the JSON unmarshaling process for SubscriptionMigrationPreview objects. func (s *SubscriptionMigrationPreview) UnmarshalJSON(input []byte) error { - temp := &struct { - ProratedAdjustmentInCents *int64 `json:"prorated_adjustment_in_cents,omitempty"` - ChargeInCents *int64 `json:"charge_in_cents,omitempty"` - PaymentDueInCents *int64 `json:"payment_due_in_cents,omitempty"` - CreditAppliedInCents *int64 `json:"credit_applied_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ProratedAdjustmentInCents = temp.ProratedAdjustmentInCents - s.ChargeInCents = temp.ChargeInCents - s.PaymentDueInCents = temp.PaymentDueInCents - s.CreditAppliedInCents = temp.CreditAppliedInCents - return nil + temp := &struct { + ProratedAdjustmentInCents *int64 `json:"prorated_adjustment_in_cents,omitempty"` + ChargeInCents *int64 `json:"charge_in_cents,omitempty"` + PaymentDueInCents *int64 `json:"payment_due_in_cents,omitempty"` + CreditAppliedInCents *int64 `json:"credit_applied_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ProratedAdjustmentInCents = temp.ProratedAdjustmentInCents + s.ChargeInCents = temp.ChargeInCents + s.PaymentDueInCents = temp.PaymentDueInCents + s.CreditAppliedInCents = temp.CreditAppliedInCents + return nil } diff --git a/models/subscription_migration_preview_options.go b/models/subscription_migration_preview_options.go index ecf8c0d6..bb2a5863 100644 --- a/models/subscription_migration_preview_options.go +++ b/models/subscription_migration_preview_options.go @@ -1,105 +1,105 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMigrationPreviewOptions represents a SubscriptionMigrationPreviewOptions struct. type SubscriptionMigrationPreviewOptions struct { - // The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. - ProductId *int `json:"product_id,omitempty"` - // The ID of the specified product's price point. This can be passed to migrate to a non-default price point. - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored. - IncludeTrial *bool `json:"include_trial,omitempty"` - // If `true` is sent initial charges will be assessed. - IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` - // If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate. - IncludeCoupons *bool `json:"include_coupons,omitempty"` - // If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product. - PreservePeriod *bool `json:"preserve_period,omitempty"` - // The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. - ProductHandle *string `json:"product_handle,omitempty"` - // The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Proration *Proration `json:"proration,omitempty"` - // The date that the proration is calculated from for the preview - ProrationDate *string `json:"proration_date,omitempty"` + // The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. + ProductId *int `json:"product_id,omitempty"` + // The ID of the specified product's price point. This can be passed to migrate to a non-default price point. + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored. + IncludeTrial *bool `json:"include_trial,omitempty"` + // If `true` is sent initial charges will be assessed. + IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` + // If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate. + IncludeCoupons *bool `json:"include_coupons,omitempty"` + // If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product. + PreservePeriod *bool `json:"preserve_period,omitempty"` + // The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. + ProductHandle *string `json:"product_handle,omitempty"` + // The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Proration *Proration `json:"proration,omitempty"` + // The date that the proration is calculated from for the preview + ProrationDate *string `json:"proration_date,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewOptions. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewOptions. // It customizes the JSON marshaling process for SubscriptionMigrationPreviewOptions objects. func (s *SubscriptionMigrationPreviewOptions) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMigrationPreviewOptions object to a map representation for JSON marshaling. func (s *SubscriptionMigrationPreviewOptions) toMap() map[string]any { - structMap := make(map[string]any) - if s.ProductId != nil { - structMap["product_id"] = s.ProductId - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.IncludeTrial != nil { - structMap["include_trial"] = s.IncludeTrial - } - if s.IncludeInitialCharge != nil { - structMap["include_initial_charge"] = s.IncludeInitialCharge - } - if s.IncludeCoupons != nil { - structMap["include_coupons"] = s.IncludeCoupons - } - if s.PreservePeriod != nil { - structMap["preserve_period"] = s.PreservePeriod - } - if s.ProductHandle != nil { - structMap["product_handle"] = s.ProductHandle - } - if s.ProductPricePointHandle != nil { - structMap["product_price_point_handle"] = s.ProductPricePointHandle - } - if s.Proration != nil { - structMap["proration"] = s.Proration - } - if s.ProrationDate != nil { - structMap["proration_date"] = s.ProrationDate - } - return structMap + structMap := make(map[string]any) + if s.ProductId != nil { + structMap["product_id"] = s.ProductId + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.IncludeTrial != nil { + structMap["include_trial"] = s.IncludeTrial + } + if s.IncludeInitialCharge != nil { + structMap["include_initial_charge"] = s.IncludeInitialCharge + } + if s.IncludeCoupons != nil { + structMap["include_coupons"] = s.IncludeCoupons + } + if s.PreservePeriod != nil { + structMap["preserve_period"] = s.PreservePeriod + } + if s.ProductHandle != nil { + structMap["product_handle"] = s.ProductHandle + } + if s.ProductPricePointHandle != nil { + structMap["product_price_point_handle"] = s.ProductPricePointHandle + } + if s.Proration != nil { + structMap["proration"] = s.Proration.toMap() + } + if s.ProrationDate != nil { + structMap["proration_date"] = s.ProrationDate + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewOptions. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewOptions. // It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewOptions objects. func (s *SubscriptionMigrationPreviewOptions) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductId *int `json:"product_id,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - IncludeTrial *bool `json:"include_trial,omitempty"` - IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` - IncludeCoupons *bool `json:"include_coupons,omitempty"` - PreservePeriod *bool `json:"preserve_period,omitempty"` - ProductHandle *string `json:"product_handle,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Proration *Proration `json:"proration,omitempty"` - ProrationDate *string `json:"proration_date,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ProductId = temp.ProductId - s.ProductPricePointId = temp.ProductPricePointId - s.IncludeTrial = temp.IncludeTrial - s.IncludeInitialCharge = temp.IncludeInitialCharge - s.IncludeCoupons = temp.IncludeCoupons - s.PreservePeriod = temp.PreservePeriod - s.ProductHandle = temp.ProductHandle - s.ProductPricePointHandle = temp.ProductPricePointHandle - s.Proration = temp.Proration - s.ProrationDate = temp.ProrationDate - return nil + temp := &struct { + ProductId *int `json:"product_id,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + IncludeTrial *bool `json:"include_trial,omitempty"` + IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` + IncludeCoupons *bool `json:"include_coupons,omitempty"` + PreservePeriod *bool `json:"preserve_period,omitempty"` + ProductHandle *string `json:"product_handle,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Proration *Proration `json:"proration,omitempty"` + ProrationDate *string `json:"proration_date,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ProductId = temp.ProductId + s.ProductPricePointId = temp.ProductPricePointId + s.IncludeTrial = temp.IncludeTrial + s.IncludeInitialCharge = temp.IncludeInitialCharge + s.IncludeCoupons = temp.IncludeCoupons + s.PreservePeriod = temp.PreservePeriod + s.ProductHandle = temp.ProductHandle + s.ProductPricePointHandle = temp.ProductPricePointHandle + s.Proration = temp.Proration + s.ProrationDate = temp.ProrationDate + return nil } diff --git a/models/subscription_migration_preview_request.go b/models/subscription_migration_preview_request.go index e3ef0b68..0816d1cc 100644 --- a/models/subscription_migration_preview_request.go +++ b/models/subscription_migration_preview_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMigrationPreviewRequest represents a SubscriptionMigrationPreviewRequest struct. type SubscriptionMigrationPreviewRequest struct { - Migration SubscriptionMigrationPreviewOptions `json:"migration"` + Migration SubscriptionMigrationPreviewOptions `json:"migration"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewRequest. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewRequest. // It customizes the JSON marshaling process for SubscriptionMigrationPreviewRequest objects. func (s *SubscriptionMigrationPreviewRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMigrationPreviewRequest object to a map representation for JSON marshaling. func (s *SubscriptionMigrationPreviewRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["migration"] = s.Migration - return structMap + structMap := make(map[string]any) + structMap["migration"] = s.Migration.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewRequest. // It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewRequest objects. func (s *SubscriptionMigrationPreviewRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Migration SubscriptionMigrationPreviewOptions `json:"migration"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Migration = temp.Migration - return nil + temp := &struct { + Migration SubscriptionMigrationPreviewOptions `json:"migration"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Migration = temp.Migration + return nil } diff --git a/models/subscription_migration_preview_response.go b/models/subscription_migration_preview_response.go index 7af95514..65521cee 100644 --- a/models/subscription_migration_preview_response.go +++ b/models/subscription_migration_preview_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMigrationPreviewResponse represents a SubscriptionMigrationPreviewResponse struct. type SubscriptionMigrationPreviewResponse struct { - Migration SubscriptionMigrationPreview `json:"migration"` + Migration SubscriptionMigrationPreview `json:"migration"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewResponse. // It customizes the JSON marshaling process for SubscriptionMigrationPreviewResponse objects. func (s *SubscriptionMigrationPreviewResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMigrationPreviewResponse object to a map representation for JSON marshaling. func (s *SubscriptionMigrationPreviewResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["migration"] = s.Migration - return structMap + structMap := make(map[string]any) + structMap["migration"] = s.Migration.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewResponse. // It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewResponse objects. func (s *SubscriptionMigrationPreviewResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Migration SubscriptionMigrationPreview `json:"migration"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Migration = temp.Migration - return nil + temp := &struct { + Migration SubscriptionMigrationPreview `json:"migration"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Migration = temp.Migration + return nil } diff --git a/models/subscription_mrr.go b/models/subscription_mrr.go index dae099db..f0f69772 100644 --- a/models/subscription_mrr.go +++ b/models/subscription_mrr.go @@ -1,50 +1,50 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMRR represents a SubscriptionMRR struct. type SubscriptionMRR struct { - SubscriptionId int `json:"subscription_id"` - MrrAmountInCents int64 `json:"mrr_amount_in_cents"` - Breakouts *SubscriptionMRRBreakout `json:"breakouts,omitempty"` + SubscriptionId int `json:"subscription_id"` + MrrAmountInCents int64 `json:"mrr_amount_in_cents"` + Breakouts *SubscriptionMRRBreakout `json:"breakouts,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMRR. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMRR. // It customizes the JSON marshaling process for SubscriptionMRR objects. func (s *SubscriptionMRR) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMRR object to a map representation for JSON marshaling. func (s *SubscriptionMRR) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_id"] = s.SubscriptionId - structMap["mrr_amount_in_cents"] = s.MrrAmountInCents - if s.Breakouts != nil { - structMap["breakouts"] = s.Breakouts - } - return structMap + structMap := make(map[string]any) + structMap["subscription_id"] = s.SubscriptionId + structMap["mrr_amount_in_cents"] = s.MrrAmountInCents + if s.Breakouts != nil { + structMap["breakouts"] = s.Breakouts.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRR. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRR. // It customizes the JSON unmarshaling process for SubscriptionMRR objects. func (s *SubscriptionMRR) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionId int `json:"subscription_id"` - MrrAmountInCents int64 `json:"mrr_amount_in_cents"` - Breakouts *SubscriptionMRRBreakout `json:"breakouts,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SubscriptionId = temp.SubscriptionId - s.MrrAmountInCents = temp.MrrAmountInCents - s.Breakouts = temp.Breakouts - return nil + temp := &struct { + SubscriptionId int `json:"subscription_id"` + MrrAmountInCents int64 `json:"mrr_amount_in_cents"` + Breakouts *SubscriptionMRRBreakout `json:"breakouts,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SubscriptionId = temp.SubscriptionId + s.MrrAmountInCents = temp.MrrAmountInCents + s.Breakouts = temp.Breakouts + return nil } diff --git a/models/subscription_mrr_breakout.go b/models/subscription_mrr_breakout.go index 6c5339eb..b96f6f6e 100644 --- a/models/subscription_mrr_breakout.go +++ b/models/subscription_mrr_breakout.go @@ -1,44 +1,44 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMRRBreakout represents a SubscriptionMRRBreakout struct. type SubscriptionMRRBreakout struct { - PlanAmountInCents int64 `json:"plan_amount_in_cents"` - UsageAmountInCents int64 `json:"usage_amount_in_cents"` + PlanAmountInCents int64 `json:"plan_amount_in_cents"` + UsageAmountInCents int64 `json:"usage_amount_in_cents"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMRRBreakout. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMRRBreakout. // It customizes the JSON marshaling process for SubscriptionMRRBreakout objects. func (s *SubscriptionMRRBreakout) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMRRBreakout object to a map representation for JSON marshaling. func (s *SubscriptionMRRBreakout) toMap() map[string]any { - structMap := make(map[string]any) - structMap["plan_amount_in_cents"] = s.PlanAmountInCents - structMap["usage_amount_in_cents"] = s.UsageAmountInCents - return structMap + structMap := make(map[string]any) + structMap["plan_amount_in_cents"] = s.PlanAmountInCents + structMap["usage_amount_in_cents"] = s.UsageAmountInCents + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRBreakout. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRBreakout. // It customizes the JSON unmarshaling process for SubscriptionMRRBreakout objects. func (s *SubscriptionMRRBreakout) UnmarshalJSON(input []byte) error { - temp := &struct { - PlanAmountInCents int64 `json:"plan_amount_in_cents"` - UsageAmountInCents int64 `json:"usage_amount_in_cents"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.PlanAmountInCents = temp.PlanAmountInCents - s.UsageAmountInCents = temp.UsageAmountInCents - return nil + temp := &struct { + PlanAmountInCents int64 `json:"plan_amount_in_cents"` + UsageAmountInCents int64 `json:"usage_amount_in_cents"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.PlanAmountInCents = temp.PlanAmountInCents + s.UsageAmountInCents = temp.UsageAmountInCents + return nil } diff --git a/models/subscription_mrr_response.go b/models/subscription_mrr_response.go index bc8a8049..8aaf444e 100644 --- a/models/subscription_mrr_response.go +++ b/models/subscription_mrr_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionMRRResponse represents a SubscriptionMRRResponse struct. type SubscriptionMRRResponse struct { - SubscriptionsMrr []SubscriptionMRR `json:"subscriptions_mrr"` + SubscriptionsMrr []SubscriptionMRR `json:"subscriptions_mrr"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionMRRResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionMRRResponse. // It customizes the JSON marshaling process for SubscriptionMRRResponse objects. func (s *SubscriptionMRRResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionMRRResponse object to a map representation for JSON marshaling. func (s *SubscriptionMRRResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscriptions_mrr"] = s.SubscriptionsMrr - return structMap + structMap := make(map[string]any) + structMap["subscriptions_mrr"] = s.SubscriptionsMrr + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRResponse. // It customizes the JSON unmarshaling process for SubscriptionMRRResponse objects. func (s *SubscriptionMRRResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionsMrr []SubscriptionMRR `json:"subscriptions_mrr"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SubscriptionsMrr = temp.SubscriptionsMrr - return nil + temp := &struct { + SubscriptionsMrr []SubscriptionMRR `json:"subscriptions_mrr"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SubscriptionsMrr = temp.SubscriptionsMrr + return nil } diff --git a/models/subscription_note.go b/models/subscription_note.go index d9d948f5..04c32d1b 100644 --- a/models/subscription_note.go +++ b/models/subscription_note.go @@ -1,72 +1,72 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionNote represents a SubscriptionNote struct. type SubscriptionNote struct { - Id *int `json:"id,omitempty"` - Body *string `json:"body,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - Sticky *bool `json:"sticky,omitempty"` + Id *int `json:"id,omitempty"` + Body *string `json:"body,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Sticky *bool `json:"sticky,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionNote. +// MarshalJSON implements the json.Marshaler interface for SubscriptionNote. // It customizes the JSON marshaling process for SubscriptionNote objects. func (s *SubscriptionNote) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionNote object to a map representation for JSON marshaling. func (s *SubscriptionNote) toMap() map[string]any { - structMap := make(map[string]any) - if s.Id != nil { - structMap["id"] = s.Id - } - if s.Body != nil { - structMap["body"] = s.Body - } - if s.SubscriptionId != nil { - structMap["subscription_id"] = s.SubscriptionId - } - if s.CreatedAt != nil { - structMap["created_at"] = s.CreatedAt - } - if s.UpdatedAt != nil { - structMap["updated_at"] = s.UpdatedAt - } - if s.Sticky != nil { - structMap["sticky"] = s.Sticky - } - return structMap + structMap := make(map[string]any) + if s.Id != nil { + structMap["id"] = s.Id + } + if s.Body != nil { + structMap["body"] = s.Body + } + if s.SubscriptionId != nil { + structMap["subscription_id"] = s.SubscriptionId + } + if s.CreatedAt != nil { + structMap["created_at"] = s.CreatedAt + } + if s.UpdatedAt != nil { + structMap["updated_at"] = s.UpdatedAt + } + if s.Sticky != nil { + structMap["sticky"] = s.Sticky + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNote. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNote. // It customizes the JSON unmarshaling process for SubscriptionNote objects. func (s *SubscriptionNote) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - Body *string `json:"body,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` - Sticky *bool `json:"sticky,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Id = temp.Id - s.Body = temp.Body - s.SubscriptionId = temp.SubscriptionId - s.CreatedAt = temp.CreatedAt - s.UpdatedAt = temp.UpdatedAt - s.Sticky = temp.Sticky - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + Body *string `json:"body,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Sticky *bool `json:"sticky,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Id = temp.Id + s.Body = temp.Body + s.SubscriptionId = temp.SubscriptionId + s.CreatedAt = temp.CreatedAt + s.UpdatedAt = temp.UpdatedAt + s.Sticky = temp.Sticky + return nil } diff --git a/models/subscription_note_response.go b/models/subscription_note_response.go index 2550a073..c560a43d 100644 --- a/models/subscription_note_response.go +++ b/models/subscription_note_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionNoteResponse represents a SubscriptionNoteResponse struct. type SubscriptionNoteResponse struct { - Note SubscriptionNote `json:"note"` + Note SubscriptionNote `json:"note"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionNoteResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionNoteResponse. // It customizes the JSON marshaling process for SubscriptionNoteResponse objects. func (s *SubscriptionNoteResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionNoteResponse object to a map representation for JSON marshaling. func (s *SubscriptionNoteResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["note"] = s.Note - return structMap + structMap := make(map[string]any) + structMap["note"] = s.Note.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNoteResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNoteResponse. // It customizes the JSON unmarshaling process for SubscriptionNoteResponse objects. func (s *SubscriptionNoteResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Note SubscriptionNote `json:"note"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Note = temp.Note - return nil + temp := &struct { + Note SubscriptionNote `json:"note"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Note = temp.Note + return nil } diff --git a/models/subscription_preview.go b/models/subscription_preview.go index 413ac411..1904aad0 100644 --- a/models/subscription_preview.go +++ b/models/subscription_preview.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionPreview represents a SubscriptionPreview struct. type SubscriptionPreview struct { - CurrentBillingManifest *BillingManifest `json:"current_billing_manifest,omitempty"` - NextBillingManifest *BillingManifest `json:"next_billing_manifest,omitempty"` + CurrentBillingManifest *BillingManifest `json:"current_billing_manifest,omitempty"` + NextBillingManifest *BillingManifest `json:"next_billing_manifest,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionPreview. +// MarshalJSON implements the json.Marshaler interface for SubscriptionPreview. // It customizes the JSON marshaling process for SubscriptionPreview objects. func (s *SubscriptionPreview) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionPreview object to a map representation for JSON marshaling. func (s *SubscriptionPreview) toMap() map[string]any { - structMap := make(map[string]any) - if s.CurrentBillingManifest != nil { - structMap["current_billing_manifest"] = s.CurrentBillingManifest - } - if s.NextBillingManifest != nil { - structMap["next_billing_manifest"] = s.NextBillingManifest - } - return structMap + structMap := make(map[string]any) + if s.CurrentBillingManifest != nil { + structMap["current_billing_manifest"] = s.CurrentBillingManifest.toMap() + } + if s.NextBillingManifest != nil { + structMap["next_billing_manifest"] = s.NextBillingManifest.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreview. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreview. // It customizes the JSON unmarshaling process for SubscriptionPreview objects. func (s *SubscriptionPreview) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrentBillingManifest *BillingManifest `json:"current_billing_manifest,omitempty"` - NextBillingManifest *BillingManifest `json:"next_billing_manifest,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.CurrentBillingManifest = temp.CurrentBillingManifest - s.NextBillingManifest = temp.NextBillingManifest - return nil + temp := &struct { + CurrentBillingManifest *BillingManifest `json:"current_billing_manifest,omitempty"` + NextBillingManifest *BillingManifest `json:"next_billing_manifest,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.CurrentBillingManifest = temp.CurrentBillingManifest + s.NextBillingManifest = temp.NextBillingManifest + return nil } diff --git a/models/subscription_preview_response.go b/models/subscription_preview_response.go index 397115b8..58619466 100644 --- a/models/subscription_preview_response.go +++ b/models/subscription_preview_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionPreviewResponse represents a SubscriptionPreviewResponse struct. type SubscriptionPreviewResponse struct { - SubscriptionPreview SubscriptionPreview `json:"subscription_preview"` + SubscriptionPreview SubscriptionPreview `json:"subscription_preview"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionPreviewResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionPreviewResponse. // It customizes the JSON marshaling process for SubscriptionPreviewResponse objects. func (s *SubscriptionPreviewResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionPreviewResponse object to a map representation for JSON marshaling. func (s *SubscriptionPreviewResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_preview"] = s.SubscriptionPreview - return structMap + structMap := make(map[string]any) + structMap["subscription_preview"] = s.SubscriptionPreview.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreviewResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreviewResponse. // It customizes the JSON unmarshaling process for SubscriptionPreviewResponse objects. func (s *SubscriptionPreviewResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionPreview SubscriptionPreview `json:"subscription_preview"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.SubscriptionPreview = temp.SubscriptionPreview - return nil + temp := &struct { + SubscriptionPreview SubscriptionPreview `json:"subscription_preview"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.SubscriptionPreview = temp.SubscriptionPreview + return nil } diff --git a/models/subscription_product_migration.go b/models/subscription_product_migration.go index dcaa4c31..aceabd1d 100644 --- a/models/subscription_product_migration.go +++ b/models/subscription_product_migration.go @@ -1,98 +1,98 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionProductMigration represents a SubscriptionProductMigration struct. type SubscriptionProductMigration struct { - // The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. - ProductId *int `json:"product_id,omitempty"` - // The ID of the specified product's price point. This can be passed to migrate to a non-default price point. - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - // Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored. - IncludeTrial *bool `json:"include_trial,omitempty"` - // If `true` is sent initial charges will be assessed. - IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` - // If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate. - IncludeCoupons *bool `json:"include_coupons,omitempty"` - // If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product. - PreservePeriod *bool `json:"preserve_period,omitempty"` - // The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. - ProductHandle *string `json:"product_handle,omitempty"` - // The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Proration *Proration `json:"proration,omitempty"` + // The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. + ProductId *int `json:"product_id,omitempty"` + // The ID of the specified product's price point. This can be passed to migrate to a non-default price point. + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + // Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored. + IncludeTrial *bool `json:"include_trial,omitempty"` + // If `true` is sent initial charges will be assessed. + IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` + // If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate. + IncludeCoupons *bool `json:"include_coupons,omitempty"` + // If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product. + PreservePeriod *bool `json:"preserve_period,omitempty"` + // The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. + ProductHandle *string `json:"product_handle,omitempty"` + // The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Proration *Proration `json:"proration,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigration. +// MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigration. // It customizes the JSON marshaling process for SubscriptionProductMigration objects. func (s *SubscriptionProductMigration) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionProductMigration object to a map representation for JSON marshaling. func (s *SubscriptionProductMigration) toMap() map[string]any { - structMap := make(map[string]any) - if s.ProductId != nil { - structMap["product_id"] = s.ProductId - } - if s.ProductPricePointId != nil { - structMap["product_price_point_id"] = s.ProductPricePointId - } - if s.IncludeTrial != nil { - structMap["include_trial"] = s.IncludeTrial - } - if s.IncludeInitialCharge != nil { - structMap["include_initial_charge"] = s.IncludeInitialCharge - } - if s.IncludeCoupons != nil { - structMap["include_coupons"] = s.IncludeCoupons - } - if s.PreservePeriod != nil { - structMap["preserve_period"] = s.PreservePeriod - } - if s.ProductHandle != nil { - structMap["product_handle"] = s.ProductHandle - } - if s.ProductPricePointHandle != nil { - structMap["product_price_point_handle"] = s.ProductPricePointHandle - } - if s.Proration != nil { - structMap["proration"] = s.Proration - } - return structMap + structMap := make(map[string]any) + if s.ProductId != nil { + structMap["product_id"] = s.ProductId + } + if s.ProductPricePointId != nil { + structMap["product_price_point_id"] = s.ProductPricePointId + } + if s.IncludeTrial != nil { + structMap["include_trial"] = s.IncludeTrial + } + if s.IncludeInitialCharge != nil { + structMap["include_initial_charge"] = s.IncludeInitialCharge + } + if s.IncludeCoupons != nil { + structMap["include_coupons"] = s.IncludeCoupons + } + if s.PreservePeriod != nil { + structMap["preserve_period"] = s.PreservePeriod + } + if s.ProductHandle != nil { + structMap["product_handle"] = s.ProductHandle + } + if s.ProductPricePointHandle != nil { + structMap["product_price_point_handle"] = s.ProductPricePointHandle + } + if s.Proration != nil { + structMap["proration"] = s.Proration.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigration. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigration. // It customizes the JSON unmarshaling process for SubscriptionProductMigration objects. func (s *SubscriptionProductMigration) UnmarshalJSON(input []byte) error { - temp := &struct { - ProductId *int `json:"product_id,omitempty"` - ProductPricePointId *int `json:"product_price_point_id,omitempty"` - IncludeTrial *bool `json:"include_trial,omitempty"` - IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` - IncludeCoupons *bool `json:"include_coupons,omitempty"` - PreservePeriod *bool `json:"preserve_period,omitempty"` - ProductHandle *string `json:"product_handle,omitempty"` - ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` - Proration *Proration `json:"proration,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.ProductId = temp.ProductId - s.ProductPricePointId = temp.ProductPricePointId - s.IncludeTrial = temp.IncludeTrial - s.IncludeInitialCharge = temp.IncludeInitialCharge - s.IncludeCoupons = temp.IncludeCoupons - s.PreservePeriod = temp.PreservePeriod - s.ProductHandle = temp.ProductHandle - s.ProductPricePointHandle = temp.ProductPricePointHandle - s.Proration = temp.Proration - return nil + temp := &struct { + ProductId *int `json:"product_id,omitempty"` + ProductPricePointId *int `json:"product_price_point_id,omitempty"` + IncludeTrial *bool `json:"include_trial,omitempty"` + IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"` + IncludeCoupons *bool `json:"include_coupons,omitempty"` + PreservePeriod *bool `json:"preserve_period,omitempty"` + ProductHandle *string `json:"product_handle,omitempty"` + ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"` + Proration *Proration `json:"proration,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.ProductId = temp.ProductId + s.ProductPricePointId = temp.ProductPricePointId + s.IncludeTrial = temp.IncludeTrial + s.IncludeInitialCharge = temp.IncludeInitialCharge + s.IncludeCoupons = temp.IncludeCoupons + s.PreservePeriod = temp.PreservePeriod + s.ProductHandle = temp.ProductHandle + s.ProductPricePointHandle = temp.ProductPricePointHandle + s.Proration = temp.Proration + return nil } diff --git a/models/subscription_product_migration_request.go b/models/subscription_product_migration_request.go index 31b21e02..cc74bcdf 100644 --- a/models/subscription_product_migration_request.go +++ b/models/subscription_product_migration_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionProductMigrationRequest represents a SubscriptionProductMigrationRequest struct. type SubscriptionProductMigrationRequest struct { - Migration SubscriptionProductMigration `json:"migration"` + Migration SubscriptionProductMigration `json:"migration"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigrationRequest. +// MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigrationRequest. // It customizes the JSON marshaling process for SubscriptionProductMigrationRequest objects. func (s *SubscriptionProductMigrationRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionProductMigrationRequest object to a map representation for JSON marshaling. func (s *SubscriptionProductMigrationRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["migration"] = s.Migration - return structMap + structMap := make(map[string]any) + structMap["migration"] = s.Migration.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigrationRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigrationRequest. // It customizes the JSON unmarshaling process for SubscriptionProductMigrationRequest objects. func (s *SubscriptionProductMigrationRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Migration SubscriptionProductMigration `json:"migration"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Migration = temp.Migration - return nil + temp := &struct { + Migration SubscriptionProductMigration `json:"migration"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Migration = temp.Migration + return nil } diff --git a/models/subscription_response.go b/models/subscription_response.go index fc64f7ee..220ea020 100644 --- a/models/subscription_response.go +++ b/models/subscription_response.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // SubscriptionResponse represents a SubscriptionResponse struct. type SubscriptionResponse struct { - Subscription *Subscription `json:"subscription,omitempty"` + Subscription *Subscription `json:"subscription,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for SubscriptionResponse. +// MarshalJSON implements the json.Marshaler interface for SubscriptionResponse. // It customizes the JSON marshaling process for SubscriptionResponse objects. func (s *SubscriptionResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(s.toMap()) + []byte, + error) { + return json.Marshal(s.toMap()) } // toMap converts the SubscriptionResponse object to a map representation for JSON marshaling. func (s *SubscriptionResponse) toMap() map[string]any { - structMap := make(map[string]any) - if s.Subscription != nil { - structMap["subscription"] = s.Subscription - } - return structMap + structMap := make(map[string]any) + if s.Subscription != nil { + structMap["subscription"] = s.Subscription.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionResponse. // It customizes the JSON unmarshaling process for SubscriptionResponse objects. func (s *SubscriptionResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscription *Subscription `json:"subscription,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - s.Subscription = temp.Subscription - return nil + temp := &struct { + Subscription *Subscription `json:"subscription,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + s.Subscription = temp.Subscription + return nil } diff --git a/models/tax_configuration.go b/models/tax_configuration.go index ed0f5f16..aa06128e 100644 --- a/models/tax_configuration.go +++ b/models/tax_configuration.go @@ -1,55 +1,55 @@ package models import ( - "encoding/json" + "encoding/json" ) // TaxConfiguration represents a TaxConfiguration struct. type TaxConfiguration struct { - Kind *TaxConfigurationKind `json:"kind,omitempty"` - DestinationAddress *TaxDestinationAddress `json:"destination_address,omitempty"` - // Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-Introduction - FullyConfigured *bool `json:"fully_configured,omitempty"` + Kind *TaxConfigurationKind `json:"kind,omitempty"` + DestinationAddress *TaxDestinationAddress `json:"destination_address,omitempty"` + // Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-Introduction + FullyConfigured *bool `json:"fully_configured,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for TaxConfiguration. +// MarshalJSON implements the json.Marshaler interface for TaxConfiguration. // It customizes the JSON marshaling process for TaxConfiguration objects. func (t *TaxConfiguration) MarshalJSON() ( - []byte, - error) { - return json.Marshal(t.toMap()) + []byte, + error) { + return json.Marshal(t.toMap()) } // toMap converts the TaxConfiguration object to a map representation for JSON marshaling. func (t *TaxConfiguration) toMap() map[string]any { - structMap := make(map[string]any) - if t.Kind != nil { - structMap["kind"] = t.Kind - } - if t.DestinationAddress != nil { - structMap["destination_address"] = t.DestinationAddress - } - if t.FullyConfigured != nil { - structMap["fully_configured"] = t.FullyConfigured - } - return structMap + structMap := make(map[string]any) + if t.Kind != nil { + structMap["kind"] = t.Kind + } + if t.DestinationAddress != nil { + structMap["destination_address"] = t.DestinationAddress + } + if t.FullyConfigured != nil { + structMap["fully_configured"] = t.FullyConfigured + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for TaxConfiguration. +// UnmarshalJSON implements the json.Unmarshaler interface for TaxConfiguration. // It customizes the JSON unmarshaling process for TaxConfiguration objects. func (t *TaxConfiguration) UnmarshalJSON(input []byte) error { - temp := &struct { - Kind *TaxConfigurationKind `json:"kind,omitempty"` - DestinationAddress *TaxDestinationAddress `json:"destination_address,omitempty"` - FullyConfigured *bool `json:"fully_configured,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - t.Kind = temp.Kind - t.DestinationAddress = temp.DestinationAddress - t.FullyConfigured = temp.FullyConfigured - return nil + temp := &struct { + Kind *TaxConfigurationKind `json:"kind,omitempty"` + DestinationAddress *TaxDestinationAddress `json:"destination_address,omitempty"` + FullyConfigured *bool `json:"fully_configured,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + t.Kind = temp.Kind + t.DestinationAddress = temp.DestinationAddress + t.FullyConfigured = temp.FullyConfigured + return nil } diff --git a/models/too_many_management_link_requests.go b/models/too_many_management_link_requests.go index ceb11a9f..932b585a 100644 --- a/models/too_many_management_link_requests.go +++ b/models/too_many_management_link_requests.go @@ -1,50 +1,50 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // TooManyManagementLinkRequests represents a TooManyManagementLinkRequests struct. type TooManyManagementLinkRequests struct { - Error string `json:"error"` - NewLinkAvailableAt time.Time `json:"new_link_available_at"` + Error string `json:"error"` + NewLinkAvailableAt time.Time `json:"new_link_available_at"` } -// MarshalJSON implements the json.Marshaler interface for TooManyManagementLinkRequests. +// MarshalJSON implements the json.Marshaler interface for TooManyManagementLinkRequests. // It customizes the JSON marshaling process for TooManyManagementLinkRequests objects. func (t *TooManyManagementLinkRequests) MarshalJSON() ( - []byte, - error) { - return json.Marshal(t.toMap()) + []byte, + error) { + return json.Marshal(t.toMap()) } // toMap converts the TooManyManagementLinkRequests object to a map representation for JSON marshaling. func (t *TooManyManagementLinkRequests) toMap() map[string]any { - structMap := make(map[string]any) - structMap["error"] = t.Error - structMap["new_link_available_at"] = t.NewLinkAvailableAt.Format(time.RFC3339) - return structMap + structMap := make(map[string]any) + structMap["error"] = t.Error + structMap["new_link_available_at"] = t.NewLinkAvailableAt.Format(time.RFC3339) + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for TooManyManagementLinkRequests. +// UnmarshalJSON implements the json.Unmarshaler interface for TooManyManagementLinkRequests. // It customizes the JSON unmarshaling process for TooManyManagementLinkRequests objects. func (t *TooManyManagementLinkRequests) UnmarshalJSON(input []byte) error { - temp := &struct { - Error string `json:"error"` - NewLinkAvailableAt string `json:"new_link_available_at"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - t.Error = temp.Error - NewLinkAvailableAtVal, err := time.Parse(time.RFC3339, temp.NewLinkAvailableAt) - if err != nil { - log.Fatalf("Cannot Parse new_link_available_at as % s format.", time.RFC3339) - } - t.NewLinkAvailableAt = NewLinkAvailableAtVal - return nil + temp := &struct { + Error string `json:"error"` + NewLinkAvailableAt string `json:"new_link_available_at"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + t.Error = temp.Error + NewLinkAvailableAtVal, err := time.Parse(time.RFC3339, temp.NewLinkAvailableAt) + if err != nil { + log.Fatalf("Cannot Parse new_link_available_at as % s format.", time.RFC3339) + } + t.NewLinkAvailableAt = NewLinkAvailableAtVal + return nil } diff --git a/models/update_allocation_expiration_date.go b/models/update_allocation_expiration_date.go index 5cc35ebc..b122de90 100644 --- a/models/update_allocation_expiration_date.go +++ b/models/update_allocation_expiration_date.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateAllocationExpirationDate represents a UpdateAllocationExpirationDate struct. type UpdateAllocationExpirationDate struct { - Allocation *AllocationExpirationDate `json:"allocation,omitempty"` + Allocation *AllocationExpirationDate `json:"allocation,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateAllocationExpirationDate. +// MarshalJSON implements the json.Marshaler interface for UpdateAllocationExpirationDate. // It customizes the JSON marshaling process for UpdateAllocationExpirationDate objects. func (u *UpdateAllocationExpirationDate) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateAllocationExpirationDate object to a map representation for JSON marshaling. func (u *UpdateAllocationExpirationDate) toMap() map[string]any { - structMap := make(map[string]any) - if u.Allocation != nil { - structMap["allocation"] = u.Allocation - } - return structMap + structMap := make(map[string]any) + if u.Allocation != nil { + structMap["allocation"] = u.Allocation.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateAllocationExpirationDate. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateAllocationExpirationDate. // It customizes the JSON unmarshaling process for UpdateAllocationExpirationDate objects. func (u *UpdateAllocationExpirationDate) UnmarshalJSON(input []byte) error { - temp := &struct { - Allocation *AllocationExpirationDate `json:"allocation,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Allocation = temp.Allocation - return nil + temp := &struct { + Allocation *AllocationExpirationDate `json:"allocation,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Allocation = temp.Allocation + return nil } diff --git a/models/update_component.go b/models/update_component.go index 60d21e88..8c6e2403 100644 --- a/models/update_component.go +++ b/models/update_component.go @@ -1,97 +1,97 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateComponent represents a UpdateComponent struct. type UpdateComponent struct { - Handle *string `json:"handle,omitempty"` - // The name of the Component, suitable for display on statements. i.e. Text Messages. - Name *string `json:"name,omitempty"` - // The description of the component. - Description Optional[string] `json:"description"` - AccountingCode Optional[string] `json:"accounting_code"` - // Boolean flag describing whether a component is taxable or not. - Taxable *bool `json:"taxable,omitempty"` - // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. - TaxCode Optional[string] `json:"tax_code"` - // One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other - ItemCategory Optional[ItemCategory] `json:"item_category"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - // Available values: `full`, `prorated`, `none`. - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + Handle *string `json:"handle,omitempty"` + // The name of the Component, suitable for display on statements. i.e. Text Messages. + Name *string `json:"name,omitempty"` + // The description of the component. + Description Optional[string] `json:"description"` + AccountingCode Optional[string] `json:"accounting_code"` + // Boolean flag describing whether a component is taxable or not. + Taxable *bool `json:"taxable,omitempty"` + // A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + TaxCode Optional[string] `json:"tax_code"` + // One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other + ItemCategory Optional[ItemCategory] `json:"item_category"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + // The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + // Available values: `full`, `prorated`, `none`. + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` } -// MarshalJSON implements the json.Marshaler interface for UpdateComponent. +// MarshalJSON implements the json.Marshaler interface for UpdateComponent. // It customizes the JSON marshaling process for UpdateComponent objects. func (u *UpdateComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateComponent object to a map representation for JSON marshaling. func (u *UpdateComponent) toMap() map[string]any { - structMap := make(map[string]any) - if u.Handle != nil { - structMap["handle"] = u.Handle - } - if u.Name != nil { - structMap["name"] = u.Name - } - if u.Description.IsValueSet() { - structMap["description"] = u.Description.Value() - } - if u.AccountingCode.IsValueSet() { - structMap["accounting_code"] = u.AccountingCode.Value() - } - if u.Taxable != nil { - structMap["taxable"] = u.Taxable - } - if u.TaxCode.IsValueSet() { - structMap["tax_code"] = u.TaxCode.Value() - } - if u.ItemCategory.IsValueSet() { - structMap["item_category"] = u.ItemCategory.Value() - } - if u.DisplayOnHostedPage != nil { - structMap["display_on_hosted_page"] = u.DisplayOnHostedPage - } - if u.UpgradeCharge.IsValueSet() { - structMap["upgrade_charge"] = u.UpgradeCharge.Value() - } - return structMap + structMap := make(map[string]any) + if u.Handle != nil { + structMap["handle"] = u.Handle + } + if u.Name != nil { + structMap["name"] = u.Name + } + if u.Description.IsValueSet() { + structMap["description"] = u.Description.Value() + } + if u.AccountingCode.IsValueSet() { + structMap["accounting_code"] = u.AccountingCode.Value() + } + if u.Taxable != nil { + structMap["taxable"] = u.Taxable + } + if u.TaxCode.IsValueSet() { + structMap["tax_code"] = u.TaxCode.Value() + } + if u.ItemCategory.IsValueSet() { + structMap["item_category"] = u.ItemCategory.Value() + } + if u.DisplayOnHostedPage != nil { + structMap["display_on_hosted_page"] = u.DisplayOnHostedPage + } + if u.UpgradeCharge.IsValueSet() { + structMap["upgrade_charge"] = u.UpgradeCharge.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponent. // It customizes the JSON unmarshaling process for UpdateComponent objects. func (u *UpdateComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - Handle *string `json:"handle,omitempty"` - Name *string `json:"name,omitempty"` - Description Optional[string] `json:"description"` - AccountingCode Optional[string] `json:"accounting_code"` - Taxable *bool `json:"taxable,omitempty"` - TaxCode Optional[string] `json:"tax_code"` - ItemCategory Optional[ItemCategory] `json:"item_category"` - DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` - UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Handle = temp.Handle - u.Name = temp.Name - u.Description = temp.Description - u.AccountingCode = temp.AccountingCode - u.Taxable = temp.Taxable - u.TaxCode = temp.TaxCode - u.ItemCategory = temp.ItemCategory - u.DisplayOnHostedPage = temp.DisplayOnHostedPage - u.UpgradeCharge = temp.UpgradeCharge - return nil + temp := &struct { + Handle *string `json:"handle,omitempty"` + Name *string `json:"name,omitempty"` + Description Optional[string] `json:"description"` + AccountingCode Optional[string] `json:"accounting_code"` + Taxable *bool `json:"taxable,omitempty"` + TaxCode Optional[string] `json:"tax_code"` + ItemCategory Optional[ItemCategory] `json:"item_category"` + DisplayOnHostedPage *bool `json:"display_on_hosted_page,omitempty"` + UpgradeCharge Optional[CreditType] `json:"upgrade_charge"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Handle = temp.Handle + u.Name = temp.Name + u.Description = temp.Description + u.AccountingCode = temp.AccountingCode + u.Taxable = temp.Taxable + u.TaxCode = temp.TaxCode + u.ItemCategory = temp.ItemCategory + u.DisplayOnHostedPage = temp.DisplayOnHostedPage + u.UpgradeCharge = temp.UpgradeCharge + return nil } diff --git a/models/update_component_price_point.go b/models/update_component_price_point.go index 33ac5cb0..9a08b1c2 100644 --- a/models/update_component_price_point.go +++ b/models/update_component_price_point.go @@ -1,89 +1,89 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateComponentPricePoint represents a UpdateComponentPricePoint struct. type UpdateComponentPricePoint struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - // 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. - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - // Whether or not the price point includes tax - TaxIncluded *bool `json:"tax_included,omitempty"` - // 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 `json:"interval,omitempty"` - // 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. - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - Prices []UpdatePrice `json:"prices,omitempty"` + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + // 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. + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + // Whether or not the price point includes tax + TaxIncluded *bool `json:"tax_included,omitempty"` + // 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 `json:"interval,omitempty"` + // 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. + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + Prices []UpdatePrice `json:"prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePoint. +// MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePoint. // It customizes the JSON marshaling process for UpdateComponentPricePoint objects. func (u *UpdateComponentPricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateComponentPricePoint object to a map representation for JSON marshaling. func (u *UpdateComponentPricePoint) toMap() map[string]any { - structMap := make(map[string]any) - if u.Name != nil { - structMap["name"] = u.Name - } - if u.Handle != nil { - structMap["handle"] = u.Handle - } - if u.PricingScheme != nil { - structMap["pricing_scheme"] = u.PricingScheme - } - if u.UseSiteExchangeRate != nil { - structMap["use_site_exchange_rate"] = u.UseSiteExchangeRate - } - if u.TaxIncluded != nil { - structMap["tax_included"] = u.TaxIncluded - } - if u.Interval != nil { - structMap["interval"] = u.Interval - } - if u.IntervalUnit != nil { - structMap["interval_unit"] = u.IntervalUnit - } - if u.Prices != nil { - structMap["prices"] = u.Prices - } - return structMap + structMap := make(map[string]any) + if u.Name != nil { + structMap["name"] = u.Name + } + if u.Handle != nil { + structMap["handle"] = u.Handle + } + if u.PricingScheme != nil { + structMap["pricing_scheme"] = u.PricingScheme + } + if u.UseSiteExchangeRate != nil { + structMap["use_site_exchange_rate"] = u.UseSiteExchangeRate + } + if u.TaxIncluded != nil { + structMap["tax_included"] = u.TaxIncluded + } + if u.Interval != nil { + structMap["interval"] = u.Interval + } + if u.IntervalUnit != nil { + structMap["interval_unit"] = u.IntervalUnit + } + if u.Prices != nil { + structMap["prices"] = u.Prices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePoint. // It customizes the JSON unmarshaling process for UpdateComponentPricePoint objects. func (u *UpdateComponentPricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Name *string `json:"name,omitempty"` - Handle *string `json:"handle,omitempty"` - PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` - UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` - TaxIncluded *bool `json:"tax_included,omitempty"` - Interval *int `json:"interval,omitempty"` - IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` - Prices []UpdatePrice `json:"prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Name = temp.Name - u.Handle = temp.Handle - u.PricingScheme = temp.PricingScheme - u.UseSiteExchangeRate = temp.UseSiteExchangeRate - u.TaxIncluded = temp.TaxIncluded - u.Interval = temp.Interval - u.IntervalUnit = temp.IntervalUnit - u.Prices = temp.Prices - return nil + temp := &struct { + Name *string `json:"name,omitempty"` + Handle *string `json:"handle,omitempty"` + PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"` + UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"` + TaxIncluded *bool `json:"tax_included,omitempty"` + Interval *int `json:"interval,omitempty"` + IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"` + Prices []UpdatePrice `json:"prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Name = temp.Name + u.Handle = temp.Handle + u.PricingScheme = temp.PricingScheme + u.UseSiteExchangeRate = temp.UseSiteExchangeRate + u.TaxIncluded = temp.TaxIncluded + u.Interval = temp.Interval + u.IntervalUnit = temp.IntervalUnit + u.Prices = temp.Prices + return nil } diff --git a/models/update_component_price_point_request.go b/models/update_component_price_point_request.go index 6779b5e5..f2d161c5 100644 --- a/models/update_component_price_point_request.go +++ b/models/update_component_price_point_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateComponentPricePointRequest represents a UpdateComponentPricePointRequest struct. type UpdateComponentPricePointRequest struct { - PricePoint *UpdateComponentPricePoint `json:"price_point,omitempty"` + PricePoint *UpdateComponentPricePoint `json:"price_point,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePointRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePointRequest. // It customizes the JSON marshaling process for UpdateComponentPricePointRequest objects. func (u *UpdateComponentPricePointRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateComponentPricePointRequest object to a map representation for JSON marshaling. func (u *UpdateComponentPricePointRequest) toMap() map[string]any { - structMap := make(map[string]any) - if u.PricePoint != nil { - structMap["price_point"] = u.PricePoint - } - return structMap + structMap := make(map[string]any) + if u.PricePoint != nil { + structMap["price_point"] = u.PricePoint.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePointRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePointRequest. // It customizes the JSON unmarshaling process for UpdateComponentPricePointRequest objects. func (u *UpdateComponentPricePointRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoint *UpdateComponentPricePoint `json:"price_point,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.PricePoint = temp.PricePoint - return nil + temp := &struct { + PricePoint *UpdateComponentPricePoint `json:"price_point,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.PricePoint = temp.PricePoint + return nil } diff --git a/models/update_component_request.go b/models/update_component_request.go index 4388213d..fd7fe8f1 100644 --- a/models/update_component_request.go +++ b/models/update_component_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateComponentRequest represents a UpdateComponentRequest struct. type UpdateComponentRequest struct { - Component UpdateComponent `json:"component"` + Component UpdateComponent `json:"component"` } -// MarshalJSON implements the json.Marshaler interface for UpdateComponentRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateComponentRequest. // It customizes the JSON marshaling process for UpdateComponentRequest objects. func (u *UpdateComponentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateComponentRequest object to a map representation for JSON marshaling. func (u *UpdateComponentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["component"] = u.Component - return structMap + structMap := make(map[string]any) + structMap["component"] = u.Component.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentRequest. // It customizes the JSON unmarshaling process for UpdateComponentRequest objects. func (u *UpdateComponentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Component UpdateComponent `json:"component"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Component = temp.Component - return nil + temp := &struct { + Component UpdateComponent `json:"component"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Component = temp.Component + return nil } diff --git a/models/update_coupon_currency.go b/models/update_coupon_currency.go index 5cfc1961..794d7a11 100644 --- a/models/update_coupon_currency.go +++ b/models/update_coupon_currency.go @@ -1,46 +1,46 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateCouponCurrency represents a UpdateCouponCurrency struct. type UpdateCouponCurrency struct { - // ISO code for the site defined currency. - Currency string `json:"currency"` - // Price for the given currency. - Price int `json:"price"` + // ISO code for the site defined currency. + Currency string `json:"currency"` + // Price for the given currency. + Price int `json:"price"` } -// MarshalJSON implements the json.Marshaler interface for UpdateCouponCurrency. +// MarshalJSON implements the json.Marshaler interface for UpdateCouponCurrency. // It customizes the JSON marshaling process for UpdateCouponCurrency objects. func (u *UpdateCouponCurrency) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateCouponCurrency object to a map representation for JSON marshaling. func (u *UpdateCouponCurrency) toMap() map[string]any { - structMap := make(map[string]any) - structMap["currency"] = u.Currency - structMap["price"] = u.Price - return structMap + structMap := make(map[string]any) + structMap["currency"] = u.Currency + structMap["price"] = u.Price + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCouponCurrency. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCouponCurrency. // It customizes the JSON unmarshaling process for UpdateCouponCurrency objects. func (u *UpdateCouponCurrency) UnmarshalJSON(input []byte) error { - temp := &struct { - Currency string `json:"currency"` - Price int `json:"price"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Currency = temp.Currency - u.Price = temp.Price - return nil + temp := &struct { + Currency string `json:"currency"` + Price int `json:"price"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Currency = temp.Currency + u.Price = temp.Price + return nil } diff --git a/models/update_currency_price.go b/models/update_currency_price.go index cb426f5d..c332576e 100644 --- a/models/update_currency_price.go +++ b/models/update_currency_price.go @@ -1,46 +1,46 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateCurrencyPrice represents a UpdateCurrencyPrice struct. type UpdateCurrencyPrice struct { - // ID of the currency price record being updated - Id int `json:"id"` - // New price for the given currency - Price int `json:"price"` + // ID of the currency price record being updated + Id int `json:"id"` + // New price for the given currency + Price int `json:"price"` } -// MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPrice. +// MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPrice. // It customizes the JSON marshaling process for UpdateCurrencyPrice objects. func (u *UpdateCurrencyPrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateCurrencyPrice object to a map representation for JSON marshaling. func (u *UpdateCurrencyPrice) toMap() map[string]any { - structMap := make(map[string]any) - structMap["id"] = u.Id - structMap["price"] = u.Price - return structMap + structMap := make(map[string]any) + structMap["id"] = u.Id + structMap["price"] = u.Price + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPrice. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPrice. // It customizes the JSON unmarshaling process for UpdateCurrencyPrice objects. func (u *UpdateCurrencyPrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Id int `json:"id"` - Price int `json:"price"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Id = temp.Id - u.Price = temp.Price - return nil + temp := &struct { + Id int `json:"id"` + Price int `json:"price"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Id = temp.Id + u.Price = temp.Price + return nil } diff --git a/models/update_currency_prices_request.go b/models/update_currency_prices_request.go index 4cebbf57..b2ca80cd 100644 --- a/models/update_currency_prices_request.go +++ b/models/update_currency_prices_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateCurrencyPricesRequest represents a UpdateCurrencyPricesRequest struct. type UpdateCurrencyPricesRequest struct { - CurrencyPrices []UpdateCurrencyPrice `json:"currency_prices"` + CurrencyPrices []UpdateCurrencyPrice `json:"currency_prices"` } -// MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPricesRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPricesRequest. // It customizes the JSON marshaling process for UpdateCurrencyPricesRequest objects. func (u *UpdateCurrencyPricesRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateCurrencyPricesRequest object to a map representation for JSON marshaling. func (u *UpdateCurrencyPricesRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["currency_prices"] = u.CurrencyPrices - return structMap + structMap := make(map[string]any) + structMap["currency_prices"] = u.CurrencyPrices + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPricesRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPricesRequest. // It customizes the JSON unmarshaling process for UpdateCurrencyPricesRequest objects. func (u *UpdateCurrencyPricesRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrencyPrices []UpdateCurrencyPrice `json:"currency_prices"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.CurrencyPrices = temp.CurrencyPrices - return nil + temp := &struct { + CurrencyPrices []UpdateCurrencyPrice `json:"currency_prices"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.CurrencyPrices = temp.CurrencyPrices + return nil } diff --git a/models/update_customer.go b/models/update_customer.go index 8b30a611..df34ce14 100644 --- a/models/update_customer.go +++ b/models/update_customer.go @@ -1,145 +1,145 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateCustomer represents a UpdateCustomer struct. type UpdateCustomer struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails *string `json:"cc_emails,omitempty"` - Organization *string `json:"organization,omitempty"` - Reference *string `json:"reference,omitempty"` - Address *string `json:"address,omitempty"` - Address2 *string `json:"address_2,omitempty"` - City *string `json:"city,omitempty"` - State *string `json:"state,omitempty"` - Zip *string `json:"zip,omitempty"` - Country *string `json:"country,omitempty"` - Phone *string `json:"phone,omitempty"` - // Set a specific language on a customer record. - Locale *string `json:"locale,omitempty"` - VatNumber *string `json:"vat_number,omitempty"` - TaxExempt *bool `json:"tax_exempt,omitempty"` - TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` - ParentId Optional[int] `json:"parent_id"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails *string `json:"cc_emails,omitempty"` + Organization *string `json:"organization,omitempty"` + Reference *string `json:"reference,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address_2,omitempty"` + City *string `json:"city,omitempty"` + State *string `json:"state,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Phone *string `json:"phone,omitempty"` + // Set a specific language on a customer record. + Locale *string `json:"locale,omitempty"` + VatNumber *string `json:"vat_number,omitempty"` + TaxExempt *bool `json:"tax_exempt,omitempty"` + TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` + ParentId Optional[int] `json:"parent_id"` } -// MarshalJSON implements the json.Marshaler interface for UpdateCustomer. +// MarshalJSON implements the json.Marshaler interface for UpdateCustomer. // It customizes the JSON marshaling process for UpdateCustomer objects. func (u *UpdateCustomer) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateCustomer object to a map representation for JSON marshaling. func (u *UpdateCustomer) toMap() map[string]any { - structMap := make(map[string]any) - if u.FirstName != nil { - structMap["first_name"] = u.FirstName - } - if u.LastName != nil { - structMap["last_name"] = u.LastName - } - if u.Email != nil { - structMap["email"] = u.Email - } - if u.CcEmails != nil { - structMap["cc_emails"] = u.CcEmails - } - if u.Organization != nil { - structMap["organization"] = u.Organization - } - if u.Reference != nil { - structMap["reference"] = u.Reference - } - if u.Address != nil { - structMap["address"] = u.Address - } - if u.Address2 != nil { - structMap["address_2"] = u.Address2 - } - if u.City != nil { - structMap["city"] = u.City - } - if u.State != nil { - structMap["state"] = u.State - } - if u.Zip != nil { - structMap["zip"] = u.Zip - } - if u.Country != nil { - structMap["country"] = u.Country - } - if u.Phone != nil { - structMap["phone"] = u.Phone - } - if u.Locale != nil { - structMap["locale"] = u.Locale - } - if u.VatNumber != nil { - structMap["vat_number"] = u.VatNumber - } - if u.TaxExempt != nil { - structMap["tax_exempt"] = u.TaxExempt - } - if u.TaxExemptReason != nil { - structMap["tax_exempt_reason"] = u.TaxExemptReason - } - if u.ParentId.IsValueSet() { - structMap["parent_id"] = u.ParentId.Value() - } - return structMap + structMap := make(map[string]any) + if u.FirstName != nil { + structMap["first_name"] = u.FirstName + } + if u.LastName != nil { + structMap["last_name"] = u.LastName + } + if u.Email != nil { + structMap["email"] = u.Email + } + if u.CcEmails != nil { + structMap["cc_emails"] = u.CcEmails + } + if u.Organization != nil { + structMap["organization"] = u.Organization + } + if u.Reference != nil { + structMap["reference"] = u.Reference + } + if u.Address != nil { + structMap["address"] = u.Address + } + if u.Address2 != nil { + structMap["address_2"] = u.Address2 + } + if u.City != nil { + structMap["city"] = u.City + } + if u.State != nil { + structMap["state"] = u.State + } + if u.Zip != nil { + structMap["zip"] = u.Zip + } + if u.Country != nil { + structMap["country"] = u.Country + } + if u.Phone != nil { + structMap["phone"] = u.Phone + } + if u.Locale != nil { + structMap["locale"] = u.Locale + } + if u.VatNumber != nil { + structMap["vat_number"] = u.VatNumber + } + if u.TaxExempt != nil { + structMap["tax_exempt"] = u.TaxExempt + } + if u.TaxExemptReason != nil { + structMap["tax_exempt_reason"] = u.TaxExemptReason + } + if u.ParentId.IsValueSet() { + structMap["parent_id"] = u.ParentId.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomer. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomer. // It customizes the JSON unmarshaling process for UpdateCustomer objects. func (u *UpdateCustomer) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - Email *string `json:"email,omitempty"` - CcEmails *string `json:"cc_emails,omitempty"` - Organization *string `json:"organization,omitempty"` - Reference *string `json:"reference,omitempty"` - Address *string `json:"address,omitempty"` - Address2 *string `json:"address_2,omitempty"` - City *string `json:"city,omitempty"` - State *string `json:"state,omitempty"` - Zip *string `json:"zip,omitempty"` - Country *string `json:"country,omitempty"` - Phone *string `json:"phone,omitempty"` - Locale *string `json:"locale,omitempty"` - VatNumber *string `json:"vat_number,omitempty"` - TaxExempt *bool `json:"tax_exempt,omitempty"` - TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` - ParentId Optional[int] `json:"parent_id"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.FirstName = temp.FirstName - u.LastName = temp.LastName - u.Email = temp.Email - u.CcEmails = temp.CcEmails - u.Organization = temp.Organization - u.Reference = temp.Reference - u.Address = temp.Address - u.Address2 = temp.Address2 - u.City = temp.City - u.State = temp.State - u.Zip = temp.Zip - u.Country = temp.Country - u.Phone = temp.Phone - u.Locale = temp.Locale - u.VatNumber = temp.VatNumber - u.TaxExempt = temp.TaxExempt - u.TaxExemptReason = temp.TaxExemptReason - u.ParentId = temp.ParentId - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Email *string `json:"email,omitempty"` + CcEmails *string `json:"cc_emails,omitempty"` + Organization *string `json:"organization,omitempty"` + Reference *string `json:"reference,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address_2,omitempty"` + City *string `json:"city,omitempty"` + State *string `json:"state,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Phone *string `json:"phone,omitempty"` + Locale *string `json:"locale,omitempty"` + VatNumber *string `json:"vat_number,omitempty"` + TaxExempt *bool `json:"tax_exempt,omitempty"` + TaxExemptReason *string `json:"tax_exempt_reason,omitempty"` + ParentId Optional[int] `json:"parent_id"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.FirstName = temp.FirstName + u.LastName = temp.LastName + u.Email = temp.Email + u.CcEmails = temp.CcEmails + u.Organization = temp.Organization + u.Reference = temp.Reference + u.Address = temp.Address + u.Address2 = temp.Address2 + u.City = temp.City + u.State = temp.State + u.Zip = temp.Zip + u.Country = temp.Country + u.Phone = temp.Phone + u.Locale = temp.Locale + u.VatNumber = temp.VatNumber + u.TaxExempt = temp.TaxExempt + u.TaxExemptReason = temp.TaxExemptReason + u.ParentId = temp.ParentId + return nil } diff --git a/models/update_customer_request.go b/models/update_customer_request.go index b7783b22..9644675c 100644 --- a/models/update_customer_request.go +++ b/models/update_customer_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateCustomerRequest represents a UpdateCustomerRequest struct. type UpdateCustomerRequest struct { - Customer UpdateCustomer `json:"customer"` + Customer UpdateCustomer `json:"customer"` } -// MarshalJSON implements the json.Marshaler interface for UpdateCustomerRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateCustomerRequest. // It customizes the JSON marshaling process for UpdateCustomerRequest objects. func (u *UpdateCustomerRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateCustomerRequest object to a map representation for JSON marshaling. func (u *UpdateCustomerRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["customer"] = u.Customer - return structMap + structMap := make(map[string]any) + structMap["customer"] = u.Customer.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomerRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomerRequest. // It customizes the JSON unmarshaling process for UpdateCustomerRequest objects. func (u *UpdateCustomerRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Customer UpdateCustomer `json:"customer"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Customer = temp.Customer - return nil + temp := &struct { + Customer UpdateCustomer `json:"customer"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Customer = temp.Customer + return nil } diff --git a/models/update_endpoint.go b/models/update_endpoint.go index e7354e02..a1f8bd43 100644 --- a/models/update_endpoint.go +++ b/models/update_endpoint.go @@ -1,45 +1,45 @@ package models import ( - "encoding/json" + "encoding/json" ) -// UpdateEndpoint represents a UpdateEndpoint struct. +// UpdateEndpoint represents a UpdateEndpoint struct. // Used to Create or Update Endpoint type UpdateEndpoint struct { - Url string `json:"url"` - WebhookSubscriptions []WebhookSubscription `json:"webhook_subscriptions"` + Url string `json:"url"` + WebhookSubscriptions []WebhookSubscription `json:"webhook_subscriptions"` } -// MarshalJSON implements the json.Marshaler interface for UpdateEndpoint. +// MarshalJSON implements the json.Marshaler interface for UpdateEndpoint. // It customizes the JSON marshaling process for UpdateEndpoint objects. func (u *UpdateEndpoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateEndpoint object to a map representation for JSON marshaling. func (u *UpdateEndpoint) toMap() map[string]any { - structMap := make(map[string]any) - structMap["url"] = u.Url - structMap["webhook_subscriptions"] = u.WebhookSubscriptions - return structMap + structMap := make(map[string]any) + structMap["url"] = u.Url + structMap["webhook_subscriptions"] = u.WebhookSubscriptions + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpoint. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpoint. // It customizes the JSON unmarshaling process for UpdateEndpoint objects. func (u *UpdateEndpoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Url string `json:"url"` - WebhookSubscriptions []WebhookSubscription `json:"webhook_subscriptions"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Url = temp.Url - u.WebhookSubscriptions = temp.WebhookSubscriptions - return nil + temp := &struct { + Url string `json:"url"` + WebhookSubscriptions []WebhookSubscription `json:"webhook_subscriptions"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Url = temp.Url + u.WebhookSubscriptions = temp.WebhookSubscriptions + return nil } diff --git a/models/update_endpoint_request.go b/models/update_endpoint_request.go index 8b8b0fda..80080139 100644 --- a/models/update_endpoint_request.go +++ b/models/update_endpoint_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) -// UpdateEndpointRequest represents a UpdateEndpointRequest struct. +// UpdateEndpointRequest represents a UpdateEndpointRequest struct. // Used to Create or Update Endpoint type UpdateEndpointRequest struct { - // Used to Create or Update Endpoint - Endpoint UpdateEndpoint `json:"endpoint"` + // Used to Create or Update Endpoint + Endpoint UpdateEndpoint `json:"endpoint"` } -// MarshalJSON implements the json.Marshaler interface for UpdateEndpointRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateEndpointRequest. // It customizes the JSON marshaling process for UpdateEndpointRequest objects. func (u *UpdateEndpointRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateEndpointRequest object to a map representation for JSON marshaling. func (u *UpdateEndpointRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["endpoint"] = u.Endpoint - return structMap + structMap := make(map[string]any) + structMap["endpoint"] = u.Endpoint.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpointRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpointRequest. // It customizes the JSON unmarshaling process for UpdateEndpointRequest objects. func (u *UpdateEndpointRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Endpoint UpdateEndpoint `json:"endpoint"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Endpoint = temp.Endpoint - return nil + temp := &struct { + Endpoint UpdateEndpoint `json:"endpoint"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Endpoint = temp.Endpoint + return nil } diff --git a/models/update_metadata.go b/models/update_metadata.go index a299faf0..8fc947fe 100644 --- a/models/update_metadata.go +++ b/models/update_metadata.go @@ -1,54 +1,54 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateMetadata represents a UpdateMetadata struct. type UpdateMetadata struct { - CurrentName *string `json:"current_name,omitempty"` - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` + CurrentName *string `json:"current_name,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateMetadata. +// MarshalJSON implements the json.Marshaler interface for UpdateMetadata. // It customizes the JSON marshaling process for UpdateMetadata objects. func (u *UpdateMetadata) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateMetadata object to a map representation for JSON marshaling. func (u *UpdateMetadata) toMap() map[string]any { - structMap := make(map[string]any) - if u.CurrentName != nil { - structMap["current_name"] = u.CurrentName - } - if u.Name != nil { - structMap["name"] = u.Name - } - if u.Value != nil { - structMap["value"] = u.Value - } - return structMap + structMap := make(map[string]any) + if u.CurrentName != nil { + structMap["current_name"] = u.CurrentName + } + if u.Name != nil { + structMap["name"] = u.Name + } + if u.Value != nil { + structMap["value"] = u.Value + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadata. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadata. // It customizes the JSON unmarshaling process for UpdateMetadata objects. func (u *UpdateMetadata) UnmarshalJSON(input []byte) error { - temp := &struct { - CurrentName *string `json:"current_name,omitempty"` - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.CurrentName = temp.CurrentName - u.Name = temp.Name - u.Value = temp.Value - return nil + temp := &struct { + CurrentName *string `json:"current_name,omitempty"` + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.CurrentName = temp.CurrentName + u.Name = temp.Name + u.Value = temp.Value + return nil } diff --git a/models/update_metadata_request.go b/models/update_metadata_request.go index 79b558c5..ce18c844 100644 --- a/models/update_metadata_request.go +++ b/models/update_metadata_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateMetadataRequest represents a UpdateMetadataRequest struct. type UpdateMetadataRequest struct { - Metadata *UpdateMetadata `json:"metadata,omitempty"` + Metadata *UpdateMetadata `json:"metadata,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateMetadataRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateMetadataRequest. // It customizes the JSON marshaling process for UpdateMetadataRequest objects. func (u *UpdateMetadataRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateMetadataRequest object to a map representation for JSON marshaling. func (u *UpdateMetadataRequest) toMap() map[string]any { - structMap := make(map[string]any) - if u.Metadata != nil { - structMap["metadata"] = u.Metadata - } - return structMap + structMap := make(map[string]any) + if u.Metadata != nil { + structMap["metadata"] = u.Metadata.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadataRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadataRequest. // It customizes the JSON unmarshaling process for UpdateMetadataRequest objects. func (u *UpdateMetadataRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Metadata *UpdateMetadata `json:"metadata,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Metadata = temp.Metadata - return nil + temp := &struct { + Metadata *UpdateMetadata `json:"metadata,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Metadata = temp.Metadata + return nil } diff --git a/models/update_metafields_request.go b/models/update_metafields_request.go index 46c6b622..a14ff8f7 100644 --- a/models/update_metafields_request.go +++ b/models/update_metafields_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateMetafieldsRequest represents a UpdateMetafieldsRequest struct. type UpdateMetafieldsRequest struct { - Metafields *interface{} `json:"metafields,omitempty"` + Metafields *interface{} `json:"metafields,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateMetafieldsRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateMetafieldsRequest. // It customizes the JSON marshaling process for UpdateMetafieldsRequest objects. func (u *UpdateMetafieldsRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateMetafieldsRequest object to a map representation for JSON marshaling. func (u *UpdateMetafieldsRequest) toMap() map[string]any { - structMap := make(map[string]any) - if u.Metafields != nil { - structMap["metafields"] = u.Metafields - } - return structMap + structMap := make(map[string]any) + if u.Metafields != nil { + structMap["metafields"] = u.Metafields + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetafieldsRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetafieldsRequest. // It customizes the JSON unmarshaling process for UpdateMetafieldsRequest objects. func (u *UpdateMetafieldsRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Metafields *interface{} `json:"metafields,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Metafields = temp.Metafields - return nil + temp := &struct { + Metafields *interface{} `json:"metafields,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Metafields = temp.Metafields + return nil } diff --git a/models/update_payment_profile.go b/models/update_payment_profile.go index 5666a017..28792e36 100644 --- a/models/update_payment_profile.go +++ b/models/update_payment_profile.go @@ -1,127 +1,127 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdatePaymentProfile represents a UpdatePaymentProfile struct. type UpdatePaymentProfile struct { - // The first name of the card holder. - FirstName *string `json:"first_name,omitempty"` - // The last name of the card holder. - LastName *string `json:"last_name,omitempty"` - // The full credit card number - FullNumber *string `json:"full_number,omitempty"` - // The type of card used. - CardType *CardType `json:"card_type,omitempty"` - // (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 - ExpirationMonth *string `json:"expiration_month,omitempty"` - // (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 - ExpirationYear *string `json:"expiration_year,omitempty"` - // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - // The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. - BillingAddress *string `json:"billing_address,omitempty"` - // The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. - BillingCity *string `json:"billing_city,omitempty"` - // 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. - BillingState *string `json:"billing_state,omitempty"` - // The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. - BillingZip *string `json:"billing_zip,omitempty"` - // 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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. - BillingCountry *string `json:"billing_country,omitempty"` - // Second line of the customer’s billing address i.e. Apt. 100 - BillingAddress2 Optional[string] `json:"billing_address_2"` + // The first name of the card holder. + FirstName *string `json:"first_name,omitempty"` + // The last name of the card holder. + LastName *string `json:"last_name,omitempty"` + // The full credit card number + FullNumber *string `json:"full_number,omitempty"` + // The type of card used. + CardType *CardType `json:"card_type,omitempty"` + // (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 + ExpirationMonth *string `json:"expiration_month,omitempty"` + // (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 + ExpirationYear *string `json:"expiration_year,omitempty"` + // The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + // The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. + BillingAddress *string `json:"billing_address,omitempty"` + // The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. + BillingCity *string `json:"billing_city,omitempty"` + // 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. + BillingState *string `json:"billing_state,omitempty"` + // The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. + BillingZip *string `json:"billing_zip,omitempty"` + // 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. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. + BillingCountry *string `json:"billing_country,omitempty"` + // Second line of the customer’s billing address i.e. Apt. 100 + BillingAddress2 Optional[string] `json:"billing_address_2"` } -// MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfile. +// MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfile. // It customizes the JSON marshaling process for UpdatePaymentProfile objects. func (u *UpdatePaymentProfile) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdatePaymentProfile object to a map representation for JSON marshaling. func (u *UpdatePaymentProfile) toMap() map[string]any { - structMap := make(map[string]any) - if u.FirstName != nil { - structMap["first_name"] = u.FirstName - } - if u.LastName != nil { - structMap["last_name"] = u.LastName - } - if u.FullNumber != nil { - structMap["full_number"] = u.FullNumber - } - if u.CardType != nil { - structMap["card_type"] = u.CardType - } - if u.ExpirationMonth != nil { - structMap["expiration_month"] = u.ExpirationMonth - } - if u.ExpirationYear != nil { - structMap["expiration_year"] = u.ExpirationYear - } - if u.CurrentVault != nil { - structMap["current_vault"] = u.CurrentVault - } - if u.BillingAddress != nil { - structMap["billing_address"] = u.BillingAddress - } - if u.BillingCity != nil { - structMap["billing_city"] = u.BillingCity - } - if u.BillingState != nil { - structMap["billing_state"] = u.BillingState - } - if u.BillingZip != nil { - structMap["billing_zip"] = u.BillingZip - } - if u.BillingCountry != nil { - structMap["billing_country"] = u.BillingCountry - } - if u.BillingAddress2.IsValueSet() { - structMap["billing_address_2"] = u.BillingAddress2.Value() - } - return structMap + structMap := make(map[string]any) + if u.FirstName != nil { + structMap["first_name"] = u.FirstName + } + if u.LastName != nil { + structMap["last_name"] = u.LastName + } + if u.FullNumber != nil { + structMap["full_number"] = u.FullNumber + } + if u.CardType != nil { + structMap["card_type"] = u.CardType + } + if u.ExpirationMonth != nil { + structMap["expiration_month"] = u.ExpirationMonth + } + if u.ExpirationYear != nil { + structMap["expiration_year"] = u.ExpirationYear + } + if u.CurrentVault != nil { + structMap["current_vault"] = u.CurrentVault + } + if u.BillingAddress != nil { + structMap["billing_address"] = u.BillingAddress + } + if u.BillingCity != nil { + structMap["billing_city"] = u.BillingCity + } + if u.BillingState != nil { + structMap["billing_state"] = u.BillingState + } + if u.BillingZip != nil { + structMap["billing_zip"] = u.BillingZip + } + if u.BillingCountry != nil { + structMap["billing_country"] = u.BillingCountry + } + if u.BillingAddress2.IsValueSet() { + structMap["billing_address_2"] = u.BillingAddress2.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfile. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfile. // It customizes the JSON unmarshaling process for UpdatePaymentProfile objects. func (u *UpdatePaymentProfile) UnmarshalJSON(input []byte) error { - temp := &struct { - FirstName *string `json:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty"` - FullNumber *string `json:"full_number,omitempty"` - CardType *CardType `json:"card_type,omitempty"` - ExpirationMonth *string `json:"expiration_month,omitempty"` - ExpirationYear *string `json:"expiration_year,omitempty"` - CurrentVault *CurrentVault `json:"current_vault,omitempty"` - BillingAddress *string `json:"billing_address,omitempty"` - BillingCity *string `json:"billing_city,omitempty"` - BillingState *string `json:"billing_state,omitempty"` - BillingZip *string `json:"billing_zip,omitempty"` - BillingCountry *string `json:"billing_country,omitempty"` - BillingAddress2 Optional[string] `json:"billing_address_2"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.FirstName = temp.FirstName - u.LastName = temp.LastName - u.FullNumber = temp.FullNumber - u.CardType = temp.CardType - u.ExpirationMonth = temp.ExpirationMonth - u.ExpirationYear = temp.ExpirationYear - u.CurrentVault = temp.CurrentVault - u.BillingAddress = temp.BillingAddress - u.BillingCity = temp.BillingCity - u.BillingState = temp.BillingState - u.BillingZip = temp.BillingZip - u.BillingCountry = temp.BillingCountry - u.BillingAddress2 = temp.BillingAddress2 - return nil + temp := &struct { + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + FullNumber *string `json:"full_number,omitempty"` + CardType *CardType `json:"card_type,omitempty"` + ExpirationMonth *string `json:"expiration_month,omitempty"` + ExpirationYear *string `json:"expiration_year,omitempty"` + CurrentVault *CurrentVault `json:"current_vault,omitempty"` + BillingAddress *string `json:"billing_address,omitempty"` + BillingCity *string `json:"billing_city,omitempty"` + BillingState *string `json:"billing_state,omitempty"` + BillingZip *string `json:"billing_zip,omitempty"` + BillingCountry *string `json:"billing_country,omitempty"` + BillingAddress2 Optional[string] `json:"billing_address_2"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.FirstName = temp.FirstName + u.LastName = temp.LastName + u.FullNumber = temp.FullNumber + u.CardType = temp.CardType + u.ExpirationMonth = temp.ExpirationMonth + u.ExpirationYear = temp.ExpirationYear + u.CurrentVault = temp.CurrentVault + u.BillingAddress = temp.BillingAddress + u.BillingCity = temp.BillingCity + u.BillingState = temp.BillingState + u.BillingZip = temp.BillingZip + u.BillingCountry = temp.BillingCountry + u.BillingAddress2 = temp.BillingAddress2 + return nil } diff --git a/models/update_payment_profile_request.go b/models/update_payment_profile_request.go index 46ed9431..53db14ff 100644 --- a/models/update_payment_profile_request.go +++ b/models/update_payment_profile_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdatePaymentProfileRequest represents a UpdatePaymentProfileRequest struct. type UpdatePaymentProfileRequest struct { - PaymentProfile UpdatePaymentProfile `json:"payment_profile"` + PaymentProfile UpdatePaymentProfile `json:"payment_profile"` } -// MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfileRequest. +// MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfileRequest. // It customizes the JSON marshaling process for UpdatePaymentProfileRequest objects. func (u *UpdatePaymentProfileRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdatePaymentProfileRequest object to a map representation for JSON marshaling. func (u *UpdatePaymentProfileRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["payment_profile"] = u.PaymentProfile - return structMap + structMap := make(map[string]any) + structMap["payment_profile"] = u.PaymentProfile.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfileRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfileRequest. // It customizes the JSON unmarshaling process for UpdatePaymentProfileRequest objects. func (u *UpdatePaymentProfileRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PaymentProfile UpdatePaymentProfile `json:"payment_profile"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.PaymentProfile = temp.PaymentProfile - return nil + temp := &struct { + PaymentProfile UpdatePaymentProfile `json:"payment_profile"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.PaymentProfile = temp.PaymentProfile + return nil } diff --git a/models/update_price.go b/models/update_price.go index d5c31c38..a69dfb36 100644 --- a/models/update_price.go +++ b/models/update_price.go @@ -1,67 +1,67 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdatePrice represents a UpdatePrice struct. type UpdatePrice struct { - Id *int `json:"id,omitempty"` - EndingQuantity *interface{} `json:"ending_quantity,omitempty"` - // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 - UnitPrice *interface{} `json:"unit_price,omitempty"` - Destroy *bool `json:"_destroy,omitempty"` - StartingQuantity *interface{} `json:"starting_quantity,omitempty"` + Id *int `json:"id,omitempty"` + EndingQuantity *interface{} `json:"ending_quantity,omitempty"` + // The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + UnitPrice *interface{} `json:"unit_price,omitempty"` + Destroy *bool `json:"_destroy,omitempty"` + StartingQuantity *interface{} `json:"starting_quantity,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdatePrice. +// MarshalJSON implements the json.Marshaler interface for UpdatePrice. // It customizes the JSON marshaling process for UpdatePrice objects. func (u *UpdatePrice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdatePrice object to a map representation for JSON marshaling. func (u *UpdatePrice) toMap() map[string]any { - structMap := make(map[string]any) - if u.Id != nil { - structMap["id"] = u.Id - } - if u.EndingQuantity != nil { - structMap["ending_quantity"] = u.EndingQuantity - } - if u.UnitPrice != nil { - structMap["unit_price"] = u.UnitPrice - } - if u.Destroy != nil { - structMap["_destroy"] = u.Destroy - } - if u.StartingQuantity != nil { - structMap["starting_quantity"] = u.StartingQuantity - } - return structMap + structMap := make(map[string]any) + if u.Id != nil { + structMap["id"] = u.Id + } + if u.EndingQuantity != nil { + structMap["ending_quantity"] = u.EndingQuantity + } + if u.UnitPrice != nil { + structMap["unit_price"] = u.UnitPrice + } + if u.Destroy != nil { + structMap["_destroy"] = u.Destroy + } + if u.StartingQuantity != nil { + structMap["starting_quantity"] = u.StartingQuantity + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePrice. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdatePrice. // It customizes the JSON unmarshaling process for UpdatePrice objects. func (u *UpdatePrice) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int `json:"id,omitempty"` - EndingQuantity *interface{} `json:"ending_quantity,omitempty"` - UnitPrice *interface{} `json:"unit_price,omitempty"` - Destroy *bool `json:"_destroy,omitempty"` - StartingQuantity *interface{} `json:"starting_quantity,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Id = temp.Id - u.EndingQuantity = temp.EndingQuantity - u.UnitPrice = temp.UnitPrice - u.Destroy = temp.Destroy - u.StartingQuantity = temp.StartingQuantity - return nil + temp := &struct { + Id *int `json:"id,omitempty"` + EndingQuantity *interface{} `json:"ending_quantity,omitempty"` + UnitPrice *interface{} `json:"unit_price,omitempty"` + Destroy *bool `json:"_destroy,omitempty"` + StartingQuantity *interface{} `json:"starting_quantity,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Id = temp.Id + u.EndingQuantity = temp.EndingQuantity + u.UnitPrice = temp.UnitPrice + u.Destroy = temp.Destroy + u.StartingQuantity = temp.StartingQuantity + return nil } diff --git a/models/update_product_price_point.go b/models/update_product_price_point.go index 51c973e5..93df2e9d 100644 --- a/models/update_product_price_point.go +++ b/models/update_product_price_point.go @@ -1,48 +1,48 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateProductPricePoint represents a UpdateProductPricePoint struct. type UpdateProductPricePoint struct { - Handle *string `json:"handle,omitempty"` - PriceInCents *int64 `json:"price_in_cents,omitempty"` + Handle *string `json:"handle,omitempty"` + PriceInCents *int64 `json:"price_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateProductPricePoint. +// MarshalJSON implements the json.Marshaler interface for UpdateProductPricePoint. // It customizes the JSON marshaling process for UpdateProductPricePoint objects. func (u *UpdateProductPricePoint) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateProductPricePoint object to a map representation for JSON marshaling. func (u *UpdateProductPricePoint) toMap() map[string]any { - structMap := make(map[string]any) - if u.Handle != nil { - structMap["handle"] = u.Handle - } - if u.PriceInCents != nil { - structMap["price_in_cents"] = u.PriceInCents - } - return structMap + structMap := make(map[string]any) + if u.Handle != nil { + structMap["handle"] = u.Handle + } + if u.PriceInCents != nil { + structMap["price_in_cents"] = u.PriceInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePoint. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePoint. // It customizes the JSON unmarshaling process for UpdateProductPricePoint objects. func (u *UpdateProductPricePoint) UnmarshalJSON(input []byte) error { - temp := &struct { - Handle *string `json:"handle,omitempty"` - PriceInCents *int64 `json:"price_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Handle = temp.Handle - u.PriceInCents = temp.PriceInCents - return nil + temp := &struct { + Handle *string `json:"handle,omitempty"` + PriceInCents *int64 `json:"price_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Handle = temp.Handle + u.PriceInCents = temp.PriceInCents + return nil } diff --git a/models/update_product_price_point_request.go b/models/update_product_price_point_request.go index fe3b5d89..0afaae38 100644 --- a/models/update_product_price_point_request.go +++ b/models/update_product_price_point_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateProductPricePointRequest represents a UpdateProductPricePointRequest struct. type UpdateProductPricePointRequest struct { - PricePoint UpdateProductPricePoint `json:"price_point"` + PricePoint UpdateProductPricePoint `json:"price_point"` } -// MarshalJSON implements the json.Marshaler interface for UpdateProductPricePointRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateProductPricePointRequest. // It customizes the JSON marshaling process for UpdateProductPricePointRequest objects. func (u *UpdateProductPricePointRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateProductPricePointRequest object to a map representation for JSON marshaling. func (u *UpdateProductPricePointRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["price_point"] = u.PricePoint - return structMap + structMap := make(map[string]any) + structMap["price_point"] = u.PricePoint.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePointRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePointRequest. // It customizes the JSON unmarshaling process for UpdateProductPricePointRequest objects. func (u *UpdateProductPricePointRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PricePoint UpdateProductPricePoint `json:"price_point"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.PricePoint = temp.PricePoint - return nil + temp := &struct { + PricePoint UpdateProductPricePoint `json:"price_point"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.PricePoint = temp.PricePoint + return nil } diff --git a/models/update_reason_code.go b/models/update_reason_code.go index e15d7a14..6c8200a1 100644 --- a/models/update_reason_code.go +++ b/models/update_reason_code.go @@ -1,57 +1,57 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateReasonCode represents a UpdateReasonCode struct. type UpdateReasonCode struct { - // The unique identifier for the ReasonCode - Code *string `json:"code,omitempty"` - // The friendly summary of what the code signifies - Description *string `json:"description,omitempty"` - // The order that code appears in lists - Position *int `json:"position,omitempty"` + // The unique identifier for the ReasonCode + Code *string `json:"code,omitempty"` + // The friendly summary of what the code signifies + Description *string `json:"description,omitempty"` + // The order that code appears in lists + Position *int `json:"position,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateReasonCode. +// MarshalJSON implements the json.Marshaler interface for UpdateReasonCode. // It customizes the JSON marshaling process for UpdateReasonCode objects. func (u *UpdateReasonCode) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateReasonCode object to a map representation for JSON marshaling. func (u *UpdateReasonCode) toMap() map[string]any { - structMap := make(map[string]any) - if u.Code != nil { - structMap["code"] = u.Code - } - if u.Description != nil { - structMap["description"] = u.Description - } - if u.Position != nil { - structMap["position"] = u.Position - } - return structMap + structMap := make(map[string]any) + if u.Code != nil { + structMap["code"] = u.Code + } + if u.Description != nil { + structMap["description"] = u.Description + } + if u.Position != nil { + structMap["position"] = u.Position + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCode. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCode. // It customizes the JSON unmarshaling process for UpdateReasonCode objects. func (u *UpdateReasonCode) UnmarshalJSON(input []byte) error { - temp := &struct { - Code *string `json:"code,omitempty"` - Description *string `json:"description,omitempty"` - Position *int `json:"position,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Code = temp.Code - u.Description = temp.Description - u.Position = temp.Position - return nil + temp := &struct { + Code *string `json:"code,omitempty"` + Description *string `json:"description,omitempty"` + Position *int `json:"position,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Code = temp.Code + u.Description = temp.Description + u.Position = temp.Position + return nil } diff --git a/models/update_reason_code_request.go b/models/update_reason_code_request.go index a2e6eebc..4fd881c5 100644 --- a/models/update_reason_code_request.go +++ b/models/update_reason_code_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateReasonCodeRequest represents a UpdateReasonCodeRequest struct. type UpdateReasonCodeRequest struct { - ReasonCode UpdateReasonCode `json:"reason_code"` + ReasonCode UpdateReasonCode `json:"reason_code"` } -// MarshalJSON implements the json.Marshaler interface for UpdateReasonCodeRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateReasonCodeRequest. // It customizes the JSON marshaling process for UpdateReasonCodeRequest objects. func (u *UpdateReasonCodeRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateReasonCodeRequest object to a map representation for JSON marshaling. func (u *UpdateReasonCodeRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["reason_code"] = u.ReasonCode - return structMap + structMap := make(map[string]any) + structMap["reason_code"] = u.ReasonCode.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCodeRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCodeRequest. // It customizes the JSON unmarshaling process for UpdateReasonCodeRequest objects. func (u *UpdateReasonCodeRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - ReasonCode UpdateReasonCode `json:"reason_code"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.ReasonCode = temp.ReasonCode - return nil + temp := &struct { + ReasonCode UpdateReasonCode `json:"reason_code"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.ReasonCode = temp.ReasonCode + return nil } diff --git a/models/update_segment.go b/models/update_segment.go index 34e434f0..8d448913 100644 --- a/models/update_segment.go +++ b/models/update_segment.go @@ -1,47 +1,47 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSegment represents a UpdateSegment struct. type UpdateSegment struct { - // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` + // The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSegment. +// MarshalJSON implements the json.Marshaler interface for UpdateSegment. // It customizes the JSON marshaling process for UpdateSegment objects. func (u *UpdateSegment) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSegment object to a map representation for JSON marshaling. func (u *UpdateSegment) toMap() map[string]any { - structMap := make(map[string]any) - structMap["pricing_scheme"] = u.PricingScheme - if u.Prices != nil { - structMap["prices"] = u.Prices - } - return structMap + structMap := make(map[string]any) + structMap["pricing_scheme"] = u.PricingScheme + if u.Prices != nil { + structMap["prices"] = u.Prices + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegment. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegment. // It customizes the JSON unmarshaling process for UpdateSegment objects. func (u *UpdateSegment) UnmarshalJSON(input []byte) error { - temp := &struct { - PricingScheme PricingScheme `json:"pricing_scheme"` - Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.PricingScheme = temp.PricingScheme - u.Prices = temp.Prices - return nil + temp := &struct { + PricingScheme PricingScheme `json:"pricing_scheme"` + Prices []CreateOrUpdateSegmentPrice `json:"prices,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.PricingScheme = temp.PricingScheme + u.Prices = temp.Prices + return nil } diff --git a/models/update_segment_request.go b/models/update_segment_request.go index 0d4045fb..208553bf 100644 --- a/models/update_segment_request.go +++ b/models/update_segment_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSegmentRequest represents a UpdateSegmentRequest struct. type UpdateSegmentRequest struct { - Segment UpdateSegment `json:"segment"` + Segment UpdateSegment `json:"segment"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSegmentRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateSegmentRequest. // It customizes the JSON marshaling process for UpdateSegmentRequest objects. func (u *UpdateSegmentRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSegmentRequest object to a map representation for JSON marshaling. func (u *UpdateSegmentRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["segment"] = u.Segment - return structMap + structMap := make(map[string]any) + structMap["segment"] = u.Segment.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegmentRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegmentRequest. // It customizes the JSON unmarshaling process for UpdateSegmentRequest objects. func (u *UpdateSegmentRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Segment UpdateSegment `json:"segment"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Segment = temp.Segment - return nil + temp := &struct { + Segment UpdateSegment `json:"segment"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Segment = temp.Segment + return nil } diff --git a/models/update_subscription.go b/models/update_subscription.go index be8adc7c..53611f97 100644 --- a/models/update_subscription.go +++ b/models/update_subscription.go @@ -1,146 +1,146 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSubscription represents a UpdateSubscription struct. type UpdateSubscription struct { - CreditCardAttributes *CreditCardAttributes `json:"credit_card_attributes,omitempty"` - // Set to the handle of a different product to change the subscription's product - ProductHandle *string `json:"product_handle,omitempty"` - // Set to the id of a different product to change the subscription's product - ProductId *int `json:"product_id,omitempty"` - ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` - // Set to an empty string to cancel a delayed product change. - NextProductId *string `json:"next_product_id,omitempty"` - NextProductPricePointId *string `json:"next_product_price_point_id,omitempty"` - // Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. - SnapDay *interface{} `json:"snap_day,omitempty"` - NextBillingAt *string `json:"next_billing_at,omitempty"` - PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` - ReceivesInvoiceEmails *bool `json:"receives_invoice_emails,omitempty"` - NetTerms *interface{} `json:"net_terms,omitempty"` - StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` - Reference *string `json:"reference,omitempty"` - // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - // (Optional) An array of component ids and custom prices to be added to the subscription. - Components []UpdateSubscriptionComponent `json:"components,omitempty"` - // 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. - DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` - // Time zone for the Dunning Communication Delay feature. - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + CreditCardAttributes *CreditCardAttributes `json:"credit_card_attributes,omitempty"` + // Set to the handle of a different product to change the subscription's product + ProductHandle *string `json:"product_handle,omitempty"` + // Set to the id of a different product to change the subscription's product + ProductId *int `json:"product_id,omitempty"` + ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` + // Set to an empty string to cancel a delayed product change. + NextProductId *string `json:"next_product_id,omitempty"` + NextProductPricePointId *string `json:"next_product_price_point_id,omitempty"` + // Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'. + SnapDay *interface{} `json:"snap_day,omitempty"` + NextBillingAt *string `json:"next_billing_at,omitempty"` + PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` + ReceivesInvoiceEmails *bool `json:"receives_invoice_emails,omitempty"` + NetTerms *interface{} `json:"net_terms,omitempty"` + StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` + Reference *string `json:"reference,omitempty"` + // (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + // (Optional) An array of component ids and custom prices to be added to the subscription. + Components []UpdateSubscriptionComponent `json:"components,omitempty"` + // 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. + DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` + // Time zone for the Dunning Communication Delay feature. + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscription. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscription. // It customizes the JSON marshaling process for UpdateSubscription objects. func (u *UpdateSubscription) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscription object to a map representation for JSON marshaling. func (u *UpdateSubscription) toMap() map[string]any { - structMap := make(map[string]any) - if u.CreditCardAttributes != nil { - structMap["credit_card_attributes"] = u.CreditCardAttributes - } - if u.ProductHandle != nil { - structMap["product_handle"] = u.ProductHandle - } - if u.ProductId != nil { - structMap["product_id"] = u.ProductId - } - if u.ProductChangeDelayed != nil { - structMap["product_change_delayed"] = u.ProductChangeDelayed - } - if u.NextProductId != nil { - structMap["next_product_id"] = u.NextProductId - } - if u.NextProductPricePointId != nil { - structMap["next_product_price_point_id"] = u.NextProductPricePointId - } - if u.SnapDay != nil { - structMap["snap_day"] = u.SnapDay - } - if u.NextBillingAt != nil { - structMap["next_billing_at"] = u.NextBillingAt - } - if u.PaymentCollectionMethod != nil { - structMap["payment_collection_method"] = u.PaymentCollectionMethod - } - if u.ReceivesInvoiceEmails != nil { - structMap["receives_invoice_emails"] = u.ReceivesInvoiceEmails - } - if u.NetTerms != nil { - structMap["net_terms"] = u.NetTerms - } - if u.StoredCredentialTransactionId != nil { - structMap["stored_credential_transaction_id"] = u.StoredCredentialTransactionId - } - if u.Reference != nil { - structMap["reference"] = u.Reference - } - if u.CustomPrice != nil { - structMap["custom_price"] = u.CustomPrice - } - if u.Components != nil { - structMap["components"] = u.Components - } - if u.DunningCommunicationDelayEnabled.IsValueSet() { - structMap["dunning_communication_delay_enabled"] = u.DunningCommunicationDelayEnabled.Value() - } - if u.DunningCommunicationDelayTimeZone.IsValueSet() { - structMap["dunning_communication_delay_time_zone"] = u.DunningCommunicationDelayTimeZone.Value() - } - return structMap + structMap := make(map[string]any) + if u.CreditCardAttributes != nil { + structMap["credit_card_attributes"] = u.CreditCardAttributes.toMap() + } + if u.ProductHandle != nil { + structMap["product_handle"] = u.ProductHandle + } + if u.ProductId != nil { + structMap["product_id"] = u.ProductId + } + if u.ProductChangeDelayed != nil { + structMap["product_change_delayed"] = u.ProductChangeDelayed + } + if u.NextProductId != nil { + structMap["next_product_id"] = u.NextProductId + } + if u.NextProductPricePointId != nil { + structMap["next_product_price_point_id"] = u.NextProductPricePointId + } + if u.SnapDay != nil { + structMap["snap_day"] = u.SnapDay + } + if u.NextBillingAt != nil { + structMap["next_billing_at"] = u.NextBillingAt + } + if u.PaymentCollectionMethod != nil { + structMap["payment_collection_method"] = u.PaymentCollectionMethod + } + if u.ReceivesInvoiceEmails != nil { + structMap["receives_invoice_emails"] = u.ReceivesInvoiceEmails + } + if u.NetTerms != nil { + structMap["net_terms"] = u.NetTerms + } + if u.StoredCredentialTransactionId != nil { + structMap["stored_credential_transaction_id"] = u.StoredCredentialTransactionId + } + if u.Reference != nil { + structMap["reference"] = u.Reference + } + if u.CustomPrice != nil { + structMap["custom_price"] = u.CustomPrice.toMap() + } + if u.Components != nil { + structMap["components"] = u.Components + } + if u.DunningCommunicationDelayEnabled.IsValueSet() { + structMap["dunning_communication_delay_enabled"] = u.DunningCommunicationDelayEnabled.Value() + } + if u.DunningCommunicationDelayTimeZone.IsValueSet() { + structMap["dunning_communication_delay_time_zone"] = u.DunningCommunicationDelayTimeZone.Value() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscription. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscription. // It customizes the JSON unmarshaling process for UpdateSubscription objects. func (u *UpdateSubscription) UnmarshalJSON(input []byte) error { - temp := &struct { - CreditCardAttributes *CreditCardAttributes `json:"credit_card_attributes,omitempty"` - ProductHandle *string `json:"product_handle,omitempty"` - ProductId *int `json:"product_id,omitempty"` - ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` - NextProductId *string `json:"next_product_id,omitempty"` - NextProductPricePointId *string `json:"next_product_price_point_id,omitempty"` - SnapDay *interface{} `json:"snap_day,omitempty"` - NextBillingAt *string `json:"next_billing_at,omitempty"` - PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` - ReceivesInvoiceEmails *bool `json:"receives_invoice_emails,omitempty"` - NetTerms *interface{} `json:"net_terms,omitempty"` - StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` - Reference *string `json:"reference,omitempty"` - CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` - Components []UpdateSubscriptionComponent `json:"components,omitempty"` - DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` - DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.CreditCardAttributes = temp.CreditCardAttributes - u.ProductHandle = temp.ProductHandle - u.ProductId = temp.ProductId - u.ProductChangeDelayed = temp.ProductChangeDelayed - u.NextProductId = temp.NextProductId - u.NextProductPricePointId = temp.NextProductPricePointId - u.SnapDay = temp.SnapDay - u.NextBillingAt = temp.NextBillingAt - u.PaymentCollectionMethod = temp.PaymentCollectionMethod - u.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails - u.NetTerms = temp.NetTerms - u.StoredCredentialTransactionId = temp.StoredCredentialTransactionId - u.Reference = temp.Reference - u.CustomPrice = temp.CustomPrice - u.Components = temp.Components - u.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled - u.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone - return nil + temp := &struct { + CreditCardAttributes *CreditCardAttributes `json:"credit_card_attributes,omitempty"` + ProductHandle *string `json:"product_handle,omitempty"` + ProductId *int `json:"product_id,omitempty"` + ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"` + NextProductId *string `json:"next_product_id,omitempty"` + NextProductPricePointId *string `json:"next_product_price_point_id,omitempty"` + SnapDay *interface{} `json:"snap_day,omitempty"` + NextBillingAt *string `json:"next_billing_at,omitempty"` + PaymentCollectionMethod *string `json:"payment_collection_method,omitempty"` + ReceivesInvoiceEmails *bool `json:"receives_invoice_emails,omitempty"` + NetTerms *interface{} `json:"net_terms,omitempty"` + StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"` + Reference *string `json:"reference,omitempty"` + CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"` + Components []UpdateSubscriptionComponent `json:"components,omitempty"` + DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"` + DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.CreditCardAttributes = temp.CreditCardAttributes + u.ProductHandle = temp.ProductHandle + u.ProductId = temp.ProductId + u.ProductChangeDelayed = temp.ProductChangeDelayed + u.NextProductId = temp.NextProductId + u.NextProductPricePointId = temp.NextProductPricePointId + u.SnapDay = temp.SnapDay + u.NextBillingAt = temp.NextBillingAt + u.PaymentCollectionMethod = temp.PaymentCollectionMethod + u.ReceivesInvoiceEmails = temp.ReceivesInvoiceEmails + u.NetTerms = temp.NetTerms + u.StoredCredentialTransactionId = temp.StoredCredentialTransactionId + u.Reference = temp.Reference + u.CustomPrice = temp.CustomPrice + u.Components = temp.Components + u.DunningCommunicationDelayEnabled = temp.DunningCommunicationDelayEnabled + u.DunningCommunicationDelayTimeZone = temp.DunningCommunicationDelayTimeZone + return nil } diff --git a/models/update_subscription_component.go b/models/update_subscription_component.go index 5357ced4..5c98132c 100644 --- a/models/update_subscription_component.go +++ b/models/update_subscription_component.go @@ -1,49 +1,49 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSubscriptionComponent represents a UpdateSubscriptionComponent struct. type UpdateSubscriptionComponent struct { - ComponentId *int `json:"component_id,omitempty"` - // Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. - CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + // Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. + CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionComponent. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionComponent. // It customizes the JSON marshaling process for UpdateSubscriptionComponent objects. func (u *UpdateSubscriptionComponent) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionComponent object to a map representation for JSON marshaling. func (u *UpdateSubscriptionComponent) toMap() map[string]any { - structMap := make(map[string]any) - if u.ComponentId != nil { - structMap["component_id"] = u.ComponentId - } - if u.CustomPrice != nil { - structMap["custom_price"] = u.CustomPrice - } - return structMap + structMap := make(map[string]any) + if u.ComponentId != nil { + structMap["component_id"] = u.ComponentId + } + if u.CustomPrice != nil { + structMap["custom_price"] = u.CustomPrice.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionComponent. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionComponent. // It customizes the JSON unmarshaling process for UpdateSubscriptionComponent objects. func (u *UpdateSubscriptionComponent) UnmarshalJSON(input []byte) error { - temp := &struct { - ComponentId *int `json:"component_id,omitempty"` - CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.ComponentId = temp.ComponentId - u.CustomPrice = temp.CustomPrice - return nil + temp := &struct { + ComponentId *int `json:"component_id,omitempty"` + CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.ComponentId = temp.ComponentId + u.CustomPrice = temp.CustomPrice + return nil } diff --git a/models/update_subscription_group.go b/models/update_subscription_group.go index 9ca44d0f..9d9ebd1d 100644 --- a/models/update_subscription_group.go +++ b/models/update_subscription_group.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSubscriptionGroup represents a UpdateSubscriptionGroup struct. type UpdateSubscriptionGroup struct { - MemberIds []int `json:"member_ids,omitempty"` + MemberIds []int `json:"member_ids,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroup. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroup. // It customizes the JSON marshaling process for UpdateSubscriptionGroup objects. func (u *UpdateSubscriptionGroup) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionGroup object to a map representation for JSON marshaling. func (u *UpdateSubscriptionGroup) toMap() map[string]any { - structMap := make(map[string]any) - if u.MemberIds != nil { - structMap["member_ids"] = u.MemberIds - } - return structMap + structMap := make(map[string]any) + if u.MemberIds != nil { + structMap["member_ids"] = u.MemberIds + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroup. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroup. // It customizes the JSON unmarshaling process for UpdateSubscriptionGroup objects. func (u *UpdateSubscriptionGroup) UnmarshalJSON(input []byte) error { - temp := &struct { - MemberIds []int `json:"member_ids,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.MemberIds = temp.MemberIds - return nil + temp := &struct { + MemberIds []int `json:"member_ids,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.MemberIds = temp.MemberIds + return nil } diff --git a/models/update_subscription_group_request.go b/models/update_subscription_group_request.go index 3bb8023d..0860e92e 100644 --- a/models/update_subscription_group_request.go +++ b/models/update_subscription_group_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSubscriptionGroupRequest represents a UpdateSubscriptionGroupRequest struct. type UpdateSubscriptionGroupRequest struct { - SubscriptionGroup UpdateSubscriptionGroup `json:"subscription_group"` + SubscriptionGroup UpdateSubscriptionGroup `json:"subscription_group"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroupRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroupRequest. // It customizes the JSON marshaling process for UpdateSubscriptionGroupRequest objects. func (u *UpdateSubscriptionGroupRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionGroupRequest object to a map representation for JSON marshaling. func (u *UpdateSubscriptionGroupRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription_group"] = u.SubscriptionGroup - return structMap + structMap := make(map[string]any) + structMap["subscription_group"] = u.SubscriptionGroup.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroupRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroupRequest. // It customizes the JSON unmarshaling process for UpdateSubscriptionGroupRequest objects. func (u *UpdateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - SubscriptionGroup UpdateSubscriptionGroup `json:"subscription_group"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.SubscriptionGroup = temp.SubscriptionGroup - return nil + temp := &struct { + SubscriptionGroup UpdateSubscriptionGroup `json:"subscription_group"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.SubscriptionGroup = temp.SubscriptionGroup + return nil } diff --git a/models/update_subscription_note.go b/models/update_subscription_note.go index d961d6a7..a7865fdb 100644 --- a/models/update_subscription_note.go +++ b/models/update_subscription_note.go @@ -1,45 +1,45 @@ package models import ( - "encoding/json" + "encoding/json" ) -// UpdateSubscriptionNote represents a UpdateSubscriptionNote struct. +// UpdateSubscriptionNote represents a UpdateSubscriptionNote struct. // Updatable fields for Subscription Note type UpdateSubscriptionNote struct { - Body string `json:"body"` - Sticky bool `json:"sticky"` + Body string `json:"body"` + Sticky bool `json:"sticky"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNote. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNote. // It customizes the JSON marshaling process for UpdateSubscriptionNote objects. func (u *UpdateSubscriptionNote) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionNote object to a map representation for JSON marshaling. func (u *UpdateSubscriptionNote) toMap() map[string]any { - structMap := make(map[string]any) - structMap["body"] = u.Body - structMap["sticky"] = u.Sticky - return structMap + structMap := make(map[string]any) + structMap["body"] = u.Body + structMap["sticky"] = u.Sticky + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNote. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNote. // It customizes the JSON unmarshaling process for UpdateSubscriptionNote objects. func (u *UpdateSubscriptionNote) UnmarshalJSON(input []byte) error { - temp := &struct { - Body string `json:"body"` - Sticky bool `json:"sticky"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Body = temp.Body - u.Sticky = temp.Sticky - return nil + temp := &struct { + Body string `json:"body"` + Sticky bool `json:"sticky"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Body = temp.Body + u.Sticky = temp.Sticky + return nil } diff --git a/models/update_subscription_note_request.go b/models/update_subscription_note_request.go index c57ee44a..83ea2eb5 100644 --- a/models/update_subscription_note_request.go +++ b/models/update_subscription_note_request.go @@ -1,42 +1,42 @@ package models import ( - "encoding/json" + "encoding/json" ) -// UpdateSubscriptionNoteRequest represents a UpdateSubscriptionNoteRequest struct. +// UpdateSubscriptionNoteRequest represents a UpdateSubscriptionNoteRequest struct. // Updatable fields for Subscription Note type UpdateSubscriptionNoteRequest struct { - // Updatable fields for Subscription Note - Note UpdateSubscriptionNote `json:"note"` + // Updatable fields for Subscription Note + Note UpdateSubscriptionNote `json:"note"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNoteRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNoteRequest. // It customizes the JSON marshaling process for UpdateSubscriptionNoteRequest objects. func (u *UpdateSubscriptionNoteRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionNoteRequest object to a map representation for JSON marshaling. func (u *UpdateSubscriptionNoteRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["note"] = u.Note - return structMap + structMap := make(map[string]any) + structMap["note"] = u.Note.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNoteRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNoteRequest. // It customizes the JSON unmarshaling process for UpdateSubscriptionNoteRequest objects. func (u *UpdateSubscriptionNoteRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Note UpdateSubscriptionNote `json:"note"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Note = temp.Note - return nil + temp := &struct { + Note UpdateSubscriptionNote `json:"note"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Note = temp.Note + return nil } diff --git a/models/update_subscription_request.go b/models/update_subscription_request.go index c5da0ee7..a35bb9f8 100644 --- a/models/update_subscription_request.go +++ b/models/update_subscription_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpdateSubscriptionRequest represents a UpdateSubscriptionRequest struct. type UpdateSubscriptionRequest struct { - Subscription UpdateSubscription `json:"subscription"` + Subscription UpdateSubscription `json:"subscription"` } -// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionRequest. +// MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionRequest. // It customizes the JSON marshaling process for UpdateSubscriptionRequest objects. func (u *UpdateSubscriptionRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpdateSubscriptionRequest object to a map representation for JSON marshaling. func (u *UpdateSubscriptionRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["subscription"] = u.Subscription - return structMap + structMap := make(map[string]any) + structMap["subscription"] = u.Subscription.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionRequest. // It customizes the JSON unmarshaling process for UpdateSubscriptionRequest objects. func (u *UpdateSubscriptionRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Subscription UpdateSubscription `json:"subscription"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Subscription = temp.Subscription - return nil + temp := &struct { + Subscription UpdateSubscription `json:"subscription"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Subscription = temp.Subscription + return nil } diff --git a/models/upsert_prepaid_configuration.go b/models/upsert_prepaid_configuration.go index 3a6ad301..848644e1 100644 --- a/models/upsert_prepaid_configuration.go +++ b/models/upsert_prepaid_configuration.go @@ -1,60 +1,60 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpsertPrepaidConfiguration represents a UpsertPrepaidConfiguration struct. type UpsertPrepaidConfiguration struct { - InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` - ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` - AutoReplenish *bool `json:"auto_replenish,omitempty"` - ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` + InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` + ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` + AutoReplenish *bool `json:"auto_replenish,omitempty"` + ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfiguration. +// MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfiguration. // It customizes the JSON marshaling process for UpsertPrepaidConfiguration objects. func (u *UpsertPrepaidConfiguration) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpsertPrepaidConfiguration object to a map representation for JSON marshaling. func (u *UpsertPrepaidConfiguration) toMap() map[string]any { - structMap := make(map[string]any) - if u.InitialFundingAmountInCents != nil { - structMap["initial_funding_amount_in_cents"] = u.InitialFundingAmountInCents - } - if u.ReplenishToAmountInCents != nil { - structMap["replenish_to_amount_in_cents"] = u.ReplenishToAmountInCents - } - if u.AutoReplenish != nil { - structMap["auto_replenish"] = u.AutoReplenish - } - if u.ReplenishThresholdAmountInCents != nil { - structMap["replenish_threshold_amount_in_cents"] = u.ReplenishThresholdAmountInCents - } - return structMap + structMap := make(map[string]any) + if u.InitialFundingAmountInCents != nil { + structMap["initial_funding_amount_in_cents"] = u.InitialFundingAmountInCents + } + if u.ReplenishToAmountInCents != nil { + structMap["replenish_to_amount_in_cents"] = u.ReplenishToAmountInCents + } + if u.AutoReplenish != nil { + structMap["auto_replenish"] = u.AutoReplenish + } + if u.ReplenishThresholdAmountInCents != nil { + structMap["replenish_threshold_amount_in_cents"] = u.ReplenishThresholdAmountInCents + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfiguration. +// UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfiguration. // It customizes the JSON unmarshaling process for UpsertPrepaidConfiguration objects. func (u *UpsertPrepaidConfiguration) UnmarshalJSON(input []byte) error { - temp := &struct { - InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` - ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` - AutoReplenish *bool `json:"auto_replenish,omitempty"` - ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.InitialFundingAmountInCents = temp.InitialFundingAmountInCents - u.ReplenishToAmountInCents = temp.ReplenishToAmountInCents - u.AutoReplenish = temp.AutoReplenish - u.ReplenishThresholdAmountInCents = temp.ReplenishThresholdAmountInCents - return nil + temp := &struct { + InitialFundingAmountInCents *int64 `json:"initial_funding_amount_in_cents,omitempty"` + ReplenishToAmountInCents *int64 `json:"replenish_to_amount_in_cents,omitempty"` + AutoReplenish *bool `json:"auto_replenish,omitempty"` + ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.InitialFundingAmountInCents = temp.InitialFundingAmountInCents + u.ReplenishToAmountInCents = temp.ReplenishToAmountInCents + u.AutoReplenish = temp.AutoReplenish + u.ReplenishThresholdAmountInCents = temp.ReplenishThresholdAmountInCents + return nil } diff --git a/models/upsert_prepaid_configuration_request.go b/models/upsert_prepaid_configuration_request.go index a39c95cf..15abf5f2 100644 --- a/models/upsert_prepaid_configuration_request.go +++ b/models/upsert_prepaid_configuration_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UpsertPrepaidConfigurationRequest represents a UpsertPrepaidConfigurationRequest struct. type UpsertPrepaidConfigurationRequest struct { - PrepaidConfiguration UpsertPrepaidConfiguration `json:"prepaid_configuration"` + PrepaidConfiguration UpsertPrepaidConfiguration `json:"prepaid_configuration"` } -// MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfigurationRequest. +// MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfigurationRequest. // It customizes the JSON marshaling process for UpsertPrepaidConfigurationRequest objects. func (u *UpsertPrepaidConfigurationRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UpsertPrepaidConfigurationRequest object to a map representation for JSON marshaling. func (u *UpsertPrepaidConfigurationRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["prepaid_configuration"] = u.PrepaidConfiguration - return structMap + structMap := make(map[string]any) + structMap["prepaid_configuration"] = u.PrepaidConfiguration.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfigurationRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfigurationRequest. // It customizes the JSON unmarshaling process for UpsertPrepaidConfigurationRequest objects. func (u *UpsertPrepaidConfigurationRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - PrepaidConfiguration UpsertPrepaidConfiguration `json:"prepaid_configuration"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.PrepaidConfiguration = temp.PrepaidConfiguration - return nil + temp := &struct { + PrepaidConfiguration UpsertPrepaidConfiguration `json:"prepaid_configuration"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.PrepaidConfiguration = temp.PrepaidConfiguration + return nil } diff --git a/models/usage.go b/models/usage.go index 47135302..73a2fef3 100644 --- a/models/usage.go +++ b/models/usage.go @@ -1,98 +1,98 @@ package models import ( - "encoding/json" - "log" - "time" + "encoding/json" + "log" + "time" ) // Usage represents a Usage struct. type Usage struct { - Id *int64 `json:"id,omitempty"` - Memo *string `json:"memo,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - Quantity *interface{} `json:"quantity,omitempty"` - OverageQuantity *int `json:"overage_quantity,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle *string `json:"component_handle,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` + Id *int64 `json:"id,omitempty"` + Memo *string `json:"memo,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + Quantity *interface{} `json:"quantity,omitempty"` + OverageQuantity *int `json:"overage_quantity,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle *string `json:"component_handle,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Usage. +// MarshalJSON implements the json.Marshaler interface for Usage. // It customizes the JSON marshaling process for Usage objects. func (u *Usage) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the Usage object to a map representation for JSON marshaling. func (u *Usage) toMap() map[string]any { - structMap := make(map[string]any) - if u.Id != nil { - structMap["id"] = u.Id - } - if u.Memo != nil { - structMap["memo"] = u.Memo - } - if u.CreatedAt != nil { - structMap["created_at"] = u.CreatedAt.Format(time.RFC3339) - } - if u.PricePointId != nil { - structMap["price_point_id"] = u.PricePointId - } - if u.Quantity != nil { - structMap["quantity"] = u.Quantity - } - if u.OverageQuantity != nil { - structMap["overage_quantity"] = u.OverageQuantity - } - if u.ComponentId != nil { - structMap["component_id"] = u.ComponentId - } - if u.ComponentHandle != nil { - structMap["component_handle"] = u.ComponentHandle - } - if u.SubscriptionId != nil { - structMap["subscription_id"] = u.SubscriptionId - } - return structMap + structMap := make(map[string]any) + if u.Id != nil { + structMap["id"] = u.Id + } + if u.Memo != nil { + structMap["memo"] = u.Memo + } + if u.CreatedAt != nil { + structMap["created_at"] = u.CreatedAt.Format(time.RFC3339) + } + if u.PricePointId != nil { + structMap["price_point_id"] = u.PricePointId + } + if u.Quantity != nil { + structMap["quantity"] = u.Quantity + } + if u.OverageQuantity != nil { + structMap["overage_quantity"] = u.OverageQuantity + } + if u.ComponentId != nil { + structMap["component_id"] = u.ComponentId + } + if u.ComponentHandle != nil { + structMap["component_handle"] = u.ComponentHandle + } + if u.SubscriptionId != nil { + structMap["subscription_id"] = u.SubscriptionId + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Usage. +// UnmarshalJSON implements the json.Unmarshaler interface for Usage. // It customizes the JSON unmarshaling process for Usage objects. func (u *Usage) UnmarshalJSON(input []byte) error { - temp := &struct { - Id *int64 `json:"id,omitempty"` - Memo *string `json:"memo,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - PricePointId *int `json:"price_point_id,omitempty"` - Quantity *interface{} `json:"quantity,omitempty"` - OverageQuantity *int `json:"overage_quantity,omitempty"` - ComponentId *int `json:"component_id,omitempty"` - ComponentHandle *string `json:"component_handle,omitempty"` - SubscriptionId *int `json:"subscription_id,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Id = temp.Id - u.Memo = temp.Memo - if temp.CreatedAt != nil { - CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) - if err != nil { - log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) - } - u.CreatedAt = &CreatedAtVal - } - u.PricePointId = temp.PricePointId - u.Quantity = temp.Quantity - u.OverageQuantity = temp.OverageQuantity - u.ComponentId = temp.ComponentId - u.ComponentHandle = temp.ComponentHandle - u.SubscriptionId = temp.SubscriptionId - return nil + temp := &struct { + Id *int64 `json:"id,omitempty"` + Memo *string `json:"memo,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + PricePointId *int `json:"price_point_id,omitempty"` + Quantity *interface{} `json:"quantity,omitempty"` + OverageQuantity *int `json:"overage_quantity,omitempty"` + ComponentId *int `json:"component_id,omitempty"` + ComponentHandle *string `json:"component_handle,omitempty"` + SubscriptionId *int `json:"subscription_id,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Id = temp.Id + u.Memo = temp.Memo + if temp.CreatedAt != nil { + CreatedAtVal, err := time.Parse(time.RFC3339, *temp.CreatedAt) + if err != nil { + log.Fatalf("Cannot Parse created_at as % s format.", time.RFC3339) + } + u.CreatedAt = &CreatedAtVal + } + u.PricePointId = temp.PricePointId + u.Quantity = temp.Quantity + u.OverageQuantity = temp.OverageQuantity + u.ComponentId = temp.ComponentId + u.ComponentHandle = temp.ComponentHandle + u.SubscriptionId = temp.SubscriptionId + return nil } diff --git a/models/usage_response.go b/models/usage_response.go index fa4d0f15..2405f3eb 100644 --- a/models/usage_response.go +++ b/models/usage_response.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // UsageResponse represents a UsageResponse struct. type UsageResponse struct { - Usage Usage `json:"usage"` + Usage Usage `json:"usage"` } -// MarshalJSON implements the json.Marshaler interface for UsageResponse. +// MarshalJSON implements the json.Marshaler interface for UsageResponse. // It customizes the JSON marshaling process for UsageResponse objects. func (u *UsageResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(u.toMap()) + []byte, + error) { + return json.Marshal(u.toMap()) } // toMap converts the UsageResponse object to a map representation for JSON marshaling. func (u *UsageResponse) toMap() map[string]any { - structMap := make(map[string]any) - structMap["usage"] = u.Usage - return structMap + structMap := make(map[string]any) + structMap["usage"] = u.Usage.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for UsageResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for UsageResponse. // It customizes the JSON unmarshaling process for UsageResponse objects. func (u *UsageResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Usage Usage `json:"usage"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - u.Usage = temp.Usage - return nil + temp := &struct { + Usage Usage `json:"usage"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + u.Usage = temp.Usage + return nil } diff --git a/models/utilities.go b/models/utilities.go index f06c6c4b..67e83797 100644 --- a/models/utilities.go +++ b/models/utilities.go @@ -1,90 +1,90 @@ -/* -Package advancedbilling - -This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). +/* +Package advancedbilling + +This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ package models import ( - "github.com/apimatic/go-core-runtime/https" - "github.com/apimatic/go-core-runtime/types" - "github.com/apimatic/go-core-runtime/utilities" - "net/http" + "github.com/apimatic/go-core-runtime/https" + "github.com/apimatic/go-core-runtime/types" + "github.com/apimatic/go-core-runtime/utilities" + "net/http" ) func ToPointer[T any](value T) *T { - return &value + return &value } -// FileWrapper is a struct that represents a file along with its metadata such as the +// FileWrapper is a struct that represents a file along with its metadata such as the // file content, file name, and file headers. type FileWrapper = https.FileWrapper -// GetFile retrieves a file from the given fileUrl and returns it as a FileWrapper. +// GetFile retrieves a file from the given fileUrl and returns it as a FileWrapper. // It makes an HTTP GET request to the fileUrl to fetch the file's content and metadata. -var GetFile = https.GetFile +var GetFile = https.GetFile -// Optional is a generic struct that allows any type to be used as optional and nullable. +// Optional is a generic struct that allows any type to be used as optional and nullable. // Optional.set is true when Optional.value is to be used. type Optional[T any] struct { - types.Optional[T] + types.Optional[T] } // NewOptional creates and returns an Optional instance with the given value set. func NewOptional[T any](value *T) Optional[T] { - return Optional[T]{ - Optional: types.NewOptional(value), - } + return Optional[T]{ + Optional: types.NewOptional(value), + } } // Value returns the value stored in the Optional. It returns nil if no value is set. func (o *Optional[T]) Value() *T { - return o.Optional.Value() + return o.Optional.Value() } // SetValue sets the value of the Optional. func (o *Optional[T]) SetValue(value *T) { - o.Optional.SetValue(value) + o.Optional.SetValue(value) } // IsValueSet returns true if a value is set in the Optional, false otherwise. func (o *Optional[T]) IsValueSet() bool { - return o.Optional.IsValueSet() + return o.Optional.IsValueSet() } // ShouldSetValue sets whether the value should be used or not. func (o *Optional[T]) ShouldSetValue(set bool) { - o.Optional.ShouldSetValue(set) + o.Optional.ShouldSetValue(set) } -// ApiResponse is a generic struct that represents an API response containing data and the HTTP response. -// The `Data` field holds the data of any type `T` returned by the API. +// ApiResponse is a generic struct that represents an API response containing data and the HTTP response. +// The `Data` field holds the data of any type `T` returned by the API. // The `Response` field contains the underlying HTTP response associated with the API call. type ApiResponse[T any] struct { - https.ApiResponse[T] + https.ApiResponse[T] } -// NewApiResponse creates a new instance of ApiResponse. +// NewApiResponse creates a new instance of ApiResponse. // It takes the `data` of type `T` and the `response` as parameters, and returns an ApiResponse[T] struct. func NewApiResponse[T any]( - data T, - response *http.Response) ApiResponse[T] { - return ApiResponse[T]{ - ApiResponse: https.NewApiResponse(data, response), - } + data T, + response *http.Response) ApiResponse[T] { + return ApiResponse[T]{ + ApiResponse: https.NewApiResponse(data, response), + } } // DEFAULT_DATE is a utility. -var DEFAULT_DATE = utilities.DEFAULT_DATE +var DEFAULT_DATE = utilities.DEFAULT_DATE // TimeToStringMap is a utility. -var TimeToStringMap = utilities.TimeToStringMap +var TimeToStringMap = utilities.TimeToStringMap // TimeToStringSlice is a utility. -var TimeToStringSlice = utilities.TimeToStringSlice +var TimeToStringSlice = utilities.TimeToStringSlice // ToTimeSlice is a utility. -var ToTimeSlice = utilities.ToTimeSlice +var ToTimeSlice = utilities.ToTimeSlice // ToTimeMap is a utility. -var ToTimeMap = utilities.ToTimeMap +var ToTimeMap = utilities.ToTimeMap diff --git a/models/void_invoice.go b/models/void_invoice.go index 238ab043..e307a6b4 100644 --- a/models/void_invoice.go +++ b/models/void_invoice.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // VoidInvoice represents a VoidInvoice struct. type VoidInvoice struct { - Reason string `json:"reason"` + Reason string `json:"reason"` } -// MarshalJSON implements the json.Marshaler interface for VoidInvoice. +// MarshalJSON implements the json.Marshaler interface for VoidInvoice. // It customizes the JSON marshaling process for VoidInvoice objects. func (v *VoidInvoice) MarshalJSON() ( - []byte, - error) { - return json.Marshal(v.toMap()) + []byte, + error) { + return json.Marshal(v.toMap()) } // toMap converts the VoidInvoice object to a map representation for JSON marshaling. func (v *VoidInvoice) toMap() map[string]any { - structMap := make(map[string]any) - structMap["reason"] = v.Reason - return structMap + structMap := make(map[string]any) + structMap["reason"] = v.Reason + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoice. +// UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoice. // It customizes the JSON unmarshaling process for VoidInvoice objects. func (v *VoidInvoice) UnmarshalJSON(input []byte) error { - temp := &struct { - Reason string `json:"reason"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - v.Reason = temp.Reason - return nil + temp := &struct { + Reason string `json:"reason"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + v.Reason = temp.Reason + return nil } diff --git a/models/void_invoice_request.go b/models/void_invoice_request.go index c39c9198..57f6b132 100644 --- a/models/void_invoice_request.go +++ b/models/void_invoice_request.go @@ -1,40 +1,40 @@ package models import ( - "encoding/json" + "encoding/json" ) // VoidInvoiceRequest represents a VoidInvoiceRequest struct. type VoidInvoiceRequest struct { - Void VoidInvoice `json:"void"` + Void VoidInvoice `json:"void"` } -// MarshalJSON implements the json.Marshaler interface for VoidInvoiceRequest. +// MarshalJSON implements the json.Marshaler interface for VoidInvoiceRequest. // It customizes the JSON marshaling process for VoidInvoiceRequest objects. func (v *VoidInvoiceRequest) MarshalJSON() ( - []byte, - error) { - return json.Marshal(v.toMap()) + []byte, + error) { + return json.Marshal(v.toMap()) } // toMap converts the VoidInvoiceRequest object to a map representation for JSON marshaling. func (v *VoidInvoiceRequest) toMap() map[string]any { - structMap := make(map[string]any) - structMap["void"] = v.Void - return structMap + structMap := make(map[string]any) + structMap["void"] = v.Void.toMap() + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoiceRequest. +// UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoiceRequest. // It customizes the JSON unmarshaling process for VoidInvoiceRequest objects. func (v *VoidInvoiceRequest) UnmarshalJSON(input []byte) error { - temp := &struct { - Void VoidInvoice `json:"void"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - v.Void = temp.Void - return nil + temp := &struct { + Void VoidInvoice `json:"void"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + v.Void = temp.Void + return nil } diff --git a/models/webhook.go b/models/webhook.go index dc652a2f..a4e47532 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -1,120 +1,120 @@ package models import ( - "encoding/json" + "encoding/json" ) // Webhook represents a Webhook struct. type Webhook struct { - // A string describing which event type produced the given webhook - Event *string `json:"event,omitempty"` - // 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 `json:"id,omitempty"` - // Timestamp indicating when the webhook was created - CreatedAt *string `json:"created_at,omitempty"` - // 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. - LastError *string `json:"last_error,omitempty"` - // Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. - LastErrorAt *string `json:"last_error_at,omitempty"` - // 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. - AcceptedAt Optional[string] `json:"accepted_at"` - // Timestamp indicating when the most recent attempt was made to send the webhook - LastSentAt *string `json:"last_sent_at,omitempty"` - // The url that the endpoint was last sent to. - LastSentUrl *string `json:"last_sent_url,omitempty"` - // 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 `json:"successful,omitempty"` - // The data sent within the webhook post - Body *string `json:"body,omitempty"` - // The calculated webhook signature - Signature *string `json:"signature,omitempty"` - // The calculated HMAC-SHA-256 webhook signature - SignatureHmacSha256 *string `json:"signature_hmac_sha_256,omitempty"` + // A string describing which event type produced the given webhook + Event *string `json:"event,omitempty"` + // 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 `json:"id,omitempty"` + // Timestamp indicating when the webhook was created + CreatedAt *string `json:"created_at,omitempty"` + // 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. + LastError *string `json:"last_error,omitempty"` + // Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. + LastErrorAt *string `json:"last_error_at,omitempty"` + // 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. + AcceptedAt Optional[string] `json:"accepted_at"` + // Timestamp indicating when the most recent attempt was made to send the webhook + LastSentAt *string `json:"last_sent_at,omitempty"` + // The url that the endpoint was last sent to. + LastSentUrl *string `json:"last_sent_url,omitempty"` + // 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 `json:"successful,omitempty"` + // The data sent within the webhook post + Body *string `json:"body,omitempty"` + // The calculated webhook signature + Signature *string `json:"signature,omitempty"` + // The calculated HMAC-SHA-256 webhook signature + SignatureHmacSha256 *string `json:"signature_hmac_sha_256,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for Webhook. +// MarshalJSON implements the json.Marshaler interface for Webhook. // It customizes the JSON marshaling process for Webhook objects. func (w *Webhook) MarshalJSON() ( - []byte, - error) { - return json.Marshal(w.toMap()) + []byte, + error) { + return json.Marshal(w.toMap()) } // toMap converts the Webhook object to a map representation for JSON marshaling. func (w *Webhook) toMap() map[string]any { - structMap := make(map[string]any) - if w.Event != nil { - structMap["event"] = w.Event - } - if w.Id != nil { - structMap["id"] = w.Id - } - if w.CreatedAt != nil { - structMap["created_at"] = w.CreatedAt - } - if w.LastError != nil { - structMap["last_error"] = w.LastError - } - if w.LastErrorAt != nil { - structMap["last_error_at"] = w.LastErrorAt - } - if w.AcceptedAt.IsValueSet() { - structMap["accepted_at"] = w.AcceptedAt.Value() - } - if w.LastSentAt != nil { - structMap["last_sent_at"] = w.LastSentAt - } - if w.LastSentUrl != nil { - structMap["last_sent_url"] = w.LastSentUrl - } - if w.Successful != nil { - structMap["successful"] = w.Successful - } - if w.Body != nil { - structMap["body"] = w.Body - } - if w.Signature != nil { - structMap["signature"] = w.Signature - } - if w.SignatureHmacSha256 != nil { - structMap["signature_hmac_sha_256"] = w.SignatureHmacSha256 - } - return structMap + structMap := make(map[string]any) + if w.Event != nil { + structMap["event"] = w.Event + } + if w.Id != nil { + structMap["id"] = w.Id + } + if w.CreatedAt != nil { + structMap["created_at"] = w.CreatedAt + } + if w.LastError != nil { + structMap["last_error"] = w.LastError + } + if w.LastErrorAt != nil { + structMap["last_error_at"] = w.LastErrorAt + } + if w.AcceptedAt.IsValueSet() { + structMap["accepted_at"] = w.AcceptedAt.Value() + } + if w.LastSentAt != nil { + structMap["last_sent_at"] = w.LastSentAt + } + if w.LastSentUrl != nil { + structMap["last_sent_url"] = w.LastSentUrl + } + if w.Successful != nil { + structMap["successful"] = w.Successful + } + if w.Body != nil { + structMap["body"] = w.Body + } + if w.Signature != nil { + structMap["signature"] = w.Signature + } + if w.SignatureHmacSha256 != nil { + structMap["signature_hmac_sha_256"] = w.SignatureHmacSha256 + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for Webhook. +// UnmarshalJSON implements the json.Unmarshaler interface for Webhook. // It customizes the JSON unmarshaling process for Webhook objects. func (w *Webhook) UnmarshalJSON(input []byte) error { - temp := &struct { - Event *string `json:"event,omitempty"` - Id *int `json:"id,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - LastError *string `json:"last_error,omitempty"` - LastErrorAt *string `json:"last_error_at,omitempty"` - AcceptedAt Optional[string] `json:"accepted_at"` - LastSentAt *string `json:"last_sent_at,omitempty"` - LastSentUrl *string `json:"last_sent_url,omitempty"` - Successful *bool `json:"successful,omitempty"` - Body *string `json:"body,omitempty"` - Signature *string `json:"signature,omitempty"` - SignatureHmacSha256 *string `json:"signature_hmac_sha_256,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - w.Event = temp.Event - w.Id = temp.Id - w.CreatedAt = temp.CreatedAt - w.LastError = temp.LastError - w.LastErrorAt = temp.LastErrorAt - w.AcceptedAt = temp.AcceptedAt - w.LastSentAt = temp.LastSentAt - w.LastSentUrl = temp.LastSentUrl - w.Successful = temp.Successful - w.Body = temp.Body - w.Signature = temp.Signature - w.SignatureHmacSha256 = temp.SignatureHmacSha256 - return nil + temp := &struct { + Event *string `json:"event,omitempty"` + Id *int `json:"id,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + LastError *string `json:"last_error,omitempty"` + LastErrorAt *string `json:"last_error_at,omitempty"` + AcceptedAt Optional[string] `json:"accepted_at"` + LastSentAt *string `json:"last_sent_at,omitempty"` + LastSentUrl *string `json:"last_sent_url,omitempty"` + Successful *bool `json:"successful,omitempty"` + Body *string `json:"body,omitempty"` + Signature *string `json:"signature,omitempty"` + SignatureHmacSha256 *string `json:"signature_hmac_sha_256,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + w.Event = temp.Event + w.Id = temp.Id + w.CreatedAt = temp.CreatedAt + w.LastError = temp.LastError + w.LastErrorAt = temp.LastErrorAt + w.AcceptedAt = temp.AcceptedAt + w.LastSentAt = temp.LastSentAt + w.LastSentUrl = temp.LastSentUrl + w.Successful = temp.Successful + w.Body = temp.Body + w.Signature = temp.Signature + w.SignatureHmacSha256 = temp.SignatureHmacSha256 + return nil } diff --git a/models/webhook_response.go b/models/webhook_response.go index 07e2da8f..577d358f 100644 --- a/models/webhook_response.go +++ b/models/webhook_response.go @@ -1,47 +1,42 @@ -/* -Package advancedbilling - -This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). -*/ package models import ( - "encoding/json" + "encoding/json" ) // WebhookResponse represents a WebhookResponse struct. type WebhookResponse struct { - Webhook *Webhook `json:"webhook,omitempty"` + Webhook *Webhook `json:"webhook,omitempty"` } -// MarshalJSON implements the json.Marshaler interface for WebhookResponse. +// MarshalJSON implements the json.Marshaler interface for WebhookResponse. // It customizes the JSON marshaling process for WebhookResponse objects. func (w *WebhookResponse) MarshalJSON() ( - []byte, - error) { - return json.Marshal(w.toMap()) + []byte, + error) { + return json.Marshal(w.toMap()) } // toMap converts the WebhookResponse object to a map representation for JSON marshaling. func (w *WebhookResponse) toMap() map[string]any { - structMap := make(map[string]any) - if w.Webhook != nil { - structMap["webhook"] = w.Webhook - } - return structMap + structMap := make(map[string]any) + if w.Webhook != nil { + structMap["webhook"] = w.Webhook.toMap() + } + return structMap } -// UnmarshalJSON implements the json.Unmarshaler interface for WebhookResponse. +// UnmarshalJSON implements the json.Unmarshaler interface for WebhookResponse. // It customizes the JSON unmarshaling process for WebhookResponse objects. func (w *WebhookResponse) UnmarshalJSON(input []byte) error { - temp := &struct { - Webhook *Webhook `json:"webhook,omitempty"` - }{} - err := json.Unmarshal(input, &temp) - if err != nil { - return err - } - - w.Webhook = temp.Webhook - return nil + temp := &struct { + Webhook *Webhook `json:"webhook,omitempty"` + }{} + err := json.Unmarshal(input, &temp) + if err != nil { + return err + } + + w.Webhook = temp.Webhook + return nil } diff --git a/offers_controller.go b/offers_controller.go index 35d8f0f1..25e61a8d 100644 --- a/offers_controller.go +++ b/offers_controller.go @@ -1,188 +1,188 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // OffersController represents a controller struct. type OffersController struct { - baseController + baseController } -// NewOffersController creates a new instance of OffersController. +// NewOffersController creates a new instance of OffersController. // It takes a baseController as a parameter and returns a pointer to the OffersController. func NewOffersController(baseController baseController) *OffersController { - offersController := OffersController{baseController: baseController} - return &offersController + offersController := OffersController{baseController: baseController} + return &offersController } -// CreateOffer takes context, body as parameters and -// returns an models.ApiResponse with models.OfferResponse data and -// an error if there was an issue with the request or response. -// Create an offer within your Chargify site by sending a POST request. -// ## Documentation -// 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407753852059). -// ## Using a Product Price Point +// CreateOffer takes context, body as parameters and +// returns an models.ApiResponse with models.OfferResponse data and +// an error if there was an issue with the request or response. +// Create an offer within your Chargify site by sending a POST request. +// ## Documentation +// 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407753852059). +// ## 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 `product_price_point_id` is not passed in, the product's default price point will be used. func (o *OffersController) CreateOffer( - ctx context.Context, - body *models.CreateOfferRequest) ( - models.ApiResponse[models.OfferResponse], - error) { - req := o.prepareRequest(ctx, "POST", "/offers.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.OfferResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.OfferResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateOfferRequest) ( + models.ApiResponse[models.OfferResponse], + error) { + req := o.prepareRequest(ctx, "POST", "/offers.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.OfferResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.OfferResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListOffers takes context, page, perPage, includeArchived as parameters and -// returns an models.ApiResponse with models.ListOffersResponse data and -// an error if there was an issue with the request or response. +// ListOffers takes context, page, perPage, includeArchived as parameters and +// returns an models.ApiResponse with models.ListOffersResponse data and +// an error if there was an issue with the request or response. // This endpoint will list offers for a site. func (o *OffersController) ListOffers( - ctx context.Context, - page *int, - perPage *int, - includeArchived *bool) ( - models.ApiResponse[models.ListOffersResponse], - error) { - req := o.prepareRequest(ctx, "GET", "/offers.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if includeArchived != nil { - req.QueryParam("include_archived", *includeArchived) - } - var result models.ListOffersResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListOffersResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + includeArchived *bool) ( + models.ApiResponse[models.ListOffersResponse], + error) { + req := o.prepareRequest(ctx, "GET", "/offers.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if includeArchived != nil { + req.QueryParam("include_archived", *includeArchived) + } + var result models.ListOffersResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListOffersResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadOffers takes context, offerId as parameters and -// returns an models.ApiResponse with models.OfferResponse data and -// an error if there was an issue with the request or response. +// ReadOffer takes context, offerId as parameters and +// returns an models.ApiResponse with models.OfferResponse data and +// an error if there was an issue with the request or response. // This method allows you to list a specific offer's attributes. This is different than list all offers for a site, as it requires an `offer_id`. -func (o *OffersController) ReadOffers( - ctx context.Context, - offerId int) ( - models.ApiResponse[models.OfferResponse], - error) { - req := o.prepareRequest(ctx, "GET", fmt.Sprintf("/offers/%v.json", offerId)) - req.Authenticate(true) - - var result models.OfferResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.OfferResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (o *OffersController) ReadOffer( + ctx context.Context, + offerId int) ( + models.ApiResponse[models.OfferResponse], + error) { + req := o.prepareRequest(ctx, "GET", fmt.Sprintf("/offers/%v.json", offerId)) + req.Authenticate(true) + + var result models.OfferResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.OfferResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ArchiveOffer takes context, offerId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// ArchiveOffer takes context, offerId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Archive an existing offer. Please provide an `offer_id` in order to archive the correct item. func (o *OffersController) ArchiveOffer( - ctx context.Context, - offerId int) ( - *http.Response, - error) { - req := o.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/offers/%v/archive.json", offerId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + offerId int) ( + *http.Response, + error) { + req := o.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/offers/%v/archive.json", offerId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// UnarchiveOffer takes context, offerId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// UnarchiveOffer takes context, offerId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Unarchive a previously archived offer. Please provide an `offer_id` in order to un-archive the correct item. func (o *OffersController) UnarchiveOffer( - ctx context.Context, - offerId int) ( - *http.Response, - error) { - req := o.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/offers/%v/unarchive.json", offerId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + offerId int) ( + *http.Response, + error) { + req := o.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/offers/%v/unarchive.json", offerId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } diff --git a/payment_profiles_controller.go b/payment_profiles_controller.go index 9500ec39..ce8cc6c7 100644 --- a/payment_profiles_controller.go +++ b/payment_profiles_controller.go @@ -1,714 +1,714 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // PaymentProfilesController represents a controller struct. type PaymentProfilesController struct { - baseController + baseController } -// NewPaymentProfilesController creates a new instance of PaymentProfilesController. +// NewPaymentProfilesController creates a new instance of PaymentProfilesController. // It takes a baseController as a parameter and returns a pointer to the PaymentProfilesController. func NewPaymentProfilesController(baseController baseController) *PaymentProfilesController { - paymentProfilesController := PaymentProfilesController{baseController: baseController} - return &paymentProfilesController + paymentProfilesController := PaymentProfilesController{baseController: baseController} + return &paymentProfilesController } -// CreatePaymentProfile takes context, body as parameters and -// returns an models.ApiResponse with models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to create a payment profile for a customer. -// Payment Profiles house the credit card, ACH (Authorize.Net or Stripe only,) or PayPal (Braintree only,) data for a customer. The payment information is attached to the customer within Chargify, as opposed to the Subscription itself. -// You must include a customer_id so that Chargify will attach it to the customer entry. If no customer_id is included the API will return a 404. -// ## Create a Payment Profile for ACH usage -// If you would like to create a payment method that is a Bank Account applicable for ACH payments use the following: -// ```json -// { -// "payment_profile": { -// "customer_id": [Valid-Customer-ID], -// "bank_name": "Best Bank", -// "bank_routing_number": "021000089", -// "bank_account_number": "111111111111", -// "bank_account_type": "checking", -// "bank_account_holder_type": "business", -// "payment_type": "bank_account" -// } -// } -// ``` -// ## Taxable Subscriptions -// If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) -// ## Payment Profile Documentation -// Full documentation on how Payment Profiles operate within Chargify can be located under the following links: -// + [Subscriber Payment Details](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405212558349-Customers-Reference#customers-reference-0-0) -// + [Self Service Pages](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404759627021) (Allows credit card updates by Subscriber) -// + [Public Signup Pages payment settings](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405267754381-Individual-Page-Settings#credit-card-settings) -// ## Create a Payment Profile with a Chargify.js token -// ```json -// { -// "payment_profile": { -// "customer_id": 1036, -// "chargify_token": "tok_w68qcpnftyv53jk33jv6wk3w" -// } -// } -// ``` -// ## Active Payment Methods -// Creating a new payment profile for a Customer via the API will not make that Payment Profile current for any of the Customer’s Subscriptions. In order to utilize the payment profile as the default, it must be set as the default payment profile for the subscription or subscription group. -// ## Requirements -// Either the full_number, expiration_month, and expiration_year or if you have an existing vault_token from your gateway, that vault_token and the current_vault are required. -// Passing in the vault_token and current_vault are only allowed when creating a new payment profile. -// ### Taxable Subscriptions -// If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) -// ## BraintreeBlue -// Some merchants use Braintree JavaScript libraries directly and then pass `payment_method_nonce` and/or `paypal_email` to create a payment profile. This implementation is deprecated and does not handle 3D Secure. Instead, we have provided [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) which is continuously improved and supports Credit Cards (along with 3D Secure), PayPal and ApplePay payment types. -// ## GoCardless -// For more information on GoCardless, please view the following resources: -// + [Full documentation on GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404501889677) -// + [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) -// + [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) -// ### GoCardless with Local Bank Details -// Following examples create customer, bank account and mandate in GoCardless: -// ```json -// { -// "payment_profile": { -// "customer_id": "Valid-Customer-ID", -// "bank_name": "Royal Bank of France", -// "bank_account_number": "0000000", -// "bank_routing_number": "0003", -// "bank_branch_code": "00006", -// "payment_type": "bank_account", -// "billing_address": "20 Place de la Gare", -// "billing_city": "Colombes", -// "billing_state": "Île-de-France", -// "billing_zip": "92700", -// "billing_country": "FR" -// } -// } -// ``` -// ### GoCardless with IBAN -// ```json -// { -// "payment_profile": { -// "customer_id": "24907598", -// "bank_name": "French Bank", -// "bank_iban": "FR1420041010050500013M02606", -// "payment_type": "bank_account", -// "billing_address": "20 Place de la Gare", -// "billing_city": "Colombes", -// "billing_state": "Île-de-France", -// "billing_zip": "92700", -// "billing_country": "FR" -// } -// } -// ``` -// ### Importing GoCardless -// If the customer, bank account, and mandate already exist in GoCardless, a payment profile can be created by using the IDs. In order to create masked versions of `bank_account_number` and `bank_routing_number` that are used to display within Chargify Admin UI, you can pass the last four digits for this fields which then will be saved in this form `XXXX[four-provided-digits]`. -// ```json -// { -// "payment_profile": { -// "customer_id": "24907598", -// "customer_vault_token": [Existing GoCardless Customer ID] -// "vault_token": [Existing GoCardless Mandate ID], -// "current_vault": "gocardless", -// "bank_name": "French Bank", -// "bank_account_number": [Last Four Of The Existing Account Number or IBAN if applicable], -// "bank_routing_number": [Last Four Of The Existing Routing Number], -// "payment_type": "bank_account", -// "billing_address": "20 Place de la Gare", -// "billing_city": "Colombes", -// "billing_state": "Île-de-France", -// "billing_zip": "92700", -// "billing_country": "FR" -// } -// } -// ``` -// ## SEPA Direct Debit -// For more information on Stripe SEPA Direct Debit, please view the following resources: -// + [Full documentation on Stripe SEPA Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) -// + [Using Chargify.js with Stripe Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) -// + [Using Chargify.js with Stripe Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) -// ### Stripe SEPA Direct Debit Payment Profiles -// The following example creates a customer, bank account and mandate in Stripe: -// ```json -// { -// "payment_profile": { -// "customer_id": "24907598", -// "bank_name": "Deutsche bank", -// "bank_iban": "DE89370400440532013000", -// "payment_type": "bank_account", -// "billing_address": "Test", -// "billing_city": "Berlin", -// "billing_state": "Brandenburg", -// "billing_zip": "12345", -// "billing_country": "DE" -// } -// } -// ``` -// ## Stripe BECS Direct Debit -// For more information on Stripe BECS Direct Debit, please view the following resources: -// + [Full documentation on Stripe BECS Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) -// + [Using Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) -// + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) -// ### Stripe BECS Direct Debit Payment Profiles -// The following example creates a customer, bank account and mandate in Stripe: -// ```json -// { -// "payment_profile": { -// "customer_id": "24907598", -// "bank_name": "Australian bank", -// "bank_branch_code": "000000", -// "bank_account_number": "000123456" -// "payment_type": "bank_account", -// "billing_address": "Test", -// "billing_city": "Stony Rise", -// "billing_state": "Tasmania", -// "billing_zip": "12345", -// "billing_country": "AU" -// } -// } -// ``` -// ## 3D Secure - Checkout -// It may happen that a payment needs 3D Secure Authentication when the payment profile is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: -// ```json -// { -// "jsonapi": { -// "version": "1.0" -// }, -// "errors": [ -// { -// "title": "This card requires 3DSecure verification.", -// "detail": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after credit card is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", -// "links": { -// "action_link": "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93" -// } -// } -// ] -// } -// ``` -// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: -// - whether the authentication was successful (`success`) -// - the payment profile ID (`payment_profile_id`) -// Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. -// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. -// The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` -// ### Example Redirect Flow -// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: -// 1. Create a payment profile via API; it requires 3DS -// 2. You receive a `action_link` in the response. -// 3. Use this `action_link` to, for example, connect with your internal resources or generate a session_id -// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to -// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known +// CreatePaymentProfile takes context, body as parameters and +// returns an models.ApiResponse with models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to create a payment profile for a customer. +// Payment Profiles house the credit card, ACH (Authorize.Net or Stripe only,) or PayPal (Braintree only,) data for a customer. The payment information is attached to the customer within Chargify, as opposed to the Subscription itself. +// You must include a customer_id so that Chargify will attach it to the customer entry. If no customer_id is included the API will return a 404. +// ## Create a Payment Profile for ACH usage +// If you would like to create a payment method that is a Bank Account applicable for ACH payments use the following: +// ```json +// { +// "payment_profile": { +// "customer_id": [Valid-Customer-ID], +// "bank_name": "Best Bank", +// "bank_routing_number": "021000089", +// "bank_account_number": "111111111111", +// "bank_account_type": "checking", +// "bank_account_holder_type": "business", +// "payment_type": "bank_account" +// } +// } +// ``` +// ## Taxable Subscriptions +// If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) +// ## Payment Profile Documentation +// Full documentation on how Payment Profiles operate within Chargify can be located under the following links: +// + [Subscriber Payment Details](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405212558349-Customers-Reference#customers-reference-0-0) +// + [Self Service Pages](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404759627021) (Allows credit card updates by Subscriber) +// + [Public Signup Pages payment settings](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405267754381-Individual-Page-Settings#credit-card-settings) +// ## Create a Payment Profile with a Chargify.js token +// ```json +// { +// "payment_profile": { +// "customer_id": 1036, +// "chargify_token": "tok_w68qcpnftyv53jk33jv6wk3w" +// } +// } +// ``` +// ## Active Payment Methods +// Creating a new payment profile for a Customer via the API will not make that Payment Profile current for any of the Customer’s Subscriptions. In order to utilize the payment profile as the default, it must be set as the default payment profile for the subscription or subscription group. +// ## Requirements +// Either the full_number, expiration_month, and expiration_year or if you have an existing vault_token from your gateway, that vault_token and the current_vault are required. +// Passing in the vault_token and current_vault are only allowed when creating a new payment profile. +// ### Taxable Subscriptions +// If your subscriber pays taxes on their purchased product, and you are attempting to create or update the `payment_profile`, complete address information is required. For information on required address formatting to allow your subscriber to be taxed, please see our documentation [here](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) +// ## BraintreeBlue +// Some merchants use Braintree JavaScript libraries directly and then pass `payment_method_nonce` and/or `paypal_email` to create a payment profile. This implementation is deprecated and does not handle 3D Secure. Instead, we have provided [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) which is continuously improved and supports Credit Cards (along with 3D Secure), PayPal and ApplePay payment types. +// ## GoCardless +// For more information on GoCardless, please view the following resources: +// + [Full documentation on GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404501889677) +// + [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) +// + [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) +// ### GoCardless with Local Bank Details +// Following examples create customer, bank account and mandate in GoCardless: +// ```json +// { +// "payment_profile": { +// "customer_id": "Valid-Customer-ID", +// "bank_name": "Royal Bank of France", +// "bank_account_number": "0000000", +// "bank_routing_number": "0003", +// "bank_branch_code": "00006", +// "payment_type": "bank_account", +// "billing_address": "20 Place de la Gare", +// "billing_city": "Colombes", +// "billing_state": "Île-de-France", +// "billing_zip": "92700", +// "billing_country": "FR" +// } +// } +// ``` +// ### GoCardless with IBAN +// ```json +// { +// "payment_profile": { +// "customer_id": "24907598", +// "bank_name": "French Bank", +// "bank_iban": "FR1420041010050500013M02606", +// "payment_type": "bank_account", +// "billing_address": "20 Place de la Gare", +// "billing_city": "Colombes", +// "billing_state": "Île-de-France", +// "billing_zip": "92700", +// "billing_country": "FR" +// } +// } +// ``` +// ### Importing GoCardless +// If the customer, bank account, and mandate already exist in GoCardless, a payment profile can be created by using the IDs. In order to create masked versions of `bank_account_number` and `bank_routing_number` that are used to display within Chargify Admin UI, you can pass the last four digits for this fields which then will be saved in this form `XXXX[four-provided-digits]`. +// ```json +// { +// "payment_profile": { +// "customer_id": "24907598", +// "customer_vault_token": [Existing GoCardless Customer ID] +// "vault_token": [Existing GoCardless Mandate ID], +// "current_vault": "gocardless", +// "bank_name": "French Bank", +// "bank_account_number": [Last Four Of The Existing Account Number or IBAN if applicable], +// "bank_routing_number": [Last Four Of The Existing Routing Number], +// "payment_type": "bank_account", +// "billing_address": "20 Place de la Gare", +// "billing_city": "Colombes", +// "billing_state": "Île-de-France", +// "billing_zip": "92700", +// "billing_country": "FR" +// } +// } +// ``` +// ## SEPA Direct Debit +// For more information on Stripe SEPA Direct Debit, please view the following resources: +// + [Full documentation on Stripe SEPA Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) +// + [Using Chargify.js with Stripe Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) +// + [Using Chargify.js with Stripe Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) +// ### Stripe SEPA Direct Debit Payment Profiles +// The following example creates a customer, bank account and mandate in Stripe: +// ```json +// { +// "payment_profile": { +// "customer_id": "24907598", +// "bank_name": "Deutsche bank", +// "bank_iban": "DE89370400440532013000", +// "payment_type": "bank_account", +// "billing_address": "Test", +// "billing_city": "Berlin", +// "billing_state": "Brandenburg", +// "billing_zip": "12345", +// "billing_country": "DE" +// } +// } +// ``` +// ## Stripe BECS Direct Debit +// For more information on Stripe BECS Direct Debit, please view the following resources: +// + [Full documentation on Stripe BECS Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) +// + [Using Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) +// + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) +// ### Stripe BECS Direct Debit Payment Profiles +// The following example creates a customer, bank account and mandate in Stripe: +// ```json +// { +// "payment_profile": { +// "customer_id": "24907598", +// "bank_name": "Australian bank", +// "bank_branch_code": "000000", +// "bank_account_number": "000123456" +// "payment_type": "bank_account", +// "billing_address": "Test", +// "billing_city": "Stony Rise", +// "billing_state": "Tasmania", +// "billing_zip": "12345", +// "billing_country": "AU" +// } +// } +// ``` +// ## 3D Secure - Checkout +// It may happen that a payment needs 3D Secure Authentication when the payment profile is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +// ```json +// { +// "jsonapi": { +// "version": "1.0" +// }, +// "errors": [ +// { +// "title": "This card requires 3DSecure verification.", +// "detail": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after credit card is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", +// "links": { +// "action_link": "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93" +// } +// } +// ] +// } +// ``` +// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. +// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: +// - whether the authentication was successful (`success`) +// - the payment profile ID (`payment_profile_id`) +// Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. +// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +// The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` +// ### Example Redirect Flow +// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: +// 1. Create a payment profile via API; it requires 3DS +// 2. You receive a `action_link` in the response. +// 3. Use this `action_link` to, for example, connect with your internal resources or generate a session_id +// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to +// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied +// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. +// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known // 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not func (p *PaymentProfilesController) CreatePaymentProfile( - ctx context.Context, - body *models.CreatePaymentProfileRequest) ( - models.ApiResponse[models.PaymentProfileResponse], - error) { - req := p.prepareRequest(ctx, "POST", "/payment_profiles.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreatePaymentProfileRequest) ( + models.ApiResponse[models.PaymentProfileResponse], + error) { + req := p.prepareRequest(ctx, "POST", "/payment_profiles.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListPaymentProfiles takes context, page, perPage, customerId as parameters and -// returns an models.ApiResponse with []models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. +// ListPaymentProfiles takes context, page, perPage, customerId as parameters and +// returns an models.ApiResponse with []models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. // This method will return all of the 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. func (p *PaymentProfilesController) ListPaymentProfiles( - ctx context.Context, - page *int, - perPage *int, - customerId *int) ( - models.ApiResponse[[]models.PaymentProfileResponse], - error) { - req := p.prepareRequest(ctx, "GET", "/payment_profiles.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if customerId != nil { - req.QueryParam("customer_id", *customerId) - } - var result []models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + customerId *int) ( + models.ApiResponse[[]models.PaymentProfileResponse], + error) { + req := p.prepareRequest(ctx, "GET", "/payment_profiles.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if customerId != nil { + req.QueryParam("customer_id", *customerId) + } + var result []models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadPaymentProfile takes context, paymentProfileId as parameters and -// returns an models.ApiResponse with models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. -// Using the GET method you can retrieve a Payment Profile identified by its unique ID. -// Please note that a different JSON object will be returned if the card method on file is a bank account. -// ### Response for Bank Account -// Example response for Bank Account: -// ``` -// { -// "payment_profile": { -// "id": 10089892, -// "first_name": "Chester", -// "last_name": "Tester", -// "customer_id": 14543792, -// "current_vault": "bogus", -// "vault_token": "0011223344", -// "billing_address": "456 Juniper Court", -// "billing_city": "Boulder", -// "billing_state": "CO", -// "billing_zip": "80302", -// "billing_country": "US", -// "customer_vault_token": null, -// "billing_address_2": "", -// "bank_name": "Bank of Kansas City", -// "masked_bank_routing_number": "XXXX6789", -// "masked_bank_account_number": "XXXX3344", -// "bank_account_type": "checking", -// "bank_account_holder_type": "personal", -// "payment_type": "bank_account", -// "site_gateway_setting_id": 1, -// "gateway_handle": null -// } -// } +// ReadPaymentProfile takes context, paymentProfileId as parameters and +// returns an models.ApiResponse with models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. +// Using the GET method you can retrieve a Payment Profile identified by its unique ID. +// Please note that a different JSON object will be returned if the card method on file is a bank account. +// ### Response for Bank Account +// Example response for Bank Account: +// ``` +// { +// "payment_profile": { +// "id": 10089892, +// "first_name": "Chester", +// "last_name": "Tester", +// "customer_id": 14543792, +// "current_vault": "bogus", +// "vault_token": "0011223344", +// "billing_address": "456 Juniper Court", +// "billing_city": "Boulder", +// "billing_state": "CO", +// "billing_zip": "80302", +// "billing_country": "US", +// "customer_vault_token": null, +// "billing_address_2": "", +// "bank_name": "Bank of Kansas City", +// "masked_bank_routing_number": "XXXX6789", +// "masked_bank_account_number": "XXXX3344", +// "bank_account_type": "checking", +// "bank_account_holder_type": "personal", +// "payment_type": "bank_account", +// "site_gateway_setting_id": 1, +// "gateway_handle": null +// } +// } // ``` func (p *PaymentProfilesController) ReadPaymentProfile( - ctx context.Context, - paymentProfileId int) ( - models.ApiResponse[models.PaymentProfileResponse], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), - ) - req.Authenticate(true) - - var result models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + paymentProfileId int) ( + models.ApiResponse[models.PaymentProfileResponse], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), + ) + req.Authenticate(true) + + var result models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// UpdatePaymentProfile takes context, paymentProfileId, body as parameters and -// returns an models.ApiResponse with models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. -// ## Partial Card Updates -// In the event that you are using the Authorize.net, Stripe, Cybersource, Forte or Braintree Blue payment gateways, you can update just the billing and contact information for a payment method. Note the lack of credit-card related data contained in the JSON payload. -// In this case, the following JSON is acceptable: -// ``` -// { -// "payment_profile": { -// "first_name": "Kelly", -// "last_name": "Test", -// "billing_address": "789 Juniper Court", -// "billing_city": "Boulder", -// "billing_state": "CO", -// "billing_zip": "80302", -// "billing_country": "US", -// "billing_address_2": null -// } -// } -// ``` -// The result will be that you have updated the billing information for the card, yet retained the original card number data. -// ## Specific notes on updating payment profiles -// - Merchants with **Authorize.net**, **Cybersource**, **Forte**, **Braintree Blue** or **Stripe** as their payment gateway can update their Customer’s credit cards without passing in the full credit card number and CVV. -// - If you are using **Authorize.net**, **Cybersource**, **Forte**, **Braintree Blue** or **Stripe**, Chargify will ignore the credit card number and CVV when processing an update via the API, and attempt a partial update instead. If you wish to change the card number on a payment profile, you will need to create a new payment profile for the given customer. -// - A Payment Profile cannot be updated with the attributes of another type of Payment Profile. For example, if the payment profile you are attempting to update is a credit card, you cannot pass in bank account attributes (like `bank_account_number`), and vice versa. -// - Updating a payment profile directly will not trigger an attempt to capture a past-due balance. If this is the intent, update the card details via the Subscription instead. +// UpdatePaymentProfile takes context, paymentProfileId, body as parameters and +// returns an models.ApiResponse with models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. +// ## Partial Card Updates +// In the event that you are using the Authorize.net, Stripe, Cybersource, Forte or Braintree Blue payment gateways, you can update just the billing and contact information for a payment method. Note the lack of credit-card related data contained in the JSON payload. +// In this case, the following JSON is acceptable: +// ``` +// { +// "payment_profile": { +// "first_name": "Kelly", +// "last_name": "Test", +// "billing_address": "789 Juniper Court", +// "billing_city": "Boulder", +// "billing_state": "CO", +// "billing_zip": "80302", +// "billing_country": "US", +// "billing_address_2": null +// } +// } +// ``` +// The result will be that you have updated the billing information for the card, yet retained the original card number data. +// ## Specific notes on updating payment profiles +// - Merchants with **Authorize.net**, **Cybersource**, **Forte**, **Braintree Blue** or **Stripe** as their payment gateway can update their Customer’s credit cards without passing in the full credit card number and CVV. +// - If you are using **Authorize.net**, **Cybersource**, **Forte**, **Braintree Blue** or **Stripe**, Chargify will ignore the credit card number and CVV when processing an update via the API, and attempt a partial update instead. If you wish to change the card number on a payment profile, you will need to create a new payment profile for the given customer. +// - A Payment Profile cannot be updated with the attributes of another type of Payment Profile. For example, if the payment profile you are attempting to update is a credit card, you cannot pass in bank account attributes (like `bank_account_number`), and vice versa. +// - Updating a payment profile directly will not trigger an attempt to capture a past-due balance. If this is the intent, update the card details via the Subscription instead. // - If you are using Authorize.net or Stripe, you may elect to manually trigger a retry for a past due subscription after a partial update. func (p *PaymentProfilesController) UpdatePaymentProfile( - ctx context.Context, - paymentProfileId int, - body *models.UpdatePaymentProfileRequest) ( - models.ApiResponse[models.PaymentProfileResponse], - error) { - req := p.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorStringMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + paymentProfileId int, + body *models.UpdatePaymentProfileRequest) ( + models.ApiResponse[models.PaymentProfileResponse], + error) { + req := p.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorStringMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteUnusedPaymentProfile takes context, paymentProfileId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// Deletes an unused payment profile. +// DeleteUnusedPaymentProfile takes context, paymentProfileId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// 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. func (p *PaymentProfilesController) DeleteUnusedPaymentProfile( - ctx context.Context, - paymentProfileId int) ( - *http.Response, - error) { - req := p.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + paymentProfileId int) ( + *http.Response, + error) { + req := p.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/payment_profiles/%v.json", paymentProfileId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// DeleteSubscriptionsPaymentProfile takes context, subscriptionId, paymentProfileId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This will delete 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. +// DeleteSubscriptionsPaymentProfile takes context, subscriptionId, paymentProfileId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This will delete 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). func (p *PaymentProfilesController) DeleteSubscriptionsPaymentProfile( - ctx context.Context, - subscriptionId int, - paymentProfileId int) ( - *http.Response, - error) { - req := p.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/payment_profiles/%v.json", subscriptionId, paymentProfileId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subscriptionId int, + paymentProfileId int) ( + *http.Response, + error) { + req := p.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/payment_profiles/%v.json", subscriptionId, paymentProfileId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// VerifyBankAccount takes context, bankAccountId, body as parameters and -// returns an models.ApiResponse with models.BankAccountResponse data and -// an error if there was an issue with the request or response. +// VerifyBankAccount takes context, bankAccountId, body as parameters and +// returns an models.ApiResponse with models.BankAccountResponse data and +// an error if there was an issue with the request or response. // Submit the two small deposit amounts the customer received in their bank account in order to verify the bank account. (Stripe only) func (p *PaymentProfilesController) VerifyBankAccount( - ctx context.Context, - bankAccountId int, - body *models.BankAccountVerificationRequest) ( - models.ApiResponse[models.BankAccountResponse], - error) { - req := p.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/bank_accounts/%v/verification.json", bankAccountId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.BankAccountResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BankAccountResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + bankAccountId int, + body *models.BankAccountVerificationRequest) ( + models.ApiResponse[models.BankAccountResponse], + error) { + req := p.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/bank_accounts/%v/verification.json", bankAccountId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.BankAccountResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BankAccountResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteSubscriptionGroupPaymentProfile takes context, uid, paymentProfileId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This will delete a Payment Profile belonging to a Subscription Group. +// DeleteSubscriptionGroupPaymentProfile takes context, uid, paymentProfileId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This will delete a Payment Profile belonging to a Subscription Group. // **Note**: If the Payment Profile belongs to multiple Subscription Groups and/or Subscriptions, it will be removed from all of them. func (p *PaymentProfilesController) DeleteSubscriptionGroupPaymentProfile( - ctx context.Context, - uid string, - paymentProfileId int) ( - *http.Response, - error) { - req := p.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscription_groups/%v/payment_profiles/%v.json", uid, paymentProfileId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + uid string, + paymentProfileId int) ( + *http.Response, + error) { + req := p.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscription_groups/%v/payment_profiles/%v.json", uid, paymentProfileId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// UpdateSubscriptionDefaultPaymentProfile takes context, subscriptionId, paymentProfileId as parameters and -// returns an models.ApiResponse with models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. -// This will change the default payment profile on the subscription to the existing payment profile with the id specified. +// ChangeSubscriptionDefaultPaymentProfile takes context, subscriptionId, paymentProfileId as parameters and +// returns an models.ApiResponse with models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. +// This will change the default payment profile on the subscription to the existing payment profile with the id specified. // 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. -func (p *PaymentProfilesController) UpdateSubscriptionDefaultPaymentProfile( - ctx context.Context, - subscriptionId int, - paymentProfileId int) ( - models.ApiResponse[models.PaymentProfileResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/payment_profiles/%v/change_payment_profile.json", subscriptionId, paymentProfileId), - ) - req.Authenticate(true) - - var result models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (p *PaymentProfilesController) ChangeSubscriptionDefaultPaymentProfile( + ctx context.Context, + subscriptionId int, + paymentProfileId int) ( + models.ApiResponse[models.PaymentProfileResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/payment_profiles/%v/change_payment_profile.json", subscriptionId, paymentProfileId), + ) + req.Authenticate(true) + + var result models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateSubscriptionGroupDefaultPaymentProfile takes context, uid, paymentProfileId as parameters and -// returns an models.ApiResponse with models.PaymentProfileResponse data and -// an error if there was an issue with the request or response. -// This will change the default payment profile on the subscription group to the existing payment profile with the id specified. -// 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. +// ChangeSubscriptionGroupDefaultPaymentProfile takes context, uid, paymentProfileId as parameters and +// returns an models.ApiResponse with models.PaymentProfileResponse data and +// an error if there was an issue with the request or response. +// This will change the default payment profile on the subscription group to the existing payment profile with the id specified. +// 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, otherwise you will receive an error. -func (p *PaymentProfilesController) UpdateSubscriptionGroupDefaultPaymentProfile( - ctx context.Context, - uid string, - paymentProfileId int) ( - models.ApiResponse[models.PaymentProfileResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/payment_profiles/%v/change_payment_profile.json", uid, paymentProfileId), - ) - req.Authenticate(true) - - var result models.PaymentProfileResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (p *PaymentProfilesController) ChangeSubscriptionGroupDefaultPaymentProfile( + ctx context.Context, + uid string, + paymentProfileId int) ( + models.ApiResponse[models.PaymentProfileResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/payment_profiles/%v/change_payment_profile.json", uid, paymentProfileId), + ) + req.Authenticate(true) + + var result models.PaymentProfileResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PaymentProfileResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadOneTimeToken takes context, chargifyToken as parameters and -// returns an models.ApiResponse with models.GetOneTimeTokenRequest data and -// an error if there was an issue with the request or response. -// One Time Tokens aka Chargify 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. +// ReadOneTimeToken takes context, chargifyToken as parameters and +// returns an models.ApiResponse with models.GetOneTimeTokenRequest data and +// an error if there was an issue with the request or response. +// One Time Tokens aka Chargify 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. // To obtain a One Time Token you have to use [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). func (p *PaymentProfilesController) ReadOneTimeToken( - ctx context.Context, - chargifyToken string) ( - models.ApiResponse[models.GetOneTimeTokenRequest], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/one_time_tokens/%v.json", chargifyToken), - ) - req.Authenticate(true) - - var result models.GetOneTimeTokenRequest - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.GetOneTimeTokenRequest](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewErrorListResponse(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + chargifyToken string) ( + models.ApiResponse[models.GetOneTimeTokenRequest], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/one_time_tokens/%v.json", chargifyToken), + ) + req.Authenticate(true) + + var result models.GetOneTimeTokenRequest + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.GetOneTimeTokenRequest](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewErrorListResponse(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// SendRequestUpdatePaymentEmail takes context, subscriptionId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// You can send 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. -// Additionally, if you attempt to send a "request payment update" email for a subscription that does not exist, you will receive a `404` error response. This error message will indicate that the subscription could not be found, and will provide instructions on how to correct the error and resubmit the request. +// SendRequestUpdatePaymentEmail takes context, subscriptionId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// You can send 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. +// Additionally, if you attempt to send a "request payment update" email for a subscription that does not exist, you will receive a `404` error response. This error message will indicate that the subscription could not be found, and will provide instructions on how to correct the error and resubmit the request. // These error responses are designed to prevent excessive or invalid requests, and to provide clear and helpful information to users who encounter errors during the request process. func (p *PaymentProfilesController) SendRequestUpdatePaymentEmail( - ctx context.Context, - subscriptionId int) ( - *http.Response, - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/request_payment_profiles_update.json", subscriptionId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + subscriptionId int) ( + *http.Response, + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/request_payment_profiles_update.json", subscriptionId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } diff --git a/product_families_controller.go b/product_families_controller.go index 89f4586e..3da7cd02 100644 --- a/product_families_controller.go +++ b/product_families_controller.go @@ -1,218 +1,218 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // ProductFamiliesController represents a controller struct. type ProductFamiliesController struct { - baseController + baseController } -// NewProductFamiliesController creates a new instance of ProductFamiliesController. +// NewProductFamiliesController creates a new instance of ProductFamiliesController. // It takes a baseController as a parameter and returns a pointer to the ProductFamiliesController. func NewProductFamiliesController(baseController baseController) *ProductFamiliesController { - productFamiliesController := ProductFamiliesController{baseController: baseController} - return &productFamiliesController + productFamiliesController := ProductFamiliesController{baseController: baseController} + return &productFamiliesController } -// ListProductsForProductFamily takes context, productFamilyId, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, includeArchived, include, filterPrepaidProductPricePointProductPricePointId, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.ProductResponse data and -// an error if there was an issue with the request or response. +// ListProductsForProductFamily takes context, productFamilyId, page, perPage, dateField, startDate, endDate, startDatetime, endDatetime, includeArchived, include, filterPrepaidProductPricePointProductPricePointId, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.ProductResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve a list of Products belonging to a Product Family. func (p *ProductFamiliesController) ListProductsForProductFamily( - ctx context.Context, - productFamilyId int, - page *int, - perPage *int, - dateField *models.BasicDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string, - includeArchived *bool, - include *models.ListProductsInclude, - filterPrepaidProductPricePointProductPricePointId *models.IncludeNotNull, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.ProductResponse], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/product_families/%v/products.json", productFamilyId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if includeArchived != nil { - req.QueryParam("include_archived", *includeArchived) - } - if include != nil { - req.QueryParam("include", *include) - } - if filterPrepaidProductPricePointProductPricePointId != nil { - req.QueryParam("filter[prepaid_product_price_point][product_price_point_id]", *filterPrepaidProductPricePointProductPricePointId) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - - var result []models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + page *int, + perPage *int, + dateField *models.BasicDateField, + startDate *string, + endDate *string, + startDatetime *string, + endDatetime *string, + includeArchived *bool, + include *models.ListProductsInclude, + filterPrepaidProductPricePointProductPricePointId *models.IncludeNotNull, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.ProductResponse], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/product_families/%v/products.json", productFamilyId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if includeArchived != nil { + req.QueryParam("include_archived", *includeArchived) + } + if include != nil { + req.QueryParam("include", *include) + } + if filterPrepaidProductPricePointProductPricePointId != nil { + req.QueryParam("filter[prepaid_product_price_point][product_price_point_id]", *filterPrepaidProductPricePointProductPricePointId) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + + var result []models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// CreateProductFamily takes context, body as parameters and -// returns an models.ApiResponse with models.ProductFamilyResponse data and -// an error if there was an issue with the request or response. -// This method will create a Product Family within your Chargify site. Create a Product Family to act as a container for your products, components and coupons. +// CreateProductFamily takes context, body as parameters and +// returns an models.ApiResponse with models.ProductFamilyResponse data and +// an error if there was an issue with the request or response. +// This method will create a Product Family within your Chargify 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 Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405369633421). func (p *ProductFamiliesController) CreateProductFamily( - ctx context.Context, - body *models.CreateProductFamilyRequest) ( - models.ApiResponse[models.ProductFamilyResponse], - error) { - req := p.prepareRequest(ctx, "POST", "/product_families.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.ProductFamilyResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductFamilyResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateProductFamilyRequest) ( + models.ApiResponse[models.ProductFamilyResponse], + error) { + req := p.prepareRequest(ctx, "POST", "/product_families.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.ProductFamilyResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductFamilyResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListProductFamilies takes context, dateField, startDate, endDate, startDatetime, endDatetime as parameters and -// returns an models.ApiResponse with []models.ProductFamilyResponse data and -// an error if there was an issue with the request or response. +// ListProductFamilies takes context, dateField, startDate, endDate, startDatetime, endDatetime as parameters and +// returns an models.ApiResponse with []models.ProductFamilyResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve a list of Product Families for a site. func (p *ProductFamiliesController) ListProductFamilies( - ctx context.Context, - dateField *models.BasicDateField, - startDate *string, - endDate *string, - startDatetime *string, - endDatetime *string) ( - models.ApiResponse[[]models.ProductFamilyResponse], - error) { - req := p.prepareRequest(ctx, "GET", "/product_families.json") - req.Authenticate(true) - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - var result []models.ProductFamilyResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ProductFamilyResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + dateField *models.BasicDateField, + startDate *string, + endDate *string, + startDatetime *string, + endDatetime *string) ( + models.ApiResponse[[]models.ProductFamilyResponse], + error) { + req := p.prepareRequest(ctx, "GET", "/product_families.json") + req.Authenticate(true) + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + var result []models.ProductFamilyResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ProductFamilyResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadProductFamily takes context, id as parameters and -// returns an models.ApiResponse with models.ProductFamilyResponse data and -// an error if there was an issue with the request or response. -// This method allows to retrieve a Product Family via the `product_family_id`. The response will contain a Product Family object. +// ReadProductFamily takes context, id as parameters and +// returns an models.ApiResponse with models.ProductFamilyResponse data and +// an error if there was an issue with the request or response. +// This method allows to retrieve a Product Family via the `product_family_id`. The response will contain a Product Family object. // The product family can be specified either with the id number, or with the `handle:my-family` format. func (p *ProductFamiliesController) ReadProductFamily( - ctx context.Context, - id int) ( - models.ApiResponse[models.ProductFamilyResponse], - error) { - req := p.prepareRequest(ctx, "GET", fmt.Sprintf("/product_families/%v.json", id)) - req.Authenticate(true) - - var result models.ProductFamilyResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductFamilyResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + id int) ( + models.ApiResponse[models.ProductFamilyResponse], + error) { + req := p.prepareRequest(ctx, "GET", fmt.Sprintf("/product_families/%v.json", id)) + req.Authenticate(true) + + var result models.ProductFamilyResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductFamilyResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/product_price_points_controller.go b/product_price_points_controller.go index 989d807c..55fae466 100644 --- a/product_price_points_controller.go +++ b/product_price_points_controller.go @@ -1,512 +1,512 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "time" ) // ProductPricePointsController represents a controller struct. type ProductPricePointsController struct { - baseController + baseController } -// NewProductPricePointsController creates a new instance of ProductPricePointsController. +// NewProductPricePointsController creates a new instance of ProductPricePointsController. // It takes a baseController as a parameter and returns a pointer to the ProductPricePointsController. func NewProductPricePointsController(baseController baseController) *ProductPricePointsController { - productPricePointsController := ProductPricePointsController{baseController: baseController} - return &productPricePointsController + productPricePointsController := ProductPricePointsController{baseController: baseController} + return &productPricePointsController } -// CreateProductPricePoint takes context, productId, body as parameters and -// returns an models.ApiResponse with models.ProductPricePointResponse data and -// an error if there was an issue with the request or response. +// CreateProductPricePoint takes context, productId, body as parameters and +// returns an models.ApiResponse with models.ProductPricePointResponse data and +// an error if there was an issue with the request or response. // [Product Price Point Documentation](https://chargify.zendesk.com/hc/en-us/articles/4407755824155) func (p *ProductPricePointsController) CreateProductPricePoint( - ctx context.Context, - productId interface{}, - body *models.CreateProductPricePointRequest) ( - models.ApiResponse[models.ProductPricePointResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/products/%v/price_points.json", productId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ProductPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewProductPricePointErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId interface{}, + body *models.CreateProductPricePointRequest) ( + models.ApiResponse[models.ProductPricePointResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/products/%v/price_points.json", productId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ProductPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewProductPricePointErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListProductPricePoints takes context, productId, page, perPage, currencyPrices, filterType as parameters and -// returns an models.ApiResponse with models.ListProductPricePointsResponse data and -// an error if there was an issue with the request or response. +// ListProductPricePoints takes context, productId, page, perPage, currencyPrices, filterType as parameters and +// returns an models.ApiResponse with models.ListProductPricePointsResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to retrieve a list of product price points. func (p *ProductPricePointsController) ListProductPricePoints( - ctx context.Context, - productId interface{}, - page *int, - perPage *int, - currencyPrices *bool, - filterType []models.PricePointType) ( - models.ApiResponse[models.ListProductPricePointsResponse], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/products/%v/price_points.json", productId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if currencyPrices != nil { - req.QueryParam("currency_prices", *currencyPrices) - } - if filterType != nil { - req.QueryParam("filter[type]", filterType) - } - - var result models.ListProductPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListProductPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId interface{}, + page *int, + perPage *int, + currencyPrices *bool, + filterType []models.PricePointType) ( + models.ApiResponse[models.ListProductPricePointsResponse], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/products/%v/price_points.json", productId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if currencyPrices != nil { + req.QueryParam("currency_prices", *currencyPrices) + } + if filterType != nil { + req.QueryParam("filter[type]", filterType) + } + + var result models.ListProductPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListProductPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateProductPricePoint takes context, productId, pricePointId, body as parameters and -// returns an models.ApiResponse with models.ProductPricePointResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to update a product price point. +// UpdateProductPricePoint takes context, productId, pricePointId, body as parameters and +// returns an models.ApiResponse with models.ProductPricePointResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to update a product price point. // Note: Custom product price points are not able to be updated. func (p *ProductPricePointsController) UpdateProductPricePoint( - ctx context.Context, - productId interface{}, - pricePointId interface{}, - body *models.UpdateProductPricePointRequest) ( - models.ApiResponse[models.ProductPricePointResponse], - error) { - req := p.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ProductPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId interface{}, + pricePointId interface{}, + body *models.UpdateProductPricePointRequest) ( + models.ApiResponse[models.ProductPricePointResponse], + error) { + req := p.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ProductPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadProductPricePoint takes context, productId, pricePointId, currencyPrices as parameters and -// returns an models.ApiResponse with models.ProductPricePointResponse data and -// an error if there was an issue with the request or response. +// ReadProductPricePoint takes context, productId, pricePointId, currencyPrices as parameters and +// returns an models.ApiResponse with models.ProductPricePointResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to retrieve details for a specific product price point. func (p *ProductPricePointsController) ReadProductPricePoint( - ctx context.Context, - productId interface{}, - pricePointId interface{}, - currencyPrices *bool) ( - models.ApiResponse[models.ProductPricePointResponse], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), - ) - req.Authenticate(true) - if currencyPrices != nil { - req.QueryParam("currency_prices", *currencyPrices) - } - - var result models.ProductPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId interface{}, + pricePointId interface{}, + currencyPrices *bool) ( + models.ApiResponse[models.ProductPricePointResponse], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), + ) + req.Authenticate(true) + if currencyPrices != nil { + req.QueryParam("currency_prices", *currencyPrices) + } + + var result models.ProductPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ArchiveProductPricePoint takes context, productId, pricePointId as parameters and -// returns an models.ApiResponse with models.ProductPricePointResponse data and -// an error if there was an issue with the request or response. +// ArchiveProductPricePoint takes context, productId, pricePointId as parameters and +// returns an models.ApiResponse with models.ProductPricePointResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to archive a product price point. func (p *ProductPricePointsController) ArchiveProductPricePoint( - ctx context.Context, - productId interface{}, - pricePointId interface{}) ( - models.ApiResponse[models.ProductPricePointResponse], - error) { - req := p.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), - ) - req.Authenticate(true) - - var result models.ProductPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId interface{}, + pricePointId interface{}) ( + models.ApiResponse[models.ProductPricePointResponse], + error) { + req := p.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/products/%v/price_points/%v.json", productId, pricePointId), + ) + req.Authenticate(true) + + var result models.ProductPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UnarchiveProductPricePoint takes context, productId, pricePointId as parameters and -// returns an models.ApiResponse with models.ProductPricePointResponse data and -// an error if there was an issue with the request or response. +// UnarchiveProductPricePoint takes context, productId, pricePointId as parameters and +// returns an models.ApiResponse with models.ProductPricePointResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to unarchive an archived product price point. func (p *ProductPricePointsController) UnarchiveProductPricePoint( - ctx context.Context, - productId int, - pricePointId int) ( - models.ApiResponse[models.ProductPricePointResponse], - error) { - req := p.prepareRequest( - ctx, - "PATCH", - fmt.Sprintf("/products/%v/price_points/%v/unarchive.json", productId, pricePointId), - ) - req.Authenticate(true) - - var result models.ProductPricePointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId int, + pricePointId int) ( + models.ApiResponse[models.ProductPricePointResponse], + error) { + req := p.prepareRequest( + ctx, + "PATCH", + fmt.Sprintf("/products/%v/price_points/%v/unarchive.json", productId, pricePointId), + ) + req.Authenticate(true) + + var result models.ProductPricePointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductPricePointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// PromoteProductPricePointToDefault takes context, productId, pricePointId as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to make a product price point the default for the product. +// PromoteProductPricePointToDefault takes context, productId, pricePointId as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to make a product price point the default for the product. // Note: Custom product price points are not able to be set as the default for a product. func (p *ProductPricePointsController) PromoteProductPricePointToDefault( - ctx context.Context, - productId int, - pricePointId int) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest( - ctx, - "PATCH", - fmt.Sprintf("/products/%v/price_points/%v/default.json", productId, pricePointId), - ) - req.Authenticate(true) - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId int, + pricePointId int) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest( + ctx, + "PATCH", + fmt.Sprintf("/products/%v/price_points/%v/default.json", productId, pricePointId), + ) + req.Authenticate(true) + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateProductPricePoints takes context, productId, body as parameters and -// returns an models.ApiResponse with models.BulkCreateProductPricePointsResponse data and -// an error if there was an issue with the request or response. +// BulkCreateProductPricePoints takes context, productId, body as parameters and +// returns an models.ApiResponse with models.BulkCreateProductPricePointsResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to create multiple product price points in one request. -func (p *ProductPricePointsController) CreateProductPricePoints( - ctx context.Context, - productId int, - body *models.BulkCreateProductPricePointsRequest) ( - models.ApiResponse[models.BulkCreateProductPricePointsResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/products/%v/price_points/bulk.json", productId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.BulkCreateProductPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BulkCreateProductPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (p *ProductPricePointsController) BulkCreateProductPricePoints( + ctx context.Context, + productId int, + body *models.BulkCreateProductPricePointsRequest) ( + models.ApiResponse[models.BulkCreateProductPricePointsResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/products/%v/price_points/bulk.json", productId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.BulkCreateProductPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BulkCreateProductPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateProductCurrencyPrices takes context, productPricePointId, body as parameters and -// returns an models.ApiResponse with models.CurrencyPricesResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. -// When creating currency prices, they need to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. +// CreateProductCurrencyPrices takes context, productPricePointId, body as parameters and +// returns an models.ApiResponse with models.CurrencyPricesResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. +// When creating currency prices, they need to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. // Note: Currency Prices are not able to be created for custom product price points. func (p *ProductPricePointsController) CreateProductCurrencyPrices( - ctx context.Context, - productPricePointId int, - body *models.CreateProductCurrencyPricesRequest) ( - models.ApiResponse[models.CurrencyPricesResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_price_points/%v/currency_prices.json", productPricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CurrencyPricesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CurrencyPricesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productPricePointId int, + body *models.CreateProductCurrencyPricesRequest) ( + models.ApiResponse[models.CurrencyPricesResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_price_points/%v/currency_prices.json", productPricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CurrencyPricesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CurrencyPricesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateProductCurrencyPrices takes context, productPricePointId, body as parameters and -// returns an models.ApiResponse with models.CurrencyPricesResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to update the `price`s of currency prices for a given currency that exists on the product price point. -// When updating the pricing, it needs to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. +// UpdateProductCurrencyPrices takes context, productPricePointId, body as parameters and +// returns an models.ApiResponse with models.CurrencyPricesResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to update the `price`s of currency prices for a given currency that exists on the product price point. +// When updating the pricing, it needs to mirror the structure of your primary pricing. If the product price point defines a trial and/or setup fee, each currency must also define a trial and/or setup fee. // Note: Currency Prices are not able to be updated for custom product price points. func (p *ProductPricePointsController) UpdateProductCurrencyPrices( - ctx context.Context, - productPricePointId int, - body *models.UpdateCurrencyPricesRequest) ( - models.ApiResponse[models.CurrencyPricesResponse], - error) { - req := p.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/product_price_points/%v/currency_prices.json", productPricePointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CurrencyPricesResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CurrencyPricesResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productPricePointId int, + body *models.UpdateCurrencyPricesRequest) ( + models.ApiResponse[models.CurrencyPricesResponse], + error) { + req := p.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/product_price_points/%v/currency_prices.json", productPricePointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CurrencyPricesResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CurrencyPricesResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListAllProductPricePoints takes context, direction, filterArchivedAt, filterDateField, filterEndDate, filterEndDatetime, filterIds, filterStartDate, filterStartDatetime, filterType, include, page, perPage as parameters and -// returns an models.ApiResponse with models.ListProductPricePointsResponse data and -// an error if there was an issue with the request or response. +// ListAllProductPricePoints takes context, direction, filterArchivedAt, filterDateField, filterEndDate, filterEndDatetime, filterIds, filterStartDate, filterStartDatetime, filterType, include, page, perPage as parameters and +// returns an models.ApiResponse with models.ListProductPricePointsResponse data and +// an error if there was an issue with the request or response. // This method allows retrieval of a list of Products Price Points belonging to a Site. func (p *ProductPricePointsController) ListAllProductPricePoints( - ctx context.Context, - direction *models.SortingDirection, - filterArchivedAt *models.IncludeNotNull, - filterDateField *models.BasicDateField, - filterEndDate *time.Time, - filterEndDatetime *time.Time, - filterIds []int, - filterStartDate *time.Time, - filterStartDatetime *time.Time, - filterType []models.PricePointType, - include *models.ListProductsPricePointsInclude, - page *int, - perPage *int) ( - models.ApiResponse[models.ListProductPricePointsResponse], - error) { - req := p.prepareRequest(ctx, "GET", "/products_price_points.json") - req.Authenticate(true) - if direction != nil { - req.QueryParam("direction", *direction) - } - if filterArchivedAt != nil { - req.QueryParam("filter[archived_at]", *filterArchivedAt) - } - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - if filterEndDatetime != nil { - req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) - } - if filterIds != nil { - req.QueryParam("filter[ids]", filterIds) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if filterStartDatetime != nil { - req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) - } - if filterType != nil { - req.QueryParam("filter[type]", filterType) - } - if include != nil { - req.QueryParam("include", *include) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - var result models.ListProductPricePointsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListProductPricePointsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + direction *models.SortingDirection, + filterArchivedAt *models.IncludeNotNull, + filterDateField *models.BasicDateField, + filterEndDate *time.Time, + filterEndDatetime *time.Time, + filterIds []int, + filterStartDate *time.Time, + filterStartDatetime *time.Time, + filterType []models.PricePointType, + include *models.ListProductsPricePointsInclude, + page *int, + perPage *int) ( + models.ApiResponse[models.ListProductPricePointsResponse], + error) { + req := p.prepareRequest(ctx, "GET", "/products_price_points.json") + req.Authenticate(true) + if direction != nil { + req.QueryParam("direction", *direction) + } + if filterArchivedAt != nil { + req.QueryParam("filter[archived_at]", *filterArchivedAt) + } + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + if filterEndDatetime != nil { + req.QueryParam("filter[end_datetime]", filterEndDatetime.Format(time.RFC3339)) + } + if filterIds != nil { + req.QueryParam("filter[ids]", filterIds) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if filterStartDatetime != nil { + req.QueryParam("filter[start_datetime]", filterStartDatetime.Format(time.RFC3339)) + } + if filterType != nil { + req.QueryParam("filter[type]", filterType) + } + if include != nil { + req.QueryParam("include", *include) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + var result models.ListProductPricePointsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListProductPricePointsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/products_controller.go b/products_controller.go index 586f3929..4a5d864c 100644 --- a/products_controller.go +++ b/products_controller.go @@ -1,282 +1,282 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "time" ) // ProductsController represents a controller struct. type ProductsController struct { - baseController + baseController } -// NewProductsController creates a new instance of ProductsController. +// NewProductsController creates a new instance of ProductsController. // It takes a baseController as a parameter and returns a pointer to the ProductsController. func NewProductsController(baseController baseController) *ProductsController { - productsController := ProductsController{baseController: baseController} - return &productsController + productsController := ProductsController{baseController: baseController} + return &productsController } -// CreateProduct takes context, productFamilyId, body as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. -// Use this method to create a product within your Chargify site. -// + [Products Documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405561405709) +// CreateProduct takes context, productFamilyId, body as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. +// Use this method to create a product within your Chargify site. +// + [Products Documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405561405709) // + [Changing a Subscription's Product](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404225334669-Product-Changes-Migrations) func (p *ProductsController) CreateProduct( - ctx context.Context, - productFamilyId int, - body *models.CreateOrUpdateProductRequest) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/product_families/%v/products.json", productFamilyId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productFamilyId int, + body *models.CreateOrUpdateProductRequest) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/product_families/%v/products.json", productFamilyId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadProduct takes context, productId as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. +// ReadProduct takes context, productId as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. // This endpoint allows you to read the current details of a product that you've created in Chargify. func (p *ProductsController) ReadProduct( - ctx context.Context, - productId int) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest(ctx, "GET", fmt.Sprintf("/products/%v.json", productId)) - req.Authenticate(true) - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId int) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest(ctx, "GET", fmt.Sprintf("/products/%v.json", productId)) + req.Authenticate(true) + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateProduct takes context, productId, body as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. -// Use this method to change aspects of an existing product. -// ### Input Attributes Update Notes -// + `update_return_params` The parameters we will append to your `update_return_url`. See Return URLs and Parameters -// ### Product Price Point +// UpdateProduct takes context, productId, body as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. +// Use this method to change aspects of an existing product. +// ### Input Attributes Update Notes +// + `update_return_params` The parameters we will append to your `update_return_url`. See Return URLs and Parameters +// ### Product Price Point // Updating a product using this endpoint will create a new price point and set it as the default price point for this product. If you should like to update an existing product price point, that must be done separately. func (p *ProductsController) UpdateProduct( - ctx context.Context, - productId int, - body *models.CreateOrUpdateProductRequest) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest(ctx, "PUT", fmt.Sprintf("/products/%v.json", productId)) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId int, + body *models.CreateOrUpdateProductRequest) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest(ctx, "PUT", fmt.Sprintf("/products/%v.json", productId)) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ArchiveProduct takes context, productId as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. -// Sending a DELETE request to this endpoint will archive the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. +// ArchiveProduct takes context, productId as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. +// Sending a DELETE request to this endpoint will archive the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. // This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. func (p *ProductsController) ArchiveProduct( - ctx context.Context, - productId int) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/products/%v.json", productId), - ) - req.Authenticate(true) - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + productId int) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/products/%v.json", productId), + ) + req.Authenticate(true) + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadProductByHandle takes context, apiHandle as parameters and -// returns an models.ApiResponse with models.ProductResponse data and -// an error if there was an issue with the request or response. +// ReadProductByHandle takes context, apiHandle as parameters and +// returns an models.ApiResponse with models.ProductResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve a Product object by its `api_handle`. func (p *ProductsController) ReadProductByHandle( - ctx context.Context, - apiHandle string) ( - models.ApiResponse[models.ProductResponse], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/products/handle/%v.json", apiHandle), - ) - req.Authenticate(true) - - var result models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + apiHandle string) ( + models.ApiResponse[models.ProductResponse], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/products/handle/%v.json", apiHandle), + ) + req.Authenticate(true) + + var result models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListProducts takes context, dateField, endDate, endDatetime, startDate, startDatetime, page, perPage, includeArchived, include, filterPrepaidProductPricePointProductPricePointId, filterUseSiteExchangeRate as parameters and -// returns an models.ApiResponse with []models.ProductResponse data and -// an error if there was an issue with the request or response. +// ListProducts takes context, dateField, endDate, endDatetime, startDate, startDatetime, page, perPage, includeArchived, include, filterPrepaidProductPricePointProductPricePointId, filterUseSiteExchangeRate as parameters and +// returns an models.ApiResponse with []models.ProductResponse data and +// an error if there was an issue with the request or response. // This method allows to retrieve a list of Products belonging to a Site. func (p *ProductsController) ListProducts( - ctx context.Context, - dateField *models.BasicDateField, - endDate *time.Time, - endDatetime *time.Time, - startDate *time.Time, - startDatetime *time.Time, - page *int, - perPage *int, - includeArchived *bool, - include *models.ListProductsInclude, - filterPrepaidProductPricePointProductPricePointId *models.IncludeNotNull, - filterUseSiteExchangeRate *bool) ( - models.ApiResponse[[]models.ProductResponse], - error) { - req := p.prepareRequest(ctx, "GET", "/products.json") - req.Authenticate(true) - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if endDate != nil { - req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) - } - if endDatetime != nil { - req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) - } - if startDate != nil { - req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) - } - if startDatetime != nil { - req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if includeArchived != nil { - req.QueryParam("include_archived", *includeArchived) - } - if include != nil { - req.QueryParam("include", *include) - } - if filterPrepaidProductPricePointProductPricePointId != nil { - req.QueryParam("filter[prepaid_product_price_point][product_price_point_id]", *filterPrepaidProductPricePointProductPricePointId) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - var result []models.ProductResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ProductResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + dateField *models.BasicDateField, + endDate *time.Time, + endDatetime *time.Time, + startDate *time.Time, + startDatetime *time.Time, + page *int, + perPage *int, + includeArchived *bool, + include *models.ListProductsInclude, + filterPrepaidProductPricePointProductPricePointId *models.IncludeNotNull, + filterUseSiteExchangeRate *bool) ( + models.ApiResponse[[]models.ProductResponse], + error) { + req := p.prepareRequest(ctx, "GET", "/products.json") + req.Authenticate(true) + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if endDate != nil { + req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) + } + if endDatetime != nil { + req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) + } + if startDate != nil { + req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) + } + if startDatetime != nil { + req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if includeArchived != nil { + req.QueryParam("include_archived", *includeArchived) + } + if include != nil { + req.QueryParam("include", *include) + } + if filterPrepaidProductPricePointProductPricePointId != nil { + req.QueryParam("filter[prepaid_product_price_point][product_price_point_id]", *filterPrepaidProductPricePointProductPricePointId) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + var result []models.ProductResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ProductResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/proforma_invoices_controller.go b/proforma_invoices_controller.go index 9066969b..78ded5c4 100644 --- a/proforma_invoices_controller.go +++ b/proforma_invoices_controller.go @@ -1,438 +1,438 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // ProformaInvoicesController represents a controller struct. type ProformaInvoicesController struct { - baseController + baseController } -// NewProformaInvoicesController creates a new instance of ProformaInvoicesController. +// NewProformaInvoicesController creates a new instance of ProformaInvoicesController. // It takes a baseController as a parameter and returns a pointer to the ProformaInvoicesController. func NewProformaInvoicesController(baseController baseController) *ProformaInvoicesController { - proformaInvoicesController := ProformaInvoicesController{baseController: baseController} - return &proformaInvoicesController + proformaInvoicesController := ProformaInvoicesController{baseController: baseController} + return &proformaInvoicesController } -// CreateConsolidatedProformaInvoice takes context, uid as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This endpoint will trigger the creation of 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. -// If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. -// ## Restrictions +// CreateConsolidatedProformaInvoice takes context, uid as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This endpoint will trigger the creation of 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. +// If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. +// ## Restrictions // Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be prepaid, and must be in a live state. func (p *ProformaInvoicesController) CreateConsolidatedProformaInvoice( - ctx context.Context, - uid string) ( - *http.Response, - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/proforma_invoices.json", uid), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + uid string) ( + *http.Response, + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/proforma_invoices.json", uid), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// ListSubscriptionGroupProformaInvoices takes context, uid as parameters and -// returns an models.ApiResponse with models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// Only proforma invoices with a `consolidation_level` of parent are returned. +// ListSubscriptionGroupProformaInvoices takes context, uid as parameters and +// returns an models.ApiResponse with models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// Only proforma invoices with a `consolidation_level` of parent are returned. // By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to true. func (p *ProformaInvoicesController) ListSubscriptionGroupProformaInvoices( - ctx context.Context, - uid string) ( - models.ApiResponse[models.ProformaInvoice], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscription_groups/%v/proforma_invoices.json", uid), - ) - req.Authenticate(true) - - var result models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.ProformaInvoice], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscription_groups/%v/proforma_invoices.json", uid), + ) + req.Authenticate(true) + + var result models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ReadProformaInvoice takes context, proformaInvoiceUid as parameters and -// returns an models.ApiResponse with models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// Use this endpoint to read the details of an existing proforma invoice. -// ## Restrictions +// ReadProformaInvoice takes context, proformaInvoiceUid as parameters and +// returns an models.ApiResponse with models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// Use this endpoint to read the details of an existing proforma invoice. +// ## Restrictions // Proforma invoices are only available on Relationship Invoicing sites. func (p *ProformaInvoicesController) ReadProformaInvoice( - ctx context.Context, - proformaInvoiceUid int) ( - models.ApiResponse[models.ProformaInvoice], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/proforma_invoices/%v.json", proformaInvoiceUid), - ) - req.Authenticate(true) - - var result models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + proformaInvoiceUid int) ( + models.ApiResponse[models.ProformaInvoice], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/proforma_invoices/%v.json", proformaInvoiceUid), + ) + req.Authenticate(true) + + var result models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// CreateProformaInvoice takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. -// If you would like to preview the next billing amounts without generating a full proforma invoice, please use the renewal preview endpoint. -// ## Restrictions +// CreateProformaInvoice takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. +// If you would like to preview the next billing amounts without generating a full proforma invoice, please use the renewal preview endpoint. +// ## Restrictions // Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be in a group, must not be prepaid, and must be in a live state. func (p *ProformaInvoicesController) CreateProformaInvoice( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.ProformaInvoice], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/proforma_invoices.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.ProformaInvoice], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/proforma_invoices.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListProformaInvoices takes context, subscriptionId, startDate, endDate, status, page, perPage, direction, lineItems, discounts, taxes, credits, payments, customFields as parameters and -// returns an models.ApiResponse with []models.ProformaInvoice data and -// an error if there was an issue with the request or response. +// ListProformaInvoices takes context, subscriptionId, startDate, endDate, status, page, perPage, direction, lineItems, discounts, taxes, credits, payments, customFields as parameters and +// returns an models.ApiResponse with []models.ProformaInvoice data and +// an error if there was an issue with the request or response. // By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. func (p *ProformaInvoicesController) ListProformaInvoices( - ctx context.Context, - subscriptionId int, - startDate *string, - endDate *string, - status *models.InvoiceStatus, - page *int, - perPage *int, - direction *models.Direction, - lineItems *bool, - discounts *bool, - taxes *bool, - credits *bool, - payments *bool, - customFields *bool) ( - models.ApiResponse[[]models.ProformaInvoice], - error) { - req := p.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/proforma_invoices.json", subscriptionId), - ) - req.Authenticate(true) - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if status != nil { - req.QueryParam("status", *status) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if lineItems != nil { - req.QueryParam("line_items", *lineItems) - } - if discounts != nil { - req.QueryParam("discounts", *discounts) - } - if taxes != nil { - req.QueryParam("taxes", *taxes) - } - if credits != nil { - req.QueryParam("credits", *credits) - } - if payments != nil { - req.QueryParam("payments", *payments) - } - if customFields != nil { - req.QueryParam("custom_fields", *customFields) - } - - var result []models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + startDate *string, + endDate *string, + status *models.InvoiceStatus, + page *int, + perPage *int, + direction *models.Direction, + lineItems *bool, + discounts *bool, + taxes *bool, + credits *bool, + payments *bool, + customFields *bool) ( + models.ApiResponse[[]models.ProformaInvoice], + error) { + req := p.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/proforma_invoices.json", subscriptionId), + ) + req.Authenticate(true) + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if status != nil { + req.QueryParam("status", *status) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if lineItems != nil { + req.QueryParam("line_items", *lineItems) + } + if discounts != nil { + req.QueryParam("discounts", *discounts) + } + if taxes != nil { + req.QueryParam("taxes", *taxes) + } + if credits != nil { + req.QueryParam("credits", *credits) + } + if payments != nil { + req.QueryParam("payments", *payments) + } + if customFields != nil { + req.QueryParam("custom_fields", *customFields) + } + + var result []models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// VoidProformaInvoice takes context, proformaInvoiceUid, body as parameters and -// returns an models.ApiResponse with models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// This endpoint will void a proforma invoice that has the status "draft". -// ## Restrictions -// Proforma invoices are only available on Relationship Invoicing sites. -// Only proforma invoices that have the appropriate status may be reopened. If the invoice identified by {uid} does not have the appropriate status, the response will have HTTP status code 422 and an error message. +// VoidProformaInvoice takes context, proformaInvoiceUid, body as parameters and +// returns an models.ApiResponse with models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// This endpoint will void a proforma invoice that has the status "draft". +// ## Restrictions +// Proforma invoices are only available on Relationship Invoicing sites. +// Only proforma invoices that have the appropriate status may be reopened. If the invoice identified by {uid} does not have the appropriate status, the response will have HTTP status code 422 and an error message. // A reason for the void operation is required to be included in the request body. If one is not provided, the response will have HTTP status code 422 and an error message. func (p *ProformaInvoicesController) VoidProformaInvoice( - ctx context.Context, - proformaInvoiceUid string, - body *models.VoidInvoiceRequest) ( - models.ApiResponse[models.ProformaInvoice], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/proforma_invoices/%v/void.json", proformaInvoiceUid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + proformaInvoiceUid string, + body *models.VoidInvoiceRequest) ( + models.ApiResponse[models.ProformaInvoice], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/proforma_invoices/%v/void.json", proformaInvoiceUid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// PreviewProformaInvoice takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.ProformaInvoicePreview data and -// an error if there was an issue with the request or response. -// Return 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. -// 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. -// If all the data returned in the preview is as expected, you may then create a static proforma invoice and send it to your customer. The data within a preview will not be saved and will not be accessible after the call is made. +// PreviewProformaInvoice takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.ProformaInvoicePreview data and +// an error if there was an issue with the request or response. +// Return 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. +// 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. +// If all the data returned in the preview is as expected, you may then create a static proforma invoice and send it to your customer. The data within a preview will not be saved and will not be accessible after the call is made. // Alternatively, if you have some proforma invoices already, you may make a preview call to determine whether any billing information for the subscription's upcoming renewal has changed. func (p *ProformaInvoicesController) PreviewProformaInvoice( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.ProformaInvoicePreview], - error) { - req := p.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/proforma_invoices/preview.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.ProformaInvoicePreview - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoicePreview](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.ProformaInvoicePreview], + error) { + req := p.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/proforma_invoices/preview.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.ProformaInvoicePreview + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoicePreview](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateSignupProformaInvoice takes context, body as parameters and -// returns an models.ApiResponse with models.ProformaInvoice data and -// an error if there was an issue with the request or response. -// This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. -// Create a proforma invoice to preview costs before a subscription's signup. Like other proforma invoices, it can be emailed to the customer, voided, and publicly viewed on the chargifypay domain. -// Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. +// CreateSignupProformaInvoice takes context, body as parameters and +// returns an models.ApiResponse with models.ProformaInvoice data and +// an error if there was an issue with the request or response. +// This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. +// Create a proforma invoice to preview costs before a subscription's signup. Like other proforma invoices, it can be emailed to the customer, voided, and publicly viewed on the chargifypay domain. +// Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. // A product and customer first name, last name, and email are the minimum requirements. We recommend associating the proforma invoice with a customer_id to easily find their proforma invoices, since the subscription_id will always be blank. func (p *ProformaInvoicesController) CreateSignupProformaInvoice( - ctx context.Context, - body *models.CreateSubscriptionRequest) ( - models.ApiResponse[models.ProformaInvoice], - error) { - req := p.prepareRequest(ctx, "POST", "/subscriptions/proforma_invoices.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.ProformaInvoice - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 400 { - err = errors.NewProformaBadRequestErrorResponse(400, "Bad Request") - } - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateSubscriptionRequest) ( + models.ApiResponse[models.ProformaInvoice], + error) { + req := p.prepareRequest(ctx, "POST", "/subscriptions/proforma_invoices.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.ProformaInvoice + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ProformaInvoice](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 400 { + err = errors.NewProformaBadRequestErrorResponse(400, "Bad Request") + } + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// PreviewSignupProformaInvoice takes context, includeNextProformaInvoice, body as parameters and -// returns an models.ApiResponse with models.SignupProformaPreviewResponse data and -// an error if there was an issue with the request or response. -// This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. -// Create a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. You have the option of optionally previewing the first renewal's costs as well. The proforma invoice preview will not be persisted. -// Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. +// PreviewSignupProformaInvoice takes context, includeNextProformaInvoice, body as parameters and +// returns an models.ApiResponse with models.SignupProformaPreviewResponse data and +// an error if there was an issue with the request or response. +// This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. +// Create a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. You have the option of optionally previewing the first renewal's costs as well. The proforma invoice preview will not be persisted. +// Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. // A product and customer first name, last name, and email are the minimum requirements. func (p *ProformaInvoicesController) PreviewSignupProformaInvoice( - ctx context.Context, - includeNextProformaInvoice *string, - body *models.CreateSubscriptionRequest) ( - models.ApiResponse[models.SignupProformaPreviewResponse], - error) { - req := p.prepareRequest( - ctx, - "POST", - "/subscriptions/proforma_invoices/preview.json", - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if includeNextProformaInvoice != nil { - req.QueryParam("include=next_proforma_invoice", *includeNextProformaInvoice) - } - if body != nil { - req.Json(*body) - } - var result models.SignupProformaPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SignupProformaPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 400 { - err = errors.NewProformaBadRequestErrorResponse(400, "Bad Request") - } - if resp.StatusCode == 422 { - err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + includeNextProformaInvoice *string, + body *models.CreateSubscriptionRequest) ( + models.ApiResponse[models.SignupProformaPreviewResponse], + error) { + req := p.prepareRequest( + ctx, + "POST", + "/subscriptions/proforma_invoices/preview.json", + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if includeNextProformaInvoice != nil { + req.QueryParam("include=next_proforma_invoice", *includeNextProformaInvoice) + } + if body != nil { + req.Json(*body) + } + var result models.SignupProformaPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SignupProformaPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 400 { + err = errors.NewProformaBadRequestErrorResponse(400, "Bad Request") + } + if resp.StatusCode == 422 { + err = errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/reason_codes_controller.go b/reason_codes_controller.go index 8f1f9013..3de4e429 100644 --- a/reason_codes_controller.go +++ b/reason_codes_controller.go @@ -1,216 +1,216 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // ReasonCodesController represents a controller struct. type ReasonCodesController struct { - baseController + baseController } -// NewReasonCodesController creates a new instance of ReasonCodesController. +// NewReasonCodesController creates a new instance of ReasonCodesController. // It takes a baseController as a parameter and returns a pointer to the ReasonCodesController. func NewReasonCodesController(baseController baseController) *ReasonCodesController { - reasonCodesController := ReasonCodesController{baseController: baseController} - return &reasonCodesController + reasonCodesController := ReasonCodesController{baseController: baseController} + return &reasonCodesController } -// CreateReasonCode takes context, body as parameters and -// returns an models.ApiResponse with models.ReasonCodeResponse data and -// an error if there was an issue with the request or response. -// # Reason Codes Intro -// ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription to your product or service. -// Add a set of churn reason codes to be displayed in-app and/or the Chargify 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 Chargify can be located under the following links. -// [Churn Reason Codes](https://chargify.zendesk.com/hc/en-us/articles/4407896775579#churn-reason-codes) -// ## Create Reason Code +// CreateReasonCode takes context, body as parameters and +// returns an models.ApiResponse with models.ReasonCodeResponse data and +// an error if there was an issue with the request or response. +// # Reason Codes Intro +// ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription to your product or service. +// Add a set of churn reason codes to be displayed in-app and/or the Chargify 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 Chargify can be located under the following links. +// [Churn Reason Codes](https://chargify.zendesk.com/hc/en-us/articles/4407896775579#churn-reason-codes) +// ## Create Reason Code // This method gives a merchant the option to create a reason codes for a given Site. func (r *ReasonCodesController) CreateReasonCode( - ctx context.Context, - body *models.CreateReasonCodeRequest) ( - models.ApiResponse[models.ReasonCodeResponse], - error) { - req := r.prepareRequest(ctx, "POST", "/reason_codes.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.ReasonCodeResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateReasonCodeRequest) ( + models.ApiResponse[models.ReasonCodeResponse], + error) { + req := r.prepareRequest(ctx, "POST", "/reason_codes.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.ReasonCodeResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListReasonCodes takes context, page, perPage as parameters and -// returns an models.ApiResponse with []models.ReasonCodeResponse data and -// an error if there was an issue with the request or response. +// ListReasonCodes takes context, page, perPage as parameters and +// returns an models.ApiResponse with []models.ReasonCodeResponse data and +// an error if there was an issue with the request or response. // This method gives a merchant the option to retrieve a list of all of the current churn codes for a given site. func (r *ReasonCodesController) ListReasonCodes( - ctx context.Context, - page *int, - perPage *int) ( - models.ApiResponse[[]models.ReasonCodeResponse], - error) { - req := r.prepareRequest(ctx, "GET", "/reason_codes.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - var result []models.ReasonCodeResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ReasonCodeResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int) ( + models.ApiResponse[[]models.ReasonCodeResponse], + error) { + req := r.prepareRequest(ctx, "GET", "/reason_codes.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + var result []models.ReasonCodeResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ReasonCodeResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadReasonCode takes context, reasonCodeId as parameters and -// returns an models.ApiResponse with models.ReasonCodeResponse data and -// an error if there was an issue with the request or response. +// ReadReasonCode takes context, reasonCodeId as parameters and +// returns an models.ApiResponse with models.ReasonCodeResponse data and +// an error if there was an issue with the request or response. // This method gives a merchant the option to retrieve a list of a particular code for a given Site by providing the unique numerical ID of the code. func (r *ReasonCodesController) ReadReasonCode( - ctx context.Context, - reasonCodeId int) ( - models.ApiResponse[models.ReasonCodeResponse], - error) { - req := r.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), - ) - req.Authenticate(true) - - var result models.ReasonCodeResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + reasonCodeId int) ( + models.ApiResponse[models.ReasonCodeResponse], + error) { + req := r.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), + ) + req.Authenticate(true) + + var result models.ReasonCodeResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// UpdateReasonCode takes context, reasonCodeId, body as parameters and -// returns an models.ApiResponse with models.ReasonCodeResponse data and -// an error if there was an issue with the request or response. +// UpdateReasonCode takes context, reasonCodeId, body as parameters and +// returns an models.ApiResponse with models.ReasonCodeResponse data and +// an error if there was an issue with the request or response. // This method gives a merchant the option to update an existing reason code for a given site. func (r *ReasonCodesController) UpdateReasonCode( - ctx context.Context, - reasonCodeId int, - body *models.UpdateReasonCodeRequest) ( - models.ApiResponse[models.ReasonCodeResponse], - error) { - req := r.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ReasonCodeResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + reasonCodeId int, + body *models.UpdateReasonCodeRequest) ( + models.ApiResponse[models.ReasonCodeResponse], + error) { + req := r.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ReasonCodeResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReasonCodeResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// DeleteReasonCode takes context, reasonCodeId as parameters and -// returns an models.ApiResponse with models.ReasonCodesJsonResponse data and -// an error if there was an issue with the request or response. +// DeleteReasonCode takes context, reasonCodeId as parameters and +// returns an models.ApiResponse with models.ReasonCodesJsonResponse data and +// an error if there was an issue with the request or response. // This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. func (r *ReasonCodesController) DeleteReasonCode( - ctx context.Context, - reasonCodeId int) ( - models.ApiResponse[models.ReasonCodesJsonResponse], - error) { - req := r.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), - ) - req.Authenticate(true) - - var result models.ReasonCodesJsonResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReasonCodesJsonResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + reasonCodeId int) ( + models.ApiResponse[models.ReasonCodesJsonResponse], + error) { + req := r.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/reason_codes/%v.json", reasonCodeId), + ) + req.Authenticate(true) + + var result models.ReasonCodesJsonResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReasonCodesJsonResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } diff --git a/referral_codes_controller.go b/referral_codes_controller.go index ec6da2b3..8495c25b 100644 --- a/referral_codes_controller.go +++ b/referral_codes_controller.go @@ -1,57 +1,57 @@ package advancedbilling import ( - "context" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // ReferralCodesController represents a controller struct. type ReferralCodesController struct { - baseController + baseController } -// NewReferralCodesController creates a new instance of ReferralCodesController. +// NewReferralCodesController creates a new instance of ReferralCodesController. // It takes a baseController as a parameter and returns a pointer to the ReferralCodesController. func NewReferralCodesController(baseController baseController) *ReferralCodesController { - referralCodesController := ReferralCodesController{baseController: baseController} - return &referralCodesController + referralCodesController := ReferralCodesController{baseController: baseController} + return &referralCodesController } -// ValidateReferralCode takes context, code as parameters and -// returns an models.ApiResponse with models.ReferralValidationResponse data and -// an error if there was an issue with the request or response. -// Use this method to determine if the 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407802831643). -// ## Server Response +// ValidateReferralCode takes context, code as parameters and +// returns an models.ApiResponse with models.ReferralValidationResponse data and +// an error if there was an issue with the request or response. +// Use this method to determine if the 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407802831643). +// ## 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. func (r *ReferralCodesController) ValidateReferralCode( - ctx context.Context, - code string) ( - models.ApiResponse[models.ReferralValidationResponse], - error) { - req := r.prepareRequest(ctx, "GET", "/referral_codes/validate.json") - req.Authenticate(true) - req.QueryParam("code", code) - var result models.ReferralValidationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReferralValidationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewSingleStringErrorResponse(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + code string) ( + models.ApiResponse[models.ReferralValidationResponse], + error) { + req := r.prepareRequest(ctx, "GET", "/referral_codes/validate.json") + req.Authenticate(true) + req.QueryParam("code", code) + var result models.ReferralValidationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReferralValidationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewSingleStringErrorResponse(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } diff --git a/sales_commissions_controller.go b/sales_commissions_controller.go index 148e0ab8..08ba9402 100644 --- a/sales_commissions_controller.go +++ b/sales_commissions_controller.go @@ -1,183 +1,183 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/models" ) // SalesCommissionsController represents a controller struct. type SalesCommissionsController struct { - baseController + baseController } -// NewSalesCommissionsController creates a new instance of SalesCommissionsController. +// NewSalesCommissionsController creates a new instance of SalesCommissionsController. // It takes a baseController as a parameter and returns a pointer to the SalesCommissionsController. func NewSalesCommissionsController(baseController baseController) *SalesCommissionsController { - salesCommissionsController := SalesCommissionsController{baseController: baseController} - return &salesCommissionsController + salesCommissionsController := SalesCommissionsController{baseController: baseController} + return &salesCommissionsController } -// ListSalesCommissionSettings takes context, sellerId, authorization, liveMode, page, perPage as parameters and -// returns an models.ApiResponse with []models.SaleRepSettings data and -// an error if there was an issue with the request or response. -// Endpoint returns subscriptions with associated sales reps -// ## 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -// 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 please contact Chargify support. +// ListSalesCommissionSettings takes context, sellerId, authorization, liveMode, page, perPage as parameters and +// returns an models.ApiResponse with []models.SaleRepSettings data and +// an error if there was an issue with the request or response. +// Endpoint returns subscriptions with associated sales reps +// ## 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). +// 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 please contact Chargify support. // > Note: The request is at seller level, it means `<>` variable will be replaced by `app` func (s *SalesCommissionsController) ListSalesCommissionSettings( - ctx context.Context, - sellerId string, - authorization *string, - liveMode *bool, - page *int, - perPage *int) ( - models.ApiResponse[[]models.SaleRepSettings], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/sellers/%v/sales_commission_settings.json", sellerId), - ) - req.Authenticate(true) - if authorization != nil { - req.Header("Authorization", *authorization) - } - if liveMode != nil { - req.QueryParam("live_mode", *liveMode) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result []models.SaleRepSettings - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.SaleRepSettings](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + sellerId string, + authorization *string, + liveMode *bool, + page *int, + perPage *int) ( + models.ApiResponse[[]models.SaleRepSettings], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/sellers/%v/sales_commission_settings.json", sellerId), + ) + req.Authenticate(true) + if authorization != nil { + req.Header("Authorization", *authorization) + } + if liveMode != nil { + req.QueryParam("live_mode", *liveMode) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result []models.SaleRepSettings + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.SaleRepSettings](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListSalesReps takes context, sellerId, authorization, liveMode, page, perPage as parameters and -// returns an models.ApiResponse with []models.ListSaleRepItem data and -// an error if there was an issue with the request or response. -// Endpoint returns sales rep list 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -// 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 please contact Chargify support. +// ListSalesReps takes context, sellerId, authorization, liveMode, page, perPage as parameters and +// returns an models.ApiResponse with []models.ListSaleRepItem data and +// an error if there was an issue with the request or response. +// Endpoint returns sales rep list 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). +// 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 please contact Chargify support. // > Note: The request is at seller level, it means `<>` variable will be replaced by `app` func (s *SalesCommissionsController) ListSalesReps( - ctx context.Context, - sellerId string, - authorization *string, - liveMode *bool, - page *int, - perPage *int) ( - models.ApiResponse[[]models.ListSaleRepItem], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/sellers/%v/sales_reps.json", sellerId), - ) - req.Authenticate(true) - if authorization != nil { - req.Header("Authorization", *authorization) - } - if liveMode != nil { - req.QueryParam("live_mode", *liveMode) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result []models.ListSaleRepItem - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.ListSaleRepItem](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + sellerId string, + authorization *string, + liveMode *bool, + page *int, + perPage *int) ( + models.ApiResponse[[]models.ListSaleRepItem], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/sellers/%v/sales_reps.json", sellerId), + ) + req.Authenticate(true) + if authorization != nil { + req.Header("Authorization", *authorization) + } + if liveMode != nil { + req.QueryParam("live_mode", *liveMode) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result []models.ListSaleRepItem + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.ListSaleRepItem](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadSalesRep takes context, sellerId, salesRepId, authorization, liveMode, page, perPage as parameters and -// returns an models.ApiResponse with models.SaleRep data and -// an error if there was an issue with the request or response. -// Endpoint returns sales rep and attached subscriptions 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). -// 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 please contact Chargify support. +// ReadSalesRep takes context, sellerId, salesRepId, authorization, liveMode, page, perPage as parameters and +// returns an models.ApiResponse with models.SaleRep data and +// an error if there was an issue with the request or response. +// Endpoint returns sales rep and attached subscriptions 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 resources were at the level of the site, therefore creating the API Key per site was a sufficient solution. To share resources at the seller level, a new authentication method was introduced, which is user authentication. Creating an API Key for a user is a required step to correctly use the Sales Commission API, more details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). +// 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 please contact Chargify support. // > Note: The request is at seller level, it means `<>` variable will be replaced by `app` func (s *SalesCommissionsController) ReadSalesRep( - ctx context.Context, - sellerId string, - salesRepId string, - authorization *string, - liveMode *bool, - page *int, - perPage *int) ( - models.ApiResponse[models.SaleRep], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/sellers/%v/sales_reps/%v.json", sellerId, salesRepId), - ) - req.Authenticate(true) - if authorization != nil { - req.Header("Authorization", *authorization) - } - if liveMode != nil { - req.QueryParam("live_mode", *liveMode) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result models.SaleRep - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SaleRep](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + sellerId string, + salesRepId string, + authorization *string, + liveMode *bool, + page *int, + perPage *int) ( + models.ApiResponse[models.SaleRep], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/sellers/%v/sales_reps/%v.json", sellerId, salesRepId), + ) + req.Authenticate(true) + if authorization != nil { + req.Header("Authorization", *authorization) + } + if liveMode != nil { + req.QueryParam("live_mode", *liveMode) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result models.SaleRep + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SaleRep](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/sites_controller.go b/sites_controller.go index 91441880..6e17172b 100644 --- a/sites_controller.go +++ b/sites_controller.go @@ -1,118 +1,118 @@ package advancedbilling import ( - "context" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // SitesController represents a controller struct. type SitesController struct { - baseController + baseController } -// NewSitesController creates a new instance of SitesController. +// NewSitesController creates a new instance of SitesController. // It takes a baseController as a parameter and returns a pointer to the SitesController. func NewSitesController(baseController baseController) *SitesController { - sitesController := SitesController{baseController: baseController} - return &sitesController + sitesController := SitesController{baseController: baseController} + return &sitesController } -// ReadSite takes context as parameters and -// returns an models.ApiResponse with models.SiteResponse data and -// an error if there was an issue with the request or response. -// This endpoint allows you to fetch some site data. -// Full documentation on Sites in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407870738587). -// Specifically, the [Clearing Site Data](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309) section is extremely relevant to this endpoint documentation. -// #### Relationship invoicing enabled -// If 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: +// ReadSite takes context as parameters and +// returns an models.ApiResponse with models.SiteResponse data and +// an error if there was an issue with the request or response. +// This endpoint allows you to fetch some site data. +// Full documentation on Sites in the Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407870738587). +// Specifically, the [Clearing Site Data](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309) section is extremely relevant to this endpoint documentation. +// #### Relationship invoicing enabled +// If 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 Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) func (s *SitesController) ReadSite(ctx context.Context) ( - models.ApiResponse[models.SiteResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/site.json") - req.Authenticate(true) - var result models.SiteResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SiteResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + models.ApiResponse[models.SiteResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/site.json") + req.Authenticate(true) + var result models.SiteResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SiteResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ClearSite takes context, cleanupScope as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This call is asynchronous and there may be a delay before the site data is fully deleted. If you are clearing site data for an automated test, you will need to build in a delay and/or check that there are no products, etc., in the site before proceeding. +// ClearSite takes context, cleanupScope as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This call is asynchronous and there may be a delay before the site data is fully deleted. If you are clearing site data for an automated test, you will need to build in a delay and/or check that there are no products, etc., in the site before proceeding. // **This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** func (s *SitesController) ClearSite( - ctx context.Context, - cleanupScope *models.CleanupScope) ( - *http.Response, - error) { - req := s.prepareRequest(ctx, "POST", "/sites/clear_data.json") - req.Authenticate(true) - if cleanupScope != nil { - req.QueryParam("cleanup_scope", *cleanupScope) - } - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + cleanupScope *models.CleanupScope) ( + *http.Response, + error) { + req := s.prepareRequest(ctx, "POST", "/sites/clear_data.json") + req.Authenticate(true) + if cleanupScope != nil { + req.QueryParam("cleanup_scope", *cleanupScope) + } + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// ListChargifyJsPublicKeys takes context, page, perPage as parameters and -// returns an models.ApiResponse with models.ListPublicKeysResponse data and -// an error if there was an issue with the request or response. +// ListChargifyJsPublicKeys takes context, page, perPage as parameters and +// returns an models.ApiResponse with models.ListPublicKeysResponse data and +// an error if there was an issue with the request or response. // This endpoint returns public keys used for Chargify.js. func (s *SitesController) ListChargifyJsPublicKeys( - ctx context.Context, - page *int, - perPage *int) ( - models.ApiResponse[models.ListPublicKeysResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/chargify_js_keys.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - var result models.ListPublicKeysResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListPublicKeysResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int) ( + models.ApiResponse[models.ListPublicKeysResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/chargify_js_keys.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + var result models.ListPublicKeysResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListPublicKeysResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/subscription_components_controller.go b/subscription_components_controller.go index 466b9824..46ccac1a 100644 --- a/subscription_components_controller.go +++ b/subscription_components_controller.go @@ -1,938 +1,938 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" + "time" ) // SubscriptionComponentsController represents a controller struct. type SubscriptionComponentsController struct { - baseController + baseController } -// NewSubscriptionComponentsController creates a new instance of SubscriptionComponentsController. +// NewSubscriptionComponentsController creates a new instance of SubscriptionComponentsController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionComponentsController. func NewSubscriptionComponentsController(baseController baseController) *SubscriptionComponentsController { - subscriptionComponentsController := SubscriptionComponentsController{baseController: baseController} - return &subscriptionComponentsController + subscriptionComponentsController := SubscriptionComponentsController{baseController: baseController} + return &subscriptionComponentsController } -// ReadSubscriptionComponent takes context, subscriptionId, componentId as parameters and -// returns an models.ApiResponse with models.SubscriptionComponentResponse data and -// an error if there was an issue with the request or response. +// ReadSubscriptionComponent takes context, subscriptionId, componentId as parameters and +// returns an models.ApiResponse with models.SubscriptionComponentResponse data and +// an error if there was an issue with the request or response. // This request will list information regarding a specific component owned by a subscription. func (s *SubscriptionComponentsController) ReadSubscriptionComponent( - ctx context.Context, - subscriptionId int, - componentId int) ( - models.ApiResponse[models.SubscriptionComponentResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/components/%v.json", subscriptionId, componentId), - ) - req.Authenticate(true) - - var result models.SubscriptionComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + componentId int) ( + models.ApiResponse[models.SubscriptionComponentResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/components/%v.json", subscriptionId, componentId), + ) + req.Authenticate(true) + + var result models.SubscriptionComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ListSubscriptionComponents takes context, subscriptionId, dateField, direction, endDate, endDatetime, pricePointIds, productFamilyIds, sort, startDate, startDatetime, include, filterUseSiteExchangeRate, filterCurrencies as parameters and -// returns an models.ApiResponse with []models.SubscriptionComponentResponse data and -// an error if there was an issue with the request or response. -// This request will list a subscription's applied components. -// ## Archived Components +// ListSubscriptionComponents takes context, subscriptionId, dateField, direction, endDate, endDatetime, pricePointIds, productFamilyIds, sort, startDate, startDatetime, include, filterUseSiteExchangeRate, filterCurrencies as parameters and +// returns an models.ApiResponse with []models.SubscriptionComponentResponse data and +// an error if there was an issue with the request or response. +// This request will list a subscription's applied components. +// ## Archived Components // When requesting to list components for a given subscription, if the subscription contains **archived** components they will be listed in the server response. func (s *SubscriptionComponentsController) ListSubscriptionComponents( - ctx context.Context, - subscriptionId int, - dateField *models.SubscriptionListDateField, - direction *models.SortingDirection, - endDate *string, - endDatetime *string, - pricePointIds *models.IncludeNotNull, - productFamilyIds []int, - sort *models.ListSubscriptionComponentsSort, - startDate *string, - startDatetime *string, - include *models.ListSubscriptionComponentsInclude, - filterUseSiteExchangeRate *bool, - filterCurrencies []string) ( - models.ApiResponse[[]models.SubscriptionComponentResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/components.json", subscriptionId), - ) - req.Authenticate(true) - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if pricePointIds != nil { - req.QueryParam("price_point_ids", *pricePointIds) - } - if productFamilyIds != nil { - req.QueryParam("product_family_ids", productFamilyIds) - } - if sort != nil { - req.QueryParam("sort", *sort) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if include != nil { - req.QueryParam("include", *include) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - if filterCurrencies != nil { - req.QueryParam("filter[currencies]", filterCurrencies) - } - - var result []models.SubscriptionComponentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.SubscriptionComponentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + dateField *models.SubscriptionListDateField, + direction *models.SortingDirection, + endDate *string, + endDatetime *string, + pricePointIds *models.IncludeNotNull, + productFamilyIds []int, + sort *models.ListSubscriptionComponentsSort, + startDate *string, + startDatetime *string, + include *models.ListSubscriptionComponentsInclude, + filterUseSiteExchangeRate *bool, + filterCurrencies []string) ( + models.ApiResponse[[]models.SubscriptionComponentResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/components.json", subscriptionId), + ) + req.Authenticate(true) + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if pricePointIds != nil { + req.QueryParam("price_point_ids", *pricePointIds) + } + if productFamilyIds != nil { + req.QueryParam("product_family_ids", productFamilyIds) + } + if sort != nil { + req.QueryParam("sort", *sort) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if include != nil { + req.QueryParam("include", *include) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + if filterCurrencies != nil { + req.QueryParam("filter[currencies]", filterCurrencies) + } + + var result []models.SubscriptionComponentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.SubscriptionComponentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateSubscriptionComponentsPricePoints takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.BulkComponentSPricePointAssignment data and -// an error if there was an issue with the request or response. -// Updates the price points on one or more of a subscription's components. -// The `price_point` key can take either a: -// 1. Price point id (integer) -// 2. Price point handle (string) +// BulkUpdateSubscriptionComponentsPricePoints takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.BulkComponentSPricePointAssignment data and +// an error if there was an issue with the request or response. +// Updates the price points on one or more of a subscription's components. +// The `price_point` key can take either a: +// 1. Price point id (integer) +// 2. Price point handle (string) // 3. `"_default"` string, which will reset the price point to the component's current default price point. -func (s *SubscriptionComponentsController) UpdateSubscriptionComponentsPricePoints( - ctx context.Context, - subscriptionId int, - body *models.BulkComponentSPricePointAssignment) ( - models.ApiResponse[models.BulkComponentSPricePointAssignment], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/price_points.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.BulkComponentSPricePointAssignment - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.BulkComponentSPricePointAssignment](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewComponentPricePointError(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionComponentsController) BulkUpdateSubscriptionComponentsPricePoints( + ctx context.Context, + subscriptionId int, + body *models.BulkComponentSPricePointAssignment) ( + models.ApiResponse[models.BulkComponentSPricePointAssignment], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/price_points.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.BulkComponentSPricePointAssignment + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.BulkComponentSPricePointAssignment](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewComponentPricePointError(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ResetSubscriptionComponentsPricePoints takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Resets all of a subscription's components to use the current default. +// BulkResetSubscriptionComponentsPricePoints takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Resets all of a subscription's components to use the current default. // **Note**: this will update the price point for all of the subscription's components, even ones that have not been allocated yet. -func (s *SubscriptionComponentsController) ResetSubscriptionComponentsPricePoints( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/price_points/reset.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (s *SubscriptionComponentsController) BulkResetSubscriptionComponentsPricePoints( + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/price_points/reset.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// AllocateComponent takes context, subscriptionId, componentId, body as parameters and -// returns an models.ApiResponse with models.AllocationResponse data and -// an error if there was an issue with the request or response. -// This endpoint creates a new allocation, setting the current allocated quantity for the Component and recording a memo. -// **Notice**: Allocations can only be updated for Quantity, On/Off, and Prepaid Components. -// ## Allocations Documentation -// Full documentation on how to record Allocations in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997). It is focused on how allocations operate within the Chargify UI.It goes into greater detail on how the user interface will react when recording allocations. -// This documentation also goes into greater detail on how proration is taken into consideration when applying component allocations. -// ## Proration Schemes -// Changing the allocated quantity of a component mid-period can result in either a Charge or Credit being applied to the subscription. When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. -// **Notice:** These proration and accural fields will be ignored for Prepaid Components since this component type always generate charges immediately without proration. -// For background information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-upgrades-vs-downgrades). -// See the tables below for valid values. -// | upgrade_charge | Definition                                                        | -// |----------------|-------------------------------------------------------------------| -// | `full`         | A charge is added for the full price of the component.            | -// | `prorated`     | A charge is added for the prorated price of the component change. | -// | `none`         | No charge is added.                                               | -// | downgrade_credit | Definition                                        | -// |------------------|---------------------------------------------------| -// | `full`           | A full price credit is added for the amount owed. | -// | `prorated`       | A prorated credit is added for the amount owed.   | -// | `none`           | No charge is added.                               | -// | accrue_charge | Definition                                                                                               | -// |---------------|------------------------------------------------------------------------------------------------------------| -// | `true`        | Attempt to charge the customer at next renewal. | -// | `false`       | Attempt to charge the customer right away. If it fails, the charge will be accrued until the next renewal. | -// ### Order of Resolution for upgrade_charge and downgrade_credit -// 1. Per allocation in API call (within a single allocation of the `allocations` array) -// 2. [Component-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997-Component-Allocations#component-allocations-0-0) -// 3. Allocation API call top level (outside of the `allocations` array) -// 4. [Site-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-schemes) -// ### Order of Resolution for accrue charge -// 1. Allocation API call top level (outside of the `allocations` array) -// 2. [Site-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-schemes) +// AllocateComponent takes context, subscriptionId, componentId, body as parameters and +// returns an models.ApiResponse with models.AllocationResponse data and +// an error if there was an issue with the request or response. +// This endpoint creates a new allocation, setting the current allocated quantity for the Component and recording a memo. +// **Notice**: Allocations can only be updated for Quantity, On/Off, and Prepaid Components. +// ## Allocations Documentation +// Full documentation on how to record Allocations in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997). It is focused on how allocations operate within the Chargify UI.It goes into greater detail on how the user interface will react when recording allocations. +// This documentation also goes into greater detail on how proration is taken into consideration when applying component allocations. +// ## Proration Schemes +// Changing the allocated quantity of a component mid-period can result in either a Charge or Credit being applied to the subscription. When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. +// **Notice:** These proration and accural fields will be ignored for Prepaid Components since this component type always generate charges immediately without proration. +// For background information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-upgrades-vs-downgrades). +// See the tables below for valid values. +// | upgrade_charge | Definition                                                        | +// |----------------|-------------------------------------------------------------------| +// | `full`         | A charge is added for the full price of the component.            | +// | `prorated`     | A charge is added for the prorated price of the component change. | +// | `none`         | No charge is added.                                               | +// | downgrade_credit | Definition                                        | +// |------------------|---------------------------------------------------| +// | `full`           | A full price credit is added for the amount owed. | +// | `prorated`       | A prorated credit is added for the amount owed.   | +// | `none`           | No charge is added.                               | +// | accrue_charge | Definition                                                                                               | +// |---------------|------------------------------------------------------------------------------------------------------------| +// | `true`        | Attempt to charge the customer at next renewal. | +// | `false`       | Attempt to charge the customer right away. If it fails, the charge will be accrued until the next renewal. | +// ### Order of Resolution for upgrade_charge and downgrade_credit +// 1. Per allocation in API call (within a single allocation of the `allocations` array) +// 2. [Component-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997-Component-Allocations#component-allocations-0-0) +// 3. Allocation API call top level (outside of the `allocations` array) +// 4. [Site-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-schemes) +// ### Order of Resolution for accrue charge +// 1. Allocation API call top level (outside of the `allocations` array) +// 2. [Site-level default value](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#proration-schemes) // **NOTE: Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong.** func (s *SubscriptionComponentsController) AllocateComponent( - ctx context.Context, - subscriptionId int, - componentId int, - body *models.CreateAllocationRequest) ( - models.ApiResponse[models.AllocationResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/components/%v/allocations.json", subscriptionId, componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.AllocationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.AllocationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + componentId int, + body *models.CreateAllocationRequest) ( + models.ApiResponse[models.AllocationResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/components/%v/allocations.json", subscriptionId, componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.AllocationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.AllocationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListAllocations takes context, subscriptionId, componentId, page as parameters and -// returns an models.ApiResponse with []models.AllocationResponse data and -// an error if there was an issue with the request or response. -// This endpoint returns 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. -// ## Querying data via Chargify gem -// You can also query the current quantity via the [official Chargify Gem.](http://github.com/chargify/chargify_api_ares) -// ```# First way -// component = Chargify::Subscription::Component.find(1, :params => {:subscription_id => 7}) -// puts component.allocated_quantity -// # => 23 -// # Second way -// component = Chargify::Subscription.find(7).component(1) -// puts component.allocated_quantity -// # => 23 +// ListAllocations takes context, subscriptionId, componentId, page as parameters and +// returns an models.ApiResponse with []models.AllocationResponse data and +// an error if there was an issue with the request or response. +// This endpoint returns 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. +// ## Querying data via Chargify gem +// You can also query the current quantity via the [official Chargify Gem.](http://github.com/chargify/chargify_api_ares) +// ```# First way +// component = Chargify::Subscription::Component.find(1, :params => {:subscription_id => 7}) +// puts component.allocated_quantity +// # => 23 +// # Second way +// component = Chargify::Subscription.find(7).component(1) +// puts component.allocated_quantity +// # => 23 // ``` func (s *SubscriptionComponentsController) ListAllocations( - ctx context.Context, - subscriptionId int, - componentId int, - page *int) ( - models.ApiResponse[[]models.AllocationResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/components/%v/allocations.json", subscriptionId, componentId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - - var result []models.AllocationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.AllocationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + componentId int, + page *int) ( + models.ApiResponse[[]models.AllocationResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/components/%v/allocations.json", subscriptionId, componentId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + + var result []models.AllocationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.AllocationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// AllocateComponents takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with []models.AllocationResponse data and -// an error if there was an issue with the request or response. -// Creates multiple allocations, setting the current allocated quantity for each of the components and recording a memo. The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. Be aware of the Order of Resolutions explained below in determining the proration scheme. -// A `component_id` is required for each allocation. +// AllocateComponents takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with []models.AllocationResponse data and +// an error if there was an issue with the request or response. +// Creates multiple allocations, setting the current allocated quantity for each of the components and recording a memo. The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. Be aware of the Order of Resolutions explained below in determining the proration scheme. +// A `component_id` is required for each allocation. // This endpoint only responds to JSON. It is not available for XML. func (s *SubscriptionComponentsController) AllocateComponents( - ctx context.Context, - subscriptionId int, - body *models.AllocateComponents) ( - models.ApiResponse[[]models.AllocationResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/allocations.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result []models.AllocationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.AllocationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.AllocateComponents) ( + models.ApiResponse[[]models.AllocationResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/allocations.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result []models.AllocationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.AllocationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// PreviewAllocations takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.AllocationPreviewResponse data and -// an error if there was an issue with the request or response. -// Chargify offers the ability to preview a potential subscription's **quantity-based** or **on/off** component allocation in the middle of the current billing period. This is useful if you want users to be able to see the effect of a component operation before actually doing it. -// ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or `downgrade_credits` -// When the allocation uses multiple different types of `upgrade_charge`s or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the `allocation_preview`, but at the `line_items` and `allocations` level respectfully. +// PreviewAllocations takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.AllocationPreviewResponse data and +// an error if there was an issue with the request or response. +// Chargify offers the ability to preview a potential subscription's **quantity-based** or **on/off** component allocation in the middle of the current billing period. This is useful if you want users to be able to see the effect of a component operation before actually doing it. +// ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or `downgrade_credits` +// When the allocation uses multiple different types of `upgrade_charge`s or `downgrade_credit`s, the Allocation is viewed as an Allocation which uses "Fine-Grained Component Control". As a result, the response will not include `direction` and `proration` within the `allocation_preview`, but at the `line_items` and `allocations` level respectfully. // See example below for Fine-Grained Component Control response. func (s *SubscriptionComponentsController) PreviewAllocations( - ctx context.Context, - subscriptionId int, - body *models.PreviewAllocationsRequest) ( - models.ApiResponse[models.AllocationPreviewResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/allocations/preview.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.AllocationPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.AllocationPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewComponentAllocationError(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.PreviewAllocationsRequest) ( + models.ApiResponse[models.AllocationPreviewResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/allocations/preview.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.AllocationPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.AllocationPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewComponentAllocationError(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdatePrepaidUsageAllocation takes context, subscriptionId, componentId, allocationId, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// When the expiration interval options are selected on a prepaid usage component price point, all allocations will be created with an expiration date. This expiration date can be changed after the fact to allow for extending or shortening the allocation's active window. -// In order to change a prepaid usage allocation's expiration date, a PUT call must be made to the allocation's endpoint with a new expiration date. -// ## Limitations -// A few limitations exist when changing an allocation's expiration date: -// - An expiration date can only be changed for an allocation that belongs to a price point with expiration interval options explicitly set. -// - An expiration date can be changed towards the future with no limitations. +// UpdatePrepaidUsageAllocationExpirationDate takes context, subscriptionId, componentId, allocationId, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// When the expiration interval options are selected on a prepaid usage component price point, all allocations will be created with an expiration date. This expiration date can be changed after the fact to allow for extending or shortening the allocation's active window. +// In order to change a prepaid usage allocation's expiration date, a PUT call must be made to the allocation's endpoint with a new expiration date. +// ## Limitations +// A few limitations exist when changing an allocation's expiration date: +// - An expiration date can only be changed for an allocation that belongs to a price point with expiration interval options explicitly set. +// - An expiration date can be changed towards the future with no limitations. // - An expiration date can be changed towards the past (essentially expiring it) up to the subscription's current period beginning date. -func (s *SubscriptionComponentsController) UpdatePrepaidUsageAllocation( - ctx context.Context, - subscriptionId int, - componentId int, - allocationId int, - body *models.UpdateAllocationExpirationDate) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/components/%v/allocations/%v.json", subscriptionId, componentId, allocationId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewSubscriptionComponentAllocationError(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err +func (s *SubscriptionComponentsController) UpdatePrepaidUsageAllocationExpirationDate( + ctx context.Context, + subscriptionId int, + componentId int, + allocationId int, + body *models.UpdateAllocationExpirationDate) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/components/%v/allocations/%v.json", subscriptionId, componentId, allocationId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewSubscriptionComponentAllocationError(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// DeletePrepaidUsageAllocation takes context, subscriptionId, componentId, allocationId, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// Prepaid Usage components are unique in that their allocations are always additive. In order to reduce a subscription's allocated quantity for a prepaid usage component each allocation must be destroyed individually via this endpoint. -// ## Credit Scheme -// By default, destroying an allocation will generate a service credit on the subscription. This behavior can be modified with the optional `credit_scheme` parameter on this endpoint. The accepted values are: -// 1. `none`: The allocation will be destroyed and the balances will be updated but no service credit or refund will be created. -// 2. `credit`: The allocation will be destroyed and the balances will be updated and a service credit will be generated. This is also the default behavior if the `credit_scheme` param is not passed. +// DeletePrepaidUsageAllocation takes context, subscriptionId, componentId, allocationId, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// Prepaid Usage components are unique in that their allocations are always additive. In order to reduce a subscription's allocated quantity for a prepaid usage component each allocation must be destroyed individually via this endpoint. +// ## Credit Scheme +// By default, destroying an allocation will generate a service credit on the subscription. This behavior can be modified with the optional `credit_scheme` parameter on this endpoint. The accepted values are: +// 1. `none`: The allocation will be destroyed and the balances will be updated but no service credit or refund will be created. +// 2. `credit`: The allocation will be destroyed and the balances will be updated and a service credit will be generated. This is also the default behavior if the `credit_scheme` param is not passed. // 3. `refund`: The allocation will be destroyed and the balances will be updated and a refund will be issued along with a Credit Note. func (s *SubscriptionComponentsController) DeletePrepaidUsageAllocation( - ctx context.Context, - subscriptionId int, - componentId int, - allocationId int, - body *models.CreditSchemeRequest) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/components/%v/allocations/%v.json", subscriptionId, componentId, allocationId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewSubscriptionComponentAllocationError(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + subscriptionId int, + componentId int, + allocationId int, + body *models.CreditSchemeRequest) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/components/%v/allocations/%v.json", subscriptionId, componentId, allocationId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewSubscriptionComponentAllocationError(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// CreateUsage takes context, subscriptionId, componentId, body as parameters and -// returns an models.ApiResponse with models.UsageResponse data and -// an error if there was an issue with the request or response. -// ## Documentation -// Full documentation on how to create Components in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#creating-components). Additionally, for information on how to record component usage against a subscription, please see the following resources: -// + [Recording Metered Component Usage](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#reporting-metered-component-usage) -// + [Reporting Prepaid Component Status](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#reporting-prepaid-component-status) -// You may choose to report metered or prepaid usage to Chargify as often as you wish. You may report usage as it happens. You may also report usage periodically, such as each night or once per billing period. If usage events occur in your system very frequently (on the order of thousands of times an hour), it is best to accumulate usage into batches on your side, and then report those batches less frequently, such as daily. This will ensure you remain below any API throttling limits. If your use case requires higher rates of usage reporting, we recommend utilizing Events Based Components. -// ## Create Usage for Subscription -// This endpoint allows you to record an instance of metered or prepaid usage for a subscription. The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item](./b3A6MTQxMDgzNzQ-read-subscription-component) for the subscription. -// ## Price Point ID usage -// If you are using price points, for metered and prepaid usage components, Chargify gives you the option to specify a price point in your request. -// You do not need to specify a price point ID. If a price point is not included, the default price point for the component will be used when the usage is recorded. -// If an invalid `price_point_id` is submitted, the endpoint will return an error. -// ## Deducting Usage -// In the event that you need to reverse a previous usage report or otherwise deduct from the current usage balance, you may provide a negative quantity. -// Example: -// Previously recorded: -// ```json -// { -// "usage": { -// "quantity": 5000, -// "memo": "Recording 5000 units" -// } -// } -// ``` -// At this point, `unit_balance` would be `5000`. To reduce the balance to `0`, POST the following payload: -// ```json -// { -// "usage": { -// "quantity": -5000, -// "memo": "Deducting 5000 units" -// } -// } -// ``` -// The `unit_balance` has a floor of `0`; negative unit balances are never allowed. For example, if the usage balance is 100 and you deduct 200 units, the unit balance would then be `0`, not `-100`. -// ## FAQ -// Q. Is it possible to record metered usage for more than one component at a time? +// CreateUsage takes context, subscriptionId, componentId, body as parameters and +// returns an models.ApiResponse with models.UsageResponse data and +// an error if there was an issue with the request or response. +// ## Documentation +// Full documentation on how to create Components in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#creating-components). Additionally, for information on how to record component usage against a subscription, please see the following resources: +// + [Recording Metered Component Usage](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#reporting-metered-component-usage) +// + [Reporting Prepaid Component Status](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404527849997#reporting-prepaid-component-status) +// You may choose to report metered or prepaid usage to Chargify as often as you wish. You may report usage as it happens. You may also report usage periodically, such as each night or once per billing period. If usage events occur in your system very frequently (on the order of thousands of times an hour), it is best to accumulate usage into batches on your side, and then report those batches less frequently, such as daily. This will ensure you remain below any API throttling limits. If your use case requires higher rates of usage reporting, we recommend utilizing Events Based Components. +// ## Create Usage for Subscription +// This endpoint allows you to record an instance of metered or prepaid usage for a subscription. The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item](./b3A6MTQxMDgzNzQ-read-subscription-component) for the subscription. +// ## Price Point ID usage +// If you are using price points, for metered and prepaid usage components, Chargify gives you the option to specify a price point in your request. +// You do not need to specify a price point ID. If a price point is not included, the default price point for the component will be used when the usage is recorded. +// If an invalid `price_point_id` is submitted, the endpoint will return an error. +// ## Deducting Usage +// In the event that you need to reverse a previous usage report or otherwise deduct from the current usage balance, you may provide a negative quantity. +// Example: +// Previously recorded: +// ```json +// { +// "usage": { +// "quantity": 5000, +// "memo": "Recording 5000 units" +// } +// } +// ``` +// At this point, `unit_balance` would be `5000`. To reduce the balance to `0`, POST the following payload: +// ```json +// { +// "usage": { +// "quantity": -5000, +// "memo": "Deducting 5000 units" +// } +// } +// ``` +// The `unit_balance` has a floor of `0`; negative unit balances are never allowed. For example, if the usage balance is 100 and you deduct 200 units, the unit balance would then be `0`, not `-100`. +// ## FAQ +// Q. Is it possible to record metered usage for more than one component at a time? // A. No. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. func (s *SubscriptionComponentsController) CreateUsage( - ctx context.Context, - subscriptionId int, - componentId interface{}, - body *models.CreateUsageRequest) ( - models.ApiResponse[models.UsageResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/components/%v/usages.json", subscriptionId, componentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.UsageResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.UsageResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + componentId interface{}, + body *models.CreateUsageRequest) ( + models.ApiResponse[models.UsageResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/components/%v/usages.json", subscriptionId, componentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.UsageResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.UsageResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListUsages takes context, subscriptionId, componentId, sinceId, maxId, sinceDate, untilDate, page, perPage as parameters and -// returns an models.ApiResponse with []models.UsageResponse data and -// an error if there was an issue with the request or response. -// This request will return a list of the usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. -// This endpoint is not compatible with quantity-based components. -// ## Since Date and Until Date Usage -// Note: The `since_date` and `until_date` attributes each default to midnight on the date specified. For example, in order to list usages for January 20th, you would need to append the following to the URL. -// ``` -// ?since_date=2016-01-20&until_date=2016-01-21 -// ``` -// ## Read Usage by Handle +// ListUsages takes context, subscriptionId, componentId, sinceId, maxId, sinceDate, untilDate, page, perPage as parameters and +// returns an models.ApiResponse with []models.UsageResponse data and +// an error if there was an issue with the request or response. +// This request will return a list of the usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +// This endpoint is not compatible with quantity-based components. +// ## Since Date and Until Date Usage +// Note: The `since_date` and `until_date` attributes each default to midnight on the date specified. For example, in order to list usages for January 20th, you would need to append the following to the URL. +// ``` +// ?since_date=2016-01-20&until_date=2016-01-21 +// ``` +// ## Read Usage by Handle // Use this endpoint to read the previously recorded components for a subscription. You can now specify either the component id (integer) or the component handle prefixed by "handle:" to specify the unique identifier for the component you are working with. func (s *SubscriptionComponentsController) ListUsages( - ctx context.Context, - subscriptionId int, - componentId interface{}, - sinceId *int, - maxId *int, - sinceDate *time.Time, - untilDate *time.Time, - page *int, - perPage *int) ( - models.ApiResponse[[]models.UsageResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/components/%v/usages.json", subscriptionId, componentId), - ) - req.Authenticate(true) - if sinceId != nil { - req.QueryParam("since_id", *sinceId) - } - if maxId != nil { - req.QueryParam("max_id", *maxId) - } - if sinceDate != nil { - req.QueryParam("since_date", sinceDate.Format(models.DEFAULT_DATE)) - } - if untilDate != nil { - req.QueryParam("until_date", untilDate.Format(models.DEFAULT_DATE)) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result []models.UsageResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.UsageResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + componentId interface{}, + sinceId *int, + maxId *int, + sinceDate *time.Time, + untilDate *time.Time, + page *int, + perPage *int) ( + models.ApiResponse[[]models.UsageResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/components/%v/usages.json", subscriptionId, componentId), + ) + req.Authenticate(true) + if sinceId != nil { + req.QueryParam("since_id", *sinceId) + } + if maxId != nil { + req.QueryParam("max_id", *maxId) + } + if sinceDate != nil { + req.QueryParam("since_date", sinceDate.Format(models.DEFAULT_DATE)) + } + if untilDate != nil { + req.QueryParam("until_date", untilDate.Format(models.DEFAULT_DATE)) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result []models.UsageResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.UsageResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ActivateEventBasedComponent takes context, subscriptionId, componentId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// 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://chargify.zendesk.com/hc/en-us/articles/4407720810907#activating-components-for-subscribers). -// Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Chargify to bill for events when the subscription is renewed. +// ActivateEventBasedComponent takes context, subscriptionId, componentId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// 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://chargify.zendesk.com/hc/en-us/articles/4407720810907#activating-components-for-subscribers). +// Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Chargify to bill 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.* func (s *SubscriptionComponentsController) ActivateEventBasedComponent( - ctx context.Context, - subscriptionId int, - componentId int) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/event_based_billing/subscriptions/%v/components/%v/activate.json", subscriptionId, componentId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subscriptionId int, + componentId int) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/event_based_billing/subscriptions/%v/components/%v/activate.json", subscriptionId, componentId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// DeactivateEventBasedComponent takes context, subscriptionId, componentId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// DeactivateEventBasedComponent takes context, subscriptionId, componentId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Use this endpoint to deactivate an event-based component for a single subscription. Deactivating the event-based component causes Chargify to ignore related events at subscription renewal. func (s *SubscriptionComponentsController) DeactivateEventBasedComponent( - ctx context.Context, - subscriptionId int, - componentId int) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/event_based_billing/subscriptions/%v/components/%v/deactivate.json", subscriptionId, componentId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subscriptionId int, + componentId int) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/event_based_billing/subscriptions/%v/components/%v/deactivate.json", subscriptionId, componentId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// RecordEvent takes context, subdomain, apiHandle, storeUid, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// ## 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 Chargify. -// 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 Chargify data ingestion engine. -// Learn more about the feature in general in the [Events-Based Billing help docs](https://chargify.zendesk.com/hc/en-us/articles/4407720613403). -// ## Record Event -// Use this endpoint to record a single event. -// *Note: this endpoint differs from the standard Chargify endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* -// ``` -// https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle +// RecordEvent takes context, subdomain, apiHandle, storeUid, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// ## 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 Chargify. +// 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 Chargify data ingestion engine. +// Learn more about the feature in general in the [Events-Based Billing help docs](https://chargify.zendesk.com/hc/en-us/articles/4407720613403). +// ## Record Event +// Use this endpoint to record a single event. +// *Note: this endpoint differs from the standard Chargify endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* +// ``` +// https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle // ``` func (s *SubscriptionComponentsController) RecordEvent( - ctx context.Context, - subdomain string, - apiHandle string, - storeUid *string, - body *models.EBBEvent) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/%v/events/%v.json", subdomain, apiHandle), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if storeUid != nil { - req.QueryParam("store_uid", *storeUid) - } - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subdomain string, + apiHandle string, + storeUid *string, + body *models.EBBEvent) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/%v/events/%v.json", subdomain, apiHandle), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if storeUid != nil { + req.QueryParam("store_uid", *storeUid) + } + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// RecordEvents takes context, subdomain, apiHandle, storeUid, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// Use this endpoint to record a collection of events. -// *Note: this endpoint differs from the standard Chargify endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* +// BulkRecordEvents takes context, subdomain, apiHandle, storeUid, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// Use this endpoint to record a collection of events. +// *Note: this endpoint differs from the standard Chargify endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* // A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. -func (s *SubscriptionComponentsController) RecordEvents( - ctx context.Context, - subdomain string, - apiHandle string, - storeUid *string, - body []models.EBBEvent) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/%v/events/%v/bulk.json", subdomain, apiHandle), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if storeUid != nil { - req.QueryParam("store_uid", *storeUid) - } - if body != nil { - req.Json(body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err +func (s *SubscriptionComponentsController) BulkRecordEvents( + ctx context.Context, + subdomain string, + apiHandle string, + storeUid *string, + body []models.EBBEvent) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/%v/events/%v/bulk.json", subdomain, apiHandle), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if storeUid != nil { + req.QueryParam("store_uid", *storeUid) + } + if body != nil { + req.Json(body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// ListSubscriptionComponentsForSite takes context, page, perPage, sort, direction, dateField, startDate, startDatetime, endDate, endDatetime, subscriptionIds, pricePointIds, productFamilyIds, include, filterUseSiteExchangeRate, filterCurrencies, filterSubscriptionStates, filterSubscriptionDateField, filterSubscriptionStartDate, filterSubscriptionStartDatetime, filterSubscriptionEndDate, filterSubscriptionEndDatetime as parameters and -// returns an models.ApiResponse with models.ListSubscriptionComponentsResponse data and -// an error if there was an issue with the request or response. +// ListSubscriptionComponentsForSite takes context, page, perPage, sort, direction, dateField, startDate, startDatetime, endDate, endDatetime, subscriptionIds, pricePointIds, productFamilyIds, include, filterUseSiteExchangeRate, filterCurrencies, filterSubscriptionStates, filterSubscriptionDateField, filterSubscriptionStartDate, filterSubscriptionStartDatetime, filterSubscriptionEndDate, filterSubscriptionEndDatetime as parameters and +// returns an models.ApiResponse with models.ListSubscriptionComponentsResponse data and +// an error if there was an issue with the request or response. // This request will list components applied to each subscription. func (s *SubscriptionComponentsController) ListSubscriptionComponentsForSite( - ctx context.Context, - page *int, - perPage *int, - sort *models.ListSubscriptionComponentsSort, - direction *models.SortingDirection, - dateField *models.SubscriptionListDateField, - startDate *string, - startDatetime *string, - endDate *string, - endDatetime *string, - subscriptionIds []int, - pricePointIds *models.IncludeNotNull, - productFamilyIds []int, - include *models.ListSubscriptionComponentsInclude, - filterUseSiteExchangeRate *bool, - filterCurrencies []string, - filterSubscriptionStates []models.SubscriptionStateFilter, - filterSubscriptionDateField *models.SubscriptionListDateField, - filterSubscriptionStartDate *string, - filterSubscriptionStartDatetime *string, - filterSubscriptionEndDate *string, - filterSubscriptionEndDatetime *string) ( - models.ApiResponse[models.ListSubscriptionComponentsResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/subscriptions_components.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if sort != nil { - req.QueryParam("sort", *sort) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", *startDate) - } - if startDatetime != nil { - req.QueryParam("start_datetime", *startDatetime) - } - if endDate != nil { - req.QueryParam("end_date", *endDate) - } - if endDatetime != nil { - req.QueryParam("end_datetime", *endDatetime) - } - if subscriptionIds != nil { - req.QueryParam("subscription_ids", subscriptionIds) - } - if pricePointIds != nil { - req.QueryParam("price_point_ids", *pricePointIds) - } - if productFamilyIds != nil { - req.QueryParam("product_family_ids", productFamilyIds) - } - if include != nil { - req.QueryParam("include", *include) - } - if filterUseSiteExchangeRate != nil { - req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) - } - if filterCurrencies != nil { - req.QueryParam("filter[currencies]", filterCurrencies) - } - if filterSubscriptionStates != nil { - req.QueryParam("filter[subscription][states]", filterSubscriptionStates) - } - if filterSubscriptionDateField != nil { - req.QueryParam("filter[subscription][date_field]", *filterSubscriptionDateField) - } - if filterSubscriptionStartDate != nil { - req.QueryParam("filter[subscription][start_date]", *filterSubscriptionStartDate) - } - if filterSubscriptionStartDatetime != nil { - req.QueryParam("filter[subscription][start_datetime]", *filterSubscriptionStartDatetime) - } - if filterSubscriptionEndDate != nil { - req.QueryParam("filter[subscription][end_date]", *filterSubscriptionEndDate) - } - if filterSubscriptionEndDatetime != nil { - req.QueryParam("filter[subscription][end_datetime]", *filterSubscriptionEndDatetime) - } - var result models.ListSubscriptionComponentsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSubscriptionComponentsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + sort *models.ListSubscriptionComponentsSort, + direction *models.SortingDirection, + dateField *models.SubscriptionListDateField, + startDate *string, + startDatetime *string, + endDate *string, + endDatetime *string, + subscriptionIds []int, + pricePointIds *models.IncludeNotNull, + productFamilyIds []int, + include *models.ListSubscriptionComponentsInclude, + filterUseSiteExchangeRate *bool, + filterCurrencies []string, + filterSubscriptionStates []models.SubscriptionStateFilter, + filterSubscriptionDateField *models.SubscriptionListDateField, + filterSubscriptionStartDate *string, + filterSubscriptionStartDatetime *string, + filterSubscriptionEndDate *string, + filterSubscriptionEndDatetime *string) ( + models.ApiResponse[models.ListSubscriptionComponentsResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/subscriptions_components.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if sort != nil { + req.QueryParam("sort", *sort) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", *startDate) + } + if startDatetime != nil { + req.QueryParam("start_datetime", *startDatetime) + } + if endDate != nil { + req.QueryParam("end_date", *endDate) + } + if endDatetime != nil { + req.QueryParam("end_datetime", *endDatetime) + } + if subscriptionIds != nil { + req.QueryParam("subscription_ids", subscriptionIds) + } + if pricePointIds != nil { + req.QueryParam("price_point_ids", *pricePointIds) + } + if productFamilyIds != nil { + req.QueryParam("product_family_ids", productFamilyIds) + } + if include != nil { + req.QueryParam("include", *include) + } + if filterUseSiteExchangeRate != nil { + req.QueryParam("filter[use_site_exchange_rate]", *filterUseSiteExchangeRate) + } + if filterCurrencies != nil { + req.QueryParam("filter[currencies]", filterCurrencies) + } + if filterSubscriptionStates != nil { + req.QueryParam("filter[subscription][states]", filterSubscriptionStates) + } + if filterSubscriptionDateField != nil { + req.QueryParam("filter[subscription][date_field]", *filterSubscriptionDateField) + } + if filterSubscriptionStartDate != nil { + req.QueryParam("filter[subscription][start_date]", *filterSubscriptionStartDate) + } + if filterSubscriptionStartDatetime != nil { + req.QueryParam("filter[subscription][start_datetime]", *filterSubscriptionStartDatetime) + } + if filterSubscriptionEndDate != nil { + req.QueryParam("filter[subscription][end_date]", *filterSubscriptionEndDate) + } + if filterSubscriptionEndDatetime != nil { + req.QueryParam("filter[subscription][end_datetime]", *filterSubscriptionEndDatetime) + } + var result models.ListSubscriptionComponentsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSubscriptionComponentsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } diff --git a/subscription_group_invoice_account_controller.go b/subscription_group_invoice_account_controller.go index b93be0d3..420c4b69 100644 --- a/subscription_group_invoice_account_controller.go +++ b/subscription_group_invoice_account_controller.go @@ -1,205 +1,205 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "time" ) // SubscriptionGroupInvoiceAccountController represents a controller struct. type SubscriptionGroupInvoiceAccountController struct { - baseController + baseController } -// NewSubscriptionGroupInvoiceAccountController creates a new instance of SubscriptionGroupInvoiceAccountController. +// NewSubscriptionGroupInvoiceAccountController creates a new instance of SubscriptionGroupInvoiceAccountController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupInvoiceAccountController. func NewSubscriptionGroupInvoiceAccountController(baseController baseController) *SubscriptionGroupInvoiceAccountController { - subscriptionGroupInvoiceAccountController := SubscriptionGroupInvoiceAccountController{baseController: baseController} - return &subscriptionGroupInvoiceAccountController + subscriptionGroupInvoiceAccountController := SubscriptionGroupInvoiceAccountController{baseController: baseController} + return &subscriptionGroupInvoiceAccountController } -// CreateSubscriptionGroupPrepayment takes context, uid, body as parameters and -// returns an models.ApiResponse with models.SubscriptionGroupPrepaymentResponse data and -// an error if there was an issue with the request or response. +// CreateSubscriptionGroupPrepayment takes context, uid, body as parameters and +// returns an models.ApiResponse with models.SubscriptionGroupPrepaymentResponse data and +// an error if there was an issue with the request or response. // A prepayment can be added for a subscription group identified by the group's `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. func (s *SubscriptionGroupInvoiceAccountController) CreateSubscriptionGroupPrepayment( - ctx context.Context, - uid string, - body *models.SubscriptionGroupPrepaymentRequest) ( - models.ApiResponse[models.SubscriptionGroupPrepaymentResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/prepayments.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionGroupPrepaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionGroupPrepaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.SubscriptionGroupPrepaymentRequest) ( + models.ApiResponse[models.SubscriptionGroupPrepaymentResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/prepayments.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionGroupPrepaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionGroupPrepaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListPrepaymentsForSubscriptionGroup takes context, uid, filterDateField, filterEndDate, filterStartDate, page, perPage as parameters and -// returns an models.ApiResponse with models.ListSubscriptionGroupPrepaymentResponse data and -// an error if there was an issue with the request or response. +// ListPrepaymentsForSubscriptionGroup takes context, uid, filterDateField, filterEndDate, filterStartDate, page, perPage as parameters and +// returns an models.ApiResponse with models.ListSubscriptionGroupPrepaymentResponse data and +// an error if there was an issue with the request or response. // This request will list a subscription group's prepayments. func (s *SubscriptionGroupInvoiceAccountController) ListPrepaymentsForSubscriptionGroup( - ctx context.Context, - uid string, - filterDateField *models.ListSubscriptionGroupPrepaymentDateField, - filterEndDate *time.Time, - filterStartDate *time.Time, - page *int, - perPage *int) ( - models.ApiResponse[models.ListSubscriptionGroupPrepaymentResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscription_groups/%v/prepayments.json", uid), - ) - req.Authenticate(true) - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result models.ListSubscriptionGroupPrepaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSubscriptionGroupPrepaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + filterDateField *models.ListSubscriptionGroupPrepaymentDateField, + filterEndDate *time.Time, + filterStartDate *time.Time, + page *int, + perPage *int) ( + models.ApiResponse[models.ListSubscriptionGroupPrepaymentResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscription_groups/%v/prepayments.json", uid), + ) + req.Authenticate(true) + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result models.ListSubscriptionGroupPrepaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSubscriptionGroupPrepaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// IssueSubscriptionGroupServiceCredits takes context, uid, body as parameters and -// returns an models.ApiResponse with models.ServiceCreditResponse data and -// an error if there was an issue with the request or response. +// IssueSubscriptionGroupServiceCredit takes context, uid, body as parameters and +// returns an models.ApiResponse with models.ServiceCreditResponse data and +// an error if there was an issue with the request or response. // Credit can be issued for a subscription group identified by the group's `uid`. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. -func (s *SubscriptionGroupInvoiceAccountController) IssueSubscriptionGroupServiceCredits( - ctx context.Context, - uid string, - body *models.IssueServiceCreditRequest) ( - models.ApiResponse[models.ServiceCreditResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/service_credits.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ServiceCreditResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ServiceCreditResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionGroupInvoiceAccountController) IssueSubscriptionGroupServiceCredit( + ctx context.Context, + uid string, + body *models.IssueServiceCreditRequest) ( + models.ApiResponse[models.ServiceCreditResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/service_credits.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ServiceCreditResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ServiceCreditResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeductSubscriptionGroupServiceCredits takes context, uid, body as parameters and -// returns an models.ApiResponse with models.ServiceCredit data and -// an error if there was an issue with the request or response. +// DeductSubscriptionGroupServiceCredit takes context, uid, body as parameters and +// returns an models.ApiResponse with models.ServiceCredit data and +// an error if there was an issue with the request or response. // Credit can be deducted for a subscription group identified by the group's `uid`. Credit will be deducted from the group in the amount specified in the request body. -func (s *SubscriptionGroupInvoiceAccountController) DeductSubscriptionGroupServiceCredits( - ctx context.Context, - uid string, - body *models.DeductServiceCreditRequest) ( - models.ApiResponse[models.ServiceCredit], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/service_credit_deductions.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ServiceCredit - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ServiceCredit](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionGroupInvoiceAccountController) DeductSubscriptionGroupServiceCredit( + ctx context.Context, + uid string, + body *models.DeductServiceCreditRequest) ( + models.ApiResponse[models.ServiceCredit], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/service_credit_deductions.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ServiceCredit + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ServiceCredit](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/subscription_group_status_controller.go b/subscription_group_status_controller.go index 27a2b381..c71700eb 100644 --- a/subscription_group_status_controller.go +++ b/subscription_group_status_controller.go @@ -1,170 +1,170 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // SubscriptionGroupStatusController represents a controller struct. type SubscriptionGroupStatusController struct { - baseController + baseController } -// NewSubscriptionGroupStatusController creates a new instance of SubscriptionGroupStatusController. +// NewSubscriptionGroupStatusController creates a new instance of SubscriptionGroupStatusController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupStatusController. func NewSubscriptionGroupStatusController(baseController baseController) *SubscriptionGroupStatusController { - subscriptionGroupStatusController := SubscriptionGroupStatusController{baseController: baseController} - return &subscriptionGroupStatusController + subscriptionGroupStatusController := SubscriptionGroupStatusController{baseController: baseController} + return &subscriptionGroupStatusController } -// CancelSubscriptionsInGroup takes context, uid, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This endpoint will immediately cancel all subscriptions within the specified group. The group is identified by it's `uid` passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members as well must be on automatic billing or they must be prepaid. +// CancelSubscriptionsInGroup takes context, uid, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This endpoint will immediately cancel all subscriptions within the specified group. The group is identified by it's `uid` passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members as well must be on automatic billing or they must be prepaid. // In order to cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. func (s *SubscriptionGroupStatusController) CancelSubscriptionsInGroup( - ctx context.Context, - uid string, - body *models.CancelGroupedSubscriptionsRequest) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/cancel.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + uid string, + body *models.CancelGroupedSubscriptionsRequest) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/cancel.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// InitiateDelayedCancellationForGroup takes context, uid as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by it's uid passed in the URL. +// InitiateDelayedCancellationForGroup takes context, uid as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by it's uid passed in the URL. // All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. func (s *SubscriptionGroupStatusController) InitiateDelayedCancellationForGroup( - ctx context.Context, - uid string) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/delayed_cancel.json", uid), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + uid string) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/delayed_cancel.json", uid), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// StopDelayedCancellationForGroup takes context, uid as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// CancelDelayedCancellationForGroup takes context, uid as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Removing the delayed cancellation on a subscription group will ensure that the subscriptions do not get canceled at the end of the period. The request will reset the `cancel_at_end_of_period` flag to false on each member in the group. -func (s *SubscriptionGroupStatusController) StopDelayedCancellationForGroup( - ctx context.Context, - uid string) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscription_groups/%v/delayed_cancel.json", uid), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err +func (s *SubscriptionGroupStatusController) CancelDelayedCancellationForGroup( + ctx context.Context, + uid string) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscription_groups/%v/delayed_cancel.json", uid), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// ReactivateSubscriptionGroup takes context, uid, body as parameters and -// returns an models.ApiResponse with models.ReactivateSubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// This endpoint will attempt to reactivate or resume a cancelled subscription group. Upon reactivation, any canceled invoices created after the beginning of the primary subscription's billing period will be reopened and payment will be attempted on them. If the subscription group is being reactivated (as opposed to resumed), new charges will also be assessed for the new billing period. -// Whether a subscription group is reactivated (a new billing period is created) or resumed (the current billing period is respected) will depend on the parameters that are sent with the request as well as the date of the request relative to the primary subscription's period. -// ## Reactivating within the current period -// If a subscription group is cancelled and reactivated within the primary subscription's current period, we can choose to either start a new billing period or maintain the existing one. If we want to maintain the existing billing period the `resume=true` option must be passed in request parameters. -// An exception to the above are subscriptions that are on calendar billing. These subscriptions cannot be reactivated within the current period. If the `resume=true` option is not passed the request will return an error. -// The `resume_members` option is ignored in this case. All eligible group members will be automatically resumed. -// ## Reactivating beyond the current period -// In this case, a subscription group can only be reactivated with a new billing period. If the `resume=true` option is passed it will be ignored. -// Member subscriptions can have billing periods that are longer than the primary (e.g. a monthly primary with annual group members). If the primary subscription in a group cannot be reactivated within the current period, but other group members can be, passing `resume_members=true` will resume the existing billing period for eligible group members. The primary subscription will begin a new billing period. +// ReactivateSubscriptionGroup takes context, uid, body as parameters and +// returns an models.ApiResponse with models.ReactivateSubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// This endpoint will attempt to reactivate or resume a cancelled subscription group. Upon reactivation, any canceled invoices created after the beginning of the primary subscription's billing period will be reopened and payment will be attempted on them. If the subscription group is being reactivated (as opposed to resumed), new charges will also be assessed for the new billing period. +// Whether a subscription group is reactivated (a new billing period is created) or resumed (the current billing period is respected) will depend on the parameters that are sent with the request as well as the date of the request relative to the primary subscription's period. +// ## Reactivating within the current period +// If a subscription group is cancelled and reactivated within the primary subscription's current period, we can choose to either start a new billing period or maintain the existing one. If we want to maintain the existing billing period the `resume=true` option must be passed in request parameters. +// An exception to the above are subscriptions that are on calendar billing. These subscriptions cannot be reactivated within the current period. If the `resume=true` option is not passed the request will return an error. +// The `resume_members` option is ignored in this case. All eligible group members will be automatically resumed. +// ## Reactivating beyond the current period +// In this case, a subscription group can only be reactivated with a new billing period. If the `resume=true` option is passed it will be ignored. +// Member subscriptions can have billing periods that are longer than the primary (e.g. a monthly primary with annual group members). If the primary subscription in a group cannot be reactivated within the current period, but other group members can be, passing `resume_members=true` will resume the existing billing period for eligible group members. The primary subscription will begin a new billing period. // For calendar billing subscriptions, the new billing period created will be a partial one, spanning from the date of reactivation to the next corresponding calendar renewal date. func (s *SubscriptionGroupStatusController) ReactivateSubscriptionGroup( - ctx context.Context, - uid string, - body *models.ReactivateSubscriptionGroupRequest) ( - models.ApiResponse[models.ReactivateSubscriptionGroupResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscription_groups/%v/reactivate.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ReactivateSubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReactivateSubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.ReactivateSubscriptionGroupRequest) ( + models.ApiResponse[models.ReactivateSubscriptionGroupResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscription_groups/%v/reactivate.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ReactivateSubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReactivateSubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/subscription_groups_controller.go b/subscription_groups_controller.go index 75d9d2df..41507e67 100644 --- a/subscription_groups_controller.go +++ b/subscription_groups_controller.go @@ -1,371 +1,371 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // SubscriptionGroupsController represents a controller struct. type SubscriptionGroupsController struct { - baseController + baseController } -// NewSubscriptionGroupsController creates a new instance of SubscriptionGroupsController. +// NewSubscriptionGroupsController creates a new instance of SubscriptionGroupsController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupsController. func NewSubscriptionGroupsController(baseController baseController) *SubscriptionGroupsController { - subscriptionGroupsController := SubscriptionGroupsController{baseController: baseController} - return &subscriptionGroupsController + subscriptionGroupsController := SubscriptionGroupsController{baseController: baseController} + return &subscriptionGroupsController } -// SignupWithSubscriptionGroup takes context, body as parameters and -// returns an models.ApiResponse with models.SubscriptionGroupSignupResponse data and -// an error if there was an issue with the request or response. -// Create multiple subscriptions at once under the same customer and consolidate them into a subscription group. -// You must provide one and only one of the `payer_id`/`payer_reference`/`payer_attributes` for the customer attached to the group. -// You must provide one and only one of the `payment_profile_id`/`credit_card_attributes`/`bank_account_attributes` for the payment profile attached to the group. -// Only one of the `subscriptions` can have `"primary": true` attribute set. +// SignupWithSubscriptionGroup takes context, body as parameters and +// returns an models.ApiResponse with models.SubscriptionGroupSignupResponse data and +// an error if there was an issue with the request or response. +// Create multiple subscriptions at once under the same customer and consolidate them into a subscription group. +// You must provide one and only one of the `payer_id`/`payer_reference`/`payer_attributes` for the customer attached to the group. +// You must provide one and only one of the `payment_profile_id`/`credit_card_attributes`/`bank_account_attributes` for the payment profile attached to the group. +// Only one of the `subscriptions` can have `"primary": true` attribute set. // When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. func (s *SubscriptionGroupsController) SignupWithSubscriptionGroup( - ctx context.Context, - body *models.SubscriptionGroupSignupRequest) ( - models.ApiResponse[models.SubscriptionGroupSignupResponse], - error) { - req := s.prepareRequest(ctx, "POST", "/subscription_groups/signup.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.SubscriptionGroupSignupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionGroupSignupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSubscriptionGroupSignupErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.SubscriptionGroupSignupRequest) ( + models.ApiResponse[models.SubscriptionGroupSignupResponse], + error) { + req := s.prepareRequest(ctx, "POST", "/subscription_groups/signup.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.SubscriptionGroupSignupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionGroupSignupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSubscriptionGroupSignupErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CreateSubscriptionGroup takes context, body as parameters and -// returns an models.ApiResponse with models.SubscriptionGroupResponse data and -// an error if there was an issue with the request or response. +// CreateSubscriptionGroup takes context, body as parameters and +// returns an models.ApiResponse with models.SubscriptionGroupResponse data and +// an error if there was an issue with the request or response. // Creates a subscription group with given members. func (s *SubscriptionGroupsController) CreateSubscriptionGroup( - ctx context.Context, - body *models.CreateSubscriptionGroupRequest) ( - models.ApiResponse[models.SubscriptionGroupResponse], - error) { - req := s.prepareRequest(ctx, "POST", "/subscription_groups.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.SubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSingleStringErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateSubscriptionGroupRequest) ( + models.ApiResponse[models.SubscriptionGroupResponse], + error) { + req := s.prepareRequest(ctx, "POST", "/subscription_groups.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.SubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSingleStringErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListSubscriptionGroups takes context, page, perPage, include as parameters and -// returns an models.ApiResponse with models.ListSubscriptionGroupsResponse data and -// an error if there was an issue with the request or response. -// Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. -// #### Account Balance Information +// ListSubscriptionGroups takes context, page, perPage, include as parameters and +// returns an models.ApiResponse with models.ListSubscriptionGroupsResponse data and +// an error if there was an issue with the request or response. +// Returns an array of 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` parameter must be provided with the request. func (s *SubscriptionGroupsController) ListSubscriptionGroups( - ctx context.Context, - page *int, - perPage *int, - include *string) ( - models.ApiResponse[models.ListSubscriptionGroupsResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/subscription_groups.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if include != nil { - req.QueryParam("include", *include) - } - var result models.ListSubscriptionGroupsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ListSubscriptionGroupsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + include *string) ( + models.ApiResponse[models.ListSubscriptionGroupsResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/subscription_groups.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if include != nil { + req.QueryParam("include", *include) + } + var result models.ListSubscriptionGroupsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ListSubscriptionGroupsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadSubscriptionGroup takes context, uid as parameters and -// returns an models.ApiResponse with models.FullSubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to find subscription group details. -// #### Current Billing Amount in Cents +// ReadSubscriptionGroup takes context, uid as parameters and +// returns an models.ApiResponse with models.FullSubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to find subscription group details. +// #### Current Billing Amount in Cents // Current billing amount for the subscription group is not returned by default. If this information is desired, the `include[]=current_billing_amount_in_cents` parameter must be provided with the request. func (s *SubscriptionGroupsController) ReadSubscriptionGroup( - ctx context.Context, - uid string) ( - models.ApiResponse[models.FullSubscriptionGroupResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscription_groups/%v.json", uid), - ) - req.Authenticate(true) - - var result models.FullSubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.FullSubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.FullSubscriptionGroupResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscription_groups/%v.json", uid), + ) + req.Authenticate(true) + + var result models.FullSubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.FullSubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateSubscriptionGroupMembers takes context, uid, body as parameters and -// returns an models.ApiResponse with models.SubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to update subscription group members. +// UpdateSubscriptionGroupMembers takes context, uid, body as parameters and +// returns an models.ApiResponse with models.SubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to update subscription group members. // `"member_ids": []` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from subscription group. To clean up members, just leave the array empty. func (s *SubscriptionGroupsController) UpdateSubscriptionGroupMembers( - ctx context.Context, - uid string, - body *models.UpdateSubscriptionGroupRequest) ( - models.ApiResponse[models.SubscriptionGroupResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscription_groups/%v.json", uid), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSubscriptionGroupUpdateErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string, + body *models.UpdateSubscriptionGroupRequest) ( + models.ApiResponse[models.SubscriptionGroupResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscription_groups/%v.json", uid), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSubscriptionGroupUpdateErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteSubscriptionGroup takes context, uid as parameters and -// returns an models.ApiResponse with models.DeleteSubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to delete subscription group. +// DeleteSubscriptionGroup takes context, uid as parameters and +// returns an models.ApiResponse with models.DeleteSubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to delete subscription group. // Only groups without members can be deleted func (s *SubscriptionGroupsController) DeleteSubscriptionGroup( - ctx context.Context, - uid string) ( - models.ApiResponse[models.DeleteSubscriptionGroupResponse], - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscription_groups/%v.json", uid), - ) - req.Authenticate(true) - - var result models.DeleteSubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.DeleteSubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + uid string) ( + models.ApiResponse[models.DeleteSubscriptionGroupResponse], + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscription_groups/%v.json", uid), + ) + req.Authenticate(true) + + var result models.DeleteSubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.DeleteSubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// ReadSubscriptionGroupBySubscriptionId takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.FullSubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to find subscription group associated with subscription. +// FindSubscriptionGroup takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.FullSubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to find subscription group associated with subscription. // If the subscription is not in a group endpoint will return 404 code. -func (s *SubscriptionGroupsController) ReadSubscriptionGroupBySubscriptionId( - ctx context.Context, - subscriptionId string) ( - models.ApiResponse[models.FullSubscriptionGroupResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/subscription_groups/lookup.json") - req.Authenticate(true) - req.QueryParam("subscription_id", subscriptionId) - var result models.FullSubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.FullSubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionGroupsController) FindSubscriptionGroup( + ctx context.Context, + subscriptionId string) ( + models.ApiResponse[models.FullSubscriptionGroupResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/subscription_groups/lookup.json") + req.Authenticate(true) + req.QueryParam("subscription_id", subscriptionId) + var result models.FullSubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.FullSubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// CreateSubscriptionGroupHierarchy takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionGroupResponse data and -// an error if there was an issue with the request or response. -// For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) 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. -// **Please Note:** In order to add an existing subscription to a subscription group, it must belong to either the same customer record as the target, or be within the same customer hierarchy. -// Rather than specifying a customer, the `target` parameter could instead simply have a value of -// * `"self"` which indicates the subscription will be paid for not by some other customer, but by the subscribing customer, -// * `"parent"` which indicates the subscription will be paid for by the subscribing customer's parent within a customer hierarchy, or -// * `"eldest"` which indicates the subscription will be paid for by the root-level customer in the subscribing customer's hierarchy. -// To create a new subscription into a subscription group, please reference the following: +// AddSubscriptionToGroup takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionGroupResponse data and +// an error if there was an issue with the request or response. +// For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) 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. +// **Please Note:** In order to add an existing subscription to a subscription group, it must belong to either the same customer record as the target, or be within the same customer hierarchy. +// Rather than specifying a customer, the `target` parameter could instead simply have a value of +// * `"self"` which indicates the subscription will be paid for not by some other customer, but by the subscribing customer, +// * `"parent"` which indicates the subscription will be paid for by the subscribing customer's parent within a customer hierarchy, or +// * `"eldest"` which indicates the subscription will be paid for by the root-level customer in the subscribing customer's hierarchy. +// To create a new subscription into a subscription group, please reference the following: // [Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) -func (s *SubscriptionGroupsController) CreateSubscriptionGroupHierarchy( - ctx context.Context, - subscriptionId int, - body *models.AddSubscriptionToAGroup) ( - models.ApiResponse[models.SubscriptionGroupResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/group.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionGroupResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (s *SubscriptionGroupsController) AddSubscriptionToGroup( + ctx context.Context, + subscriptionId int, + body *models.AddSubscriptionToAGroup) ( + models.ApiResponse[models.SubscriptionGroupResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/group.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionGroupResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionGroupResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// RemoveSubscriptionFromGroup takes context, subscriptionId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// RemoveSubscriptionFromGroup takes context, subscriptionId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // For sites making use of the [Relationship Billing](https://chargify.zendesk.com/hc/en-us/articles/4407737494171) and [Customer Hierarchy](https://chargify.zendesk.com/hc/en-us/articles/4407746683291) features, it is possible to remove existing subscription from subscription group. func (s *SubscriptionGroupsController) RemoveSubscriptionFromGroup( - ctx context.Context, - subscriptionId int) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/group.json", subscriptionId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + subscriptionId int) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/group.json", subscriptionId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } diff --git a/subscription_invoice_account_controller.go b/subscription_invoice_account_controller.go index 542b807a..0f2d3edf 100644 --- a/subscription_invoice_account_controller.go +++ b/subscription_invoice_account_controller.go @@ -1,280 +1,280 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" + "time" ) // SubscriptionInvoiceAccountController represents a controller struct. type SubscriptionInvoiceAccountController struct { - baseController + baseController } -// NewSubscriptionInvoiceAccountController creates a new instance of SubscriptionInvoiceAccountController. +// NewSubscriptionInvoiceAccountController creates a new instance of SubscriptionInvoiceAccountController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionInvoiceAccountController. func NewSubscriptionInvoiceAccountController(baseController baseController) *SubscriptionInvoiceAccountController { - subscriptionInvoiceAccountController := SubscriptionInvoiceAccountController{baseController: baseController} - return &subscriptionInvoiceAccountController + subscriptionInvoiceAccountController := SubscriptionInvoiceAccountController{baseController: baseController} + return &subscriptionInvoiceAccountController } -// ReadAccountBalances takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.AccountBalances data and -// an error if there was an issue with the request or response. +// ReadAccountBalances takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.AccountBalances data and +// an error if there was an issue with the request or response. // Returns the `balance_in_cents` of the Subscription's Pending Discount, Service Credit, and Prepayment accounts, as well as the sum of the Subscription's open, payable invoices. func (s *SubscriptionInvoiceAccountController) ReadAccountBalances( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.AccountBalances], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/account_balances.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.AccountBalances - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.AccountBalances](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.AccountBalances], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/account_balances.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.AccountBalances + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.AccountBalances](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreatePrepayment takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.CreatePrepaymentResponse data and -// an error if there was an issue with the request or response. -// ## Create Prepayment -// In order to specify a prepayment made against a subscription, specify the `amount, memo, details, 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. +// CreatePrepayment takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.CreatePrepaymentResponse data and +// an error if there was an issue with the request or response. +// ## Create Prepayment +// In order to specify a prepayment made against a subscription, specify the `amount, memo, details, 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. // Please note that you **can't** pass `amount_in_cents`. func (s *SubscriptionInvoiceAccountController) CreatePrepayment( - ctx context.Context, - subscriptionId int, - body *models.CreatePrepaymentRequest) ( - models.ApiResponse[models.CreatePrepaymentResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/prepayments.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.CreatePrepaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.CreatePrepaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.CreatePrepaymentRequest) ( + models.ApiResponse[models.CreatePrepaymentResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/prepayments.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.CreatePrepaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.CreatePrepaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListPrepayments takes context, subscriptionId, page, perPage, filterDateField, filterStartDate, filterEndDate as parameters and -// returns an models.ApiResponse with models.PrepaymentsResponse data and -// an error if there was an issue with the request or response. +// ListPrepayments takes context, subscriptionId, page, perPage, filterDateField, filterStartDate, filterEndDate as parameters and +// returns an models.ApiResponse with models.PrepaymentsResponse data and +// an error if there was an issue with the request or response. // This request will list a subscription's prepayments. func (s *SubscriptionInvoiceAccountController) ListPrepayments( - ctx context.Context, - subscriptionId int, - page *int, - perPage *int, - filterDateField *models.BasicDateField, - filterStartDate *time.Time, - filterEndDate *time.Time) ( - models.ApiResponse[models.PrepaymentsResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/prepayments.json", subscriptionId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if filterDateField != nil { - req.QueryParam("filter[date_field]", *filterDateField) - } - if filterStartDate != nil { - req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) - } - if filterEndDate != nil { - req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) - } - - var result models.PrepaymentsResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PrepaymentsResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + page *int, + perPage *int, + filterDateField *models.BasicDateField, + filterStartDate *time.Time, + filterEndDate *time.Time) ( + models.ApiResponse[models.PrepaymentsResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/prepayments.json", subscriptionId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if filterDateField != nil { + req.QueryParam("filter[date_field]", *filterDateField) + } + if filterStartDate != nil { + req.QueryParam("filter[start_date]", filterStartDate.Format(models.DEFAULT_DATE)) + } + if filterEndDate != nil { + req.QueryParam("filter[end_date]", filterEndDate.Format(models.DEFAULT_DATE)) + } + + var result models.PrepaymentsResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PrepaymentsResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// IssueServiceCredit takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.ServiceCredit data and -// an error if there was an issue with the request or response. +// IssueServiceCredit takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.ServiceCredit data and +// an error if there was an issue with the request or response. // Credit will be added to the subscription in the amount specified in the request body. The credit is subsequently applied to the next generated invoice. func (s *SubscriptionInvoiceAccountController) IssueServiceCredit( - ctx context.Context, - subscriptionId int, - body *models.IssueServiceCreditRequest) ( - models.ApiResponse[models.ServiceCredit], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/service_credits.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.ServiceCredit - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ServiceCredit](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.IssueServiceCreditRequest) ( + models.ApiResponse[models.ServiceCredit], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/service_credits.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.ServiceCredit + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ServiceCredit](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// DeductServiceCredit takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// DeductServiceCredit takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Credit will be removed from the subscription in the amount specified in the request body. The credit amount being deducted must be equal to or less than the current credit balance. func (s *SubscriptionInvoiceAccountController) DeductServiceCredit( - ctx context.Context, - subscriptionId int, - body *models.DeductServiceCreditRequest) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/service_credit_deductions.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + subscriptionId int, + body *models.DeductServiceCreditRequest) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/service_credit_deductions.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// RefundPrepayment takes context, subscriptionId, prepaymentId, body as parameters and -// returns an models.ApiResponse with models.PrepaymentResponse data and -// an error if there was an issue with the request or response. -// This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. +// RefundPrepayment takes context, subscriptionId, prepaymentId, body as parameters and +// returns an models.ApiResponse with models.PrepaymentResponse data and +// an error if there was an issue with the request or response. +// This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. // The amount may be passed either as a decimal, with `amount`, or an integer in cents, with `amount_in_cents`. func (s *SubscriptionInvoiceAccountController) RefundPrepayment( - ctx context.Context, - subscriptionId int, - prepaymentId string, - body *models.RefundPrepaymentRequest) ( - models.ApiResponse[models.PrepaymentResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/prepayments/%v/refunds.json", subscriptionId, prepaymentId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.PrepaymentResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PrepaymentResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 400 { - err = errors.NewRefundPrepaymentBaseErrorsResponse(400, "Bad Request") - } - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewRefundPrepaymentAggregatedErrorsResponse(422, "Unprocessable Entity") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + prepaymentId string, + body *models.RefundPrepaymentRequest) ( + models.ApiResponse[models.PrepaymentResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/prepayments/%v/refunds.json", subscriptionId, prepaymentId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.PrepaymentResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PrepaymentResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 400 { + err = errors.NewRefundPrepaymentBaseErrorsResponse(400, "Bad Request") + } + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewRefundPrepaymentAggregatedErrorsResponse(422, "Unprocessable Entity") + } + return models.NewApiResponse(result, resp), err } diff --git a/subscription_notes_controller.go b/subscription_notes_controller.go index b74c53e7..1f89af10 100644 --- a/subscription_notes_controller.go +++ b/subscription_notes_controller.go @@ -1,209 +1,209 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" ) // SubscriptionNotesController represents a controller struct. type SubscriptionNotesController struct { - baseController + baseController } -// NewSubscriptionNotesController creates a new instance of SubscriptionNotesController. +// NewSubscriptionNotesController creates a new instance of SubscriptionNotesController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionNotesController. func NewSubscriptionNotesController(baseController baseController) *SubscriptionNotesController { - subscriptionNotesController := SubscriptionNotesController{baseController: baseController} - return &subscriptionNotesController + subscriptionNotesController := SubscriptionNotesController{baseController: baseController} + return &subscriptionNotesController } -// CreateSubscriptionNote takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionNoteResponse data and -// an error if there was an issue with the request or response. -// Use the following method to create 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. +// CreateSubscriptionNote takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionNoteResponse data and +// an error if there was an issue with the request or response. +// Use the following method to create 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 Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181-Subscription-Summary#notes). func (s *SubscriptionNotesController) CreateSubscriptionNote( - ctx context.Context, - subscriptionId int, - body *models.UpdateSubscriptionNoteRequest) ( - models.ApiResponse[models.SubscriptionNoteResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/notes.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionNoteResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.UpdateSubscriptionNoteRequest) ( + models.ApiResponse[models.SubscriptionNoteResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/notes.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionNoteResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ListSubscriptionNotes takes context, subscriptionId, page, perPage as parameters and -// returns an models.ApiResponse with []models.SubscriptionNoteResponse data and -// an error if there was an issue with the request or response. +// ListSubscriptionNotes takes context, subscriptionId, page, perPage as parameters and +// returns an models.ApiResponse with []models.SubscriptionNoteResponse data and +// an error if there was an issue with the request or response. // Use this method to retrieve a list of Notes associated with a Subscription. The response will be an array of Notes. func (s *SubscriptionNotesController) ListSubscriptionNotes( - ctx context.Context, - subscriptionId int, - page *int, - perPage *int) ( - models.ApiResponse[[]models.SubscriptionNoteResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/notes.json", subscriptionId), - ) - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - - var result []models.SubscriptionNoteResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.SubscriptionNoteResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + page *int, + perPage *int) ( + models.ApiResponse[[]models.SubscriptionNoteResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/notes.json", subscriptionId), + ) + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + + var result []models.SubscriptionNoteResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.SubscriptionNoteResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReadSubscriptionNote takes context, subscriptionId, noteId as parameters and -// returns an models.ApiResponse with models.SubscriptionNoteResponse data and -// an error if there was an issue with the request or response. +// ReadSubscriptionNote takes context, subscriptionId, noteId as parameters and +// returns an models.ApiResponse with models.SubscriptionNoteResponse data and +// an error if there was an issue with the request or response. // Once you have obtained the ID of the note you wish to read, use this method to show a particular note attached to a subscription. func (s *SubscriptionNotesController) ReadSubscriptionNote( - ctx context.Context, - subscriptionId int, - noteId int) ( - models.ApiResponse[models.SubscriptionNoteResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), - ) - req.Authenticate(true) - - var result models.SubscriptionNoteResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + noteId int) ( + models.ApiResponse[models.SubscriptionNoteResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), + ) + req.Authenticate(true) + + var result models.SubscriptionNoteResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateSubscriptionNote takes context, subscriptionId, noteId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionNoteResponse data and -// an error if there was an issue with the request or response. +// UpdateSubscriptionNote takes context, subscriptionId, noteId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionNoteResponse data and +// an error if there was an issue with the request or response. // Use the following method to update a note for a Subscription. func (s *SubscriptionNotesController) UpdateSubscriptionNote( - ctx context.Context, - subscriptionId int, - noteId int, - body *models.UpdateSubscriptionNoteRequest) ( - models.ApiResponse[models.SubscriptionNoteResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionNoteResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + noteId int, + body *models.UpdateSubscriptionNoteRequest) ( + models.ApiResponse[models.SubscriptionNoteResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionNoteResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionNoteResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// DeleteSubscriptionNote takes context, subscriptionId, noteId as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. +// DeleteSubscriptionNote takes context, subscriptionId, noteId as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. // Use the following method to delete a note for a Subscription. func (s *SubscriptionNotesController) DeleteSubscriptionNote( - ctx context.Context, - subscriptionId int, - noteId int) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), - ) - req.Authenticate(true) - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subscriptionId int, + noteId int) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/notes/%v.json", subscriptionId, noteId), + ) + req.Authenticate(true) + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } diff --git a/subscription_products_controller.go b/subscription_products_controller.go index ee0a9a63..ac8b2d80 100644 --- a/subscription_products_controller.go +++ b/subscription_products_controller.go @@ -1,144 +1,144 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // SubscriptionProductsController represents a controller struct. type SubscriptionProductsController struct { - baseController + baseController } -// NewSubscriptionProductsController creates a new instance of SubscriptionProductsController. +// NewSubscriptionProductsController creates a new instance of SubscriptionProductsController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionProductsController. func NewSubscriptionProductsController(baseController baseController) *SubscriptionProductsController { - subscriptionProductsController := SubscriptionProductsController{baseController: baseController} - return &subscriptionProductsController + subscriptionProductsController := SubscriptionProductsController{baseController: baseController} + return &subscriptionProductsController } -// MigrateSubscriptionProduct takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// 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. -// ## Valid Subscriptions -// Subscriptions should be in the `active` or `trialing` state in order 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407898373531). -// ## Failed Migrations -// One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to it's current product. Please be aware of this issue! -// ## Migration 3D Secure - Stripe -// It may happen that a payment needs 3D Secure Authentication when the subscription is migrated to a new product; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: -// ```json -// { -// "errors": [ -// "Your card was declined. This transaction requires 3D secure authentication." -// ], -// "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", -// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", -// "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" -// } -// ``` -// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: -// - whether the authentication was successful (`success`) -// - the gateway ID for the payment (`gateway_payment_id`) -// - the subscription ID (`subscription_id`) -// Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. -// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. -// The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` -// ### Example Redirect Flow -// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: -// 1. Create a migration via API; it requires 3DS -// 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. -// 3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id -// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to -// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known +// MigrateSubscriptionProduct takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// 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. +// ## Valid Subscriptions +// Subscriptions should be in the `active` or `trialing` state in order 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 Chargify UI can be located [here](https://chargify.zendesk.com/hc/en-us/articles/4407898373531). +// ## Failed Migrations +// One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to it's current product. Please be aware of this issue! +// ## Migration 3D Secure - Stripe +// It may happen that a payment needs 3D Secure Authentication when the subscription is migrated to a new product; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +// ```json +// { +// "errors": [ +// "Your card was declined. This transaction requires 3D secure authentication." +// ], +// "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", +// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", +// "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" +// } +// ``` +// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. +// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: +// - whether the authentication was successful (`success`) +// - the gateway ID for the payment (`gateway_payment_id`) +// - the subscription ID (`subscription_id`) +// Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. +// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +// The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` +// ### Example Redirect Flow +// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: +// 1. Create a migration via API; it requires 3DS +// 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. +// 3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id +// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to +// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied +// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. +// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known // 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not. func (s *SubscriptionProductsController) MigrateSubscriptionProduct( - ctx context.Context, - subscriptionId int, - body *models.SubscriptionProductMigrationRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/migrations.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.SubscriptionProductMigrationRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/migrations.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// PreviewSubscriptionProductMigration takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionMigrationPreviewResponse data and -// an error if there was an issue with the request or response. -// ## Previewing a future date -// It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a `proration_date` along with the request (eg: `"proration_date": "2020-12-18T18:25:43.511Z"`). +// PreviewSubscriptionProductMigration takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionMigrationPreviewResponse data and +// an error if there was an issue with the request or response. +// ## Previewing a future date +// It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a `proration_date` along with the request (eg: `"proration_date": "2020-12-18T18:25:43.511Z"`). // This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now. func (s *SubscriptionProductsController) PreviewSubscriptionProductMigration( - ctx context.Context, - subscriptionId int, - body *models.SubscriptionMigrationPreviewRequest) ( - models.ApiResponse[models.SubscriptionMigrationPreviewResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/migrations/preview.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionMigrationPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionMigrationPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.SubscriptionMigrationPreviewRequest) ( + models.ApiResponse[models.SubscriptionMigrationPreviewResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/migrations/preview.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionMigrationPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionMigrationPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/subscription_status_controller.go b/subscription_status_controller.go index 7b1166f0..29504138 100644 --- a/subscription_status_controller.go +++ b/subscription_status_controller.go @@ -1,546 +1,546 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // SubscriptionStatusController represents a controller struct. type SubscriptionStatusController struct { - baseController + baseController } -// NewSubscriptionStatusController creates a new instance of SubscriptionStatusController. +// NewSubscriptionStatusController creates a new instance of SubscriptionStatusController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionStatusController. func NewSubscriptionStatusController(baseController baseController) *SubscriptionStatusController { - subscriptionStatusController := SubscriptionStatusController{baseController: baseController} - return &subscriptionStatusController + subscriptionStatusController := SubscriptionStatusController{baseController: baseController} + return &subscriptionStatusController } -// RetrySubscription takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Chargify offers the ability to retry collecting the balance due on a past due Subscription without waiting for the next scheduled attempt. -// ## Successful Reactivation -// The response will be `200 OK` with the updated Subscription. -// ## Failed Reactivation +// RetrySubscription takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Chargify offers the ability to retry collecting the balance due on a past due Subscription without waiting for the next scheduled attempt. +// ## Successful Reactivation +// The response will be `200 OK` with the updated Subscription. +// ## Failed Reactivation // The response will be `422 "Unprocessable Entity`. func (s *SubscriptionStatusController) RetrySubscription( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/retry.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/retry.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// CancelSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. +// CancelSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. // The DELETE action causes the cancellation of the Subscription. This means, the method sets the Subscription state to "canceled". func (s *SubscriptionStatusController) CancelSubscription( - ctx context.Context, - subscriptionId int, - body *models.CancellationRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.CancellationRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewApiError(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ResumeSubscription takes context, subscriptionId, calendarBillingResumptionCharge as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. +// ResumeSubscription takes context, subscriptionId, calendarBillingResumptionCharge as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. // Resume a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. func (s *SubscriptionStatusController) ResumeSubscription( - ctx context.Context, - subscriptionId int, - calendarBillingResumptionCharge *models.ResumptionCharge) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/resume.json", subscriptionId), - ) - req.Authenticate(true) - if calendarBillingResumptionCharge != nil { - req.QueryParam("calendar_billing['resumption_charge']", *calendarBillingResumptionCharge) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + calendarBillingResumptionCharge *models.ResumptionCharge) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/resume.json", subscriptionId), + ) + req.Authenticate(true) + if calendarBillingResumptionCharge != nil { + req.QueryParam("calendar_billing['resumption_charge']", *calendarBillingResumptionCharge) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// PauseSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// This will place the subscription in the on_hold state and it will not renew. -// ## Limitations +// PauseSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// This will place the subscription in the on_hold state and it will not renew. +// ## Limitations // You may not place a subscription on hold if the `next_billing` date is within 24 hours. func (s *SubscriptionStatusController) PauseSubscription( - ctx context.Context, - subscriptionId int, - body *models.PauseRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/hold.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.PauseRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/hold.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// UpdateAutomaticSubscriptionResumption takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Once a subscription has been paused / put on hold, you can update the date which was specified to automatically resume the subscription. -// To update a subscription's resume date, use this method to change or update the `automatically_resume_at` date. -// ### Remove the resume date +// UpdateAutomaticSubscriptionResumption takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Once a subscription has been paused / put on hold, you can update the date which was specified to automatically resume the subscription. +// To update a subscription's resume date, use this method to change or update the `automatically_resume_at` date. +// ### Remove the resume date // Alternately, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. func (s *SubscriptionStatusController) UpdateAutomaticSubscriptionResumption( - ctx context.Context, - subscriptionId int, - body *models.PauseRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/hold.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.PauseRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/hold.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReactivateSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Chargify offers the ability to reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://chargify.zendesk.com/hc/en-us/articles/4407898737691). -// **Please note: The term -// "resume" is used also during another process in Chargify. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** -// + The response returns the subscription object in the `active` or `trialing` state. -// + The `canceled_at` and `cancellation_message` fields do not have values. -// + The method works for "Canceled" or "Trial Ended" subscriptions. -// + It will not work for items not marked as "Canceled", "Unpaid", or "Trial Ended". -// ## Resume the current billing period for a subscription -// A subscription is considered "resumable" if you are attempting to reactivate within the billing period the subscription was canceled in. -// A resumed subscription's billing date remains the same as before it was canceled. In other words, it does not start a new billing period. Payment may or may not be collected for a resumed subscription, depending on whether or not the subscription had a balance when it was canceled (for example, if it was canceled because of dunning). -// Consider a subscription which was created on June 1st, and would renew on July 1st. The subscription is then canceled on June 15. -// If a reactivation with `resume: true` were attempted _before_ what would have been the next billing date of July 1st, then Chargify would resume the subscription. -// If a reactivation with `resume: true` were attempted _after_ what would have been the next billing date of July 1st, then Chargify would not resume the subscription, and instead it would be reactivated with a new billing period. -// | Canceled | Reactivation | Resumable? | -// |---|---|---| -// | Jun 15 | June 28 | Yes | -// | Jun 15 | July 2 | No | -// ## Reactivation Scenarios -// ### Reactivating Canceled Subscription While Preserving Balance -// + Given you have a product that costs $20 -// + Given you have a canceled subscription to the $20 product -// + 1 charge should exist for $20 -// + 1 payment should exist for $20 -// + When the subscription has canceled due to dunning, it retained a negative balance of $20 -// #### Results -// The resulting charges upon reactivation will be: -// + 1 charge for $20 for the new product -// + 1 charge for $20 for the balance due -// + Total charges = $40 -// + The subscription will transition to active -// + The subscription balance will be zero -// ### Reactivating a Canceled Subscription With Coupon -// + Given you have a canceled subscription -// + It has no current period defined -// + You have a coupon code "EARLYBIRD" -// + The coupon is set to recur for 6 periods -// PUT request sent to: -// `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?coupon_code=EARLYBIRD` -// #### Results -// + The subscription will transition to active -// + The subscription should have applied a coupon with code "EARLYBIRD" -// ### Reactivating Canceled Subscription With a Trial, Without the include_trial Flag -// + Given you have a canceled subscription -// + The product associated with the subscription has a trial -// + PUT request to -// `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` -// #### Results -// + The subscription will transition to active -// ### Reactivating Canceled Subscription With Trial, With the include_trial Flag -// + Given you have a canceled subscription -// + The product associated with the subscription has a trial -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?include_trial=1` -// #### Results -// + The subscription will transition to trialing -// ### Reactivating Trial Ended Subscription -// + Given you have a trial_ended subscription -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` -// #### Results -// + The subscription will transition to active -// ### Resuming a Canceled Subscription -// + Given you have a `canceled` subscription and it is resumable -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` -// #### Results -// + The subscription will transition to active -// + The next billing date should not have changed -// ### Attempting to resume a subscription which is not resumable -// + Given you have a `canceled` subscription, and it is not resumable -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` -// #### Results -// + The subscription will transition to active, with a new billing period. -// ### Attempting to resume but not reactivate a subscription which is not resumable -// + Given you have a `canceled` subscription, and it is not resumable -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume[require_resume]=true` -// + The response status should be "422 UNPROCESSABLE ENTITY" -// + The subscription should be canceled with the following response -// ``` -// { -// "errors": ["Request was 'resume only', but this subscription cannot be resumed."] -// } -// ``` -// #### Results -// + The subscription should remain `canceled` -// + The next billing date should not have changed -// ### Resuming Subscription Which Was Trialing -// + Given you have a `trial_ended` subscription, and it is resumable -// + And the subscription was canceled in the middle of a trial -// + And there is still time left on the trial -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` -// #### Results -// + The subscription will transition to trialing -// + The next billing date should not have changed -// ### Resuming Subscription Which Was trial_ended -// + Given you have a `trial_ended` subscription, and it is resumable -// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` -// #### Results -// + The subscription will transition to active -// + The next billing date should not have changed +// ReactivateSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Chargify offers the ability to reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://chargify.zendesk.com/hc/en-us/articles/4407898737691). +// **Please note: The term +// "resume" is used also during another process in Chargify. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** +// + The response returns the subscription object in the `active` or `trialing` state. +// + The `canceled_at` and `cancellation_message` fields do not have values. +// + The method works for "Canceled" or "Trial Ended" subscriptions. +// + It will not work for items not marked as "Canceled", "Unpaid", or "Trial Ended". +// ## Resume the current billing period for a subscription +// A subscription is considered "resumable" if you are attempting to reactivate within the billing period the subscription was canceled in. +// A resumed subscription's billing date remains the same as before it was canceled. In other words, it does not start a new billing period. Payment may or may not be collected for a resumed subscription, depending on whether or not the subscription had a balance when it was canceled (for example, if it was canceled because of dunning). +// Consider a subscription which was created on June 1st, and would renew on July 1st. The subscription is then canceled on June 15. +// If a reactivation with `resume: true` were attempted _before_ what would have been the next billing date of July 1st, then Chargify would resume the subscription. +// If a reactivation with `resume: true` were attempted _after_ what would have been the next billing date of July 1st, then Chargify would not resume the subscription, and instead it would be reactivated with a new billing period. +// | Canceled | Reactivation | Resumable? | +// |---|---|---| +// | Jun 15 | June 28 | Yes | +// | Jun 15 | July 2 | No | +// ## Reactivation Scenarios +// ### Reactivating Canceled Subscription While Preserving Balance +// + Given you have a product that costs $20 +// + Given you have a canceled subscription to the $20 product +// + 1 charge should exist for $20 +// + 1 payment should exist for $20 +// + When the subscription has canceled due to dunning, it retained a negative balance of $20 +// #### Results +// The resulting charges upon reactivation will be: +// + 1 charge for $20 for the new product +// + 1 charge for $20 for the balance due +// + Total charges = $40 +// + The subscription will transition to active +// + The subscription balance will be zero +// ### Reactivating a Canceled Subscription With Coupon +// + Given you have a canceled subscription +// + It has no current period defined +// + You have a coupon code "EARLYBIRD" +// + The coupon is set to recur for 6 periods +// PUT request sent to: +// `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?coupon_code=EARLYBIRD` +// #### Results +// + The subscription will transition to active +// + The subscription should have applied a coupon with code "EARLYBIRD" +// ### Reactivating Canceled Subscription With a Trial, Without the include_trial Flag +// + Given you have a canceled subscription +// + The product associated with the subscription has a trial +// + PUT request to +// `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` +// #### Results +// + The subscription will transition to active +// ### Reactivating Canceled Subscription With Trial, With the include_trial Flag +// + Given you have a canceled subscription +// + The product associated with the subscription has a trial +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?include_trial=1` +// #### Results +// + The subscription will transition to trialing +// ### Reactivating Trial Ended Subscription +// + Given you have a trial_ended subscription +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json` +// #### Results +// + The subscription will transition to active +// ### Resuming a Canceled Subscription +// + Given you have a `canceled` subscription and it is resumable +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` +// #### Results +// + The subscription will transition to active +// + The next billing date should not have changed +// ### Attempting to resume a subscription which is not resumable +// + Given you have a `canceled` subscription, and it is not resumable +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` +// #### Results +// + The subscription will transition to active, with a new billing period. +// ### Attempting to resume but not reactivate a subscription which is not resumable +// + Given you have a `canceled` subscription, and it is not resumable +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume[require_resume]=true` +// + The response status should be "422 UNPROCESSABLE ENTITY" +// + The subscription should be canceled with the following response +// ``` +// { +// "errors": ["Request was 'resume only', but this subscription cannot be resumed."] +// } +// ``` +// #### Results +// + The subscription should remain `canceled` +// + The next billing date should not have changed +// ### Resuming Subscription Which Was Trialing +// + Given you have a `trial_ended` subscription, and it is resumable +// + And the subscription was canceled in the middle of a trial +// + And there is still time left on the trial +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` +// #### Results +// + The subscription will transition to trialing +// + The next billing date should not have changed +// ### Resuming Subscription Which Was trial_ended +// + Given you have a `trial_ended` subscription, and it is resumable +// + Send a PUT request to `https://acme.chargify.com/subscriptions/{subscription_id}/reactivate.json?resume=true` +// #### Results +// + The subscription will transition to active +// + The next billing date should not have changed // + Any product-related charges should have been collected func (s *SubscriptionStatusController) ReactivateSubscription( - ctx context.Context, - subscriptionId int, - body *models.ReactivateSubscriptionRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/reactivate.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.ReactivateSubscriptionRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/reactivate.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// InitiateDelayedCancellation takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.DelayedCancellationResponse data and -// an error if there was an issue with the request or response. -// Chargify offers the ability to cancel a subscription at the end of the current billing period. This period is set by its current product. -// Requesting to cancel the subscription at the end of the period sets the `cancel_at_end_of_period` flag to true. +// InitiateDelayedCancellation takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.DelayedCancellationResponse data and +// an error if there was an issue with the request or response. +// Chargify offers the ability to cancel a subscription at the end of the current billing period. This period is set by its current product. +// Requesting to cancel the subscription at the end of the period sets the `cancel_at_end_of_period` flag to true. // Note that you cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. func (s *SubscriptionStatusController) InitiateDelayedCancellation( - ctx context.Context, - subscriptionId int, - body *models.CancellationRequest) ( - models.ApiResponse[models.DelayedCancellationResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/delayed_cancel.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.DelayedCancellationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.DelayedCancellationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.CancellationRequest) ( + models.ApiResponse[models.DelayedCancellationResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/delayed_cancel.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.DelayedCancellationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.DelayedCancellationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// StopDelayedCancellation takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.DelayedCancellationResponse data and -// an error if there was an issue with the request or response. -// Removing the delayed cancellation on a subscription will ensure that it doesn't get canceled at the end of the period that it is in. The request will reset the `cancel_at_end_of_period` flag to `false`. +// CancelDelayedCancellation takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.DelayedCancellationResponse data and +// an error if there was an issue with the request or response. +// Removing the delayed cancellation on a subscription will ensure that it doesn't get canceled at the end of the period that it is in. The request will reset the `cancel_at_end_of_period` flag to `false`. // This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful. -func (s *SubscriptionStatusController) StopDelayedCancellation( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.DelayedCancellationResponse], - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/delayed_cancel.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.DelayedCancellationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.DelayedCancellationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionStatusController) CancelDelayedCancellation( + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.DelayedCancellationResponse], + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/delayed_cancel.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.DelayedCancellationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.DelayedCancellationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + return models.NewApiResponse(result, resp), err } -// CancelDunning takes context, subscriptionId as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. +// CancelDunning takes context, subscriptionId as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. // If a subscription is currently in dunning, the subscription will be set to active and the active Dunner will be resolved. func (s *SubscriptionStatusController) CancelDunning( - ctx context.Context, - subscriptionId int) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/cancel_dunning.json", subscriptionId), - ) - req.Authenticate(true) - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/cancel_dunning.json", subscriptionId), + ) + req.Authenticate(true) + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// PreviewRenewal takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.RenewalPreviewResponse data and -// an error if there was an issue with the request or response. -// The Chargify API allows you to preview a renewal by posting to the renewals endpoint. 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, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). -// ## 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: -// * Current `allocated_quantity` for quantity-based components -// * Current enabled/disabled status for on/off components -// * Current metered usage `unit_balance` for metered components -// * Current metric quantity value for events recorded thus far for events-based components -// In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. -// Optionally, **you may provide your own custom quantities** for any 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 +// PreviewRenewal takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.RenewalPreviewResponse data and +// an error if there was an issue with the request or response. +// The Chargify API allows you to preview a renewal by posting to the renewals endpoint. 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, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). +// ## 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: +// * Current `allocated_quantity` for quantity-based components +// * Current enabled/disabled status for on/off components +// * Current metered usage `unit_balance` for metered components +// * Current metric quantity value for events recorded thus far for events-based components +// In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. +// Optionally, **you may provide your own custom quantities** for any 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. Plain and simple, this will preview data, not log any changes against a subscription. func (s *SubscriptionStatusController) PreviewRenewal( - ctx context.Context, - subscriptionId int, - body *models.RenewalPreviewRequest) ( - models.ApiResponse[models.RenewalPreviewResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/renewals/preview.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.RenewalPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.RenewalPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.RenewalPreviewRequest) ( + models.ApiResponse[models.RenewalPreviewResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/renewals/preview.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.RenewalPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.RenewalPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } diff --git a/subscriptions_controller.go b/subscriptions_controller.go index 40e56551..d4cc8387 100644 --- a/subscriptions_controller.go +++ b/subscriptions_controller.go @@ -1,1068 +1,1068 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" - "net/http" - "time" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" + "net/http" + "time" ) // SubscriptionsController represents a controller struct. type SubscriptionsController struct { - baseController + baseController } -// NewSubscriptionsController creates a new instance of SubscriptionsController. +// NewSubscriptionsController creates a new instance of SubscriptionsController. // It takes a baseController as a parameter and returns a pointer to the SubscriptionsController. func NewSubscriptionsController(baseController baseController) *SubscriptionsController { - subscriptionsController := SubscriptionsController{baseController: baseController} - return &subscriptionsController + subscriptionsController := SubscriptionsController{baseController: baseController} + return &subscriptionsController } -// CreateSubscription takes context, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Full documentation on how subscriptions operate within Chargify can be located under the following topics: -// + [Subscriptions Reference](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577172749-Subscription-Introduction) -// + [Subscriptions Actions](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510556557-Actions) -// + [Subscription Cancellation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510556557-Actions#initiate-cancellation) -// + [Subscription Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021-Reactivating-and-Resuming) -// + [Subscription Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821-Imports) -// When creating a subscription, you must specify a product and a customer. Credit card details may be required, depending on the options for the Product being subscribed ([see Product Options](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221#payment-method-settings)). -// The product may be specified by `product_id` or by `product_handle` (API Handle). In similar fashion, to pass a particular product price point, you may either use `product_price_point_handle` or `product_price_point_id`. -// An existing customer may be specified by a `customer_id` (ID within Chargify) or a `customer_reference` (unique value within your app that you have shared with Chargify via the reference attribute on a customer). You may also pass in an existing payment profile for that customer with `payment_profile_id`. A new customer may be created by providing `customer_attributes`. -// Credit card details may be required, depending on the options for the product being subscribed. The product can be specified by `product_id` or by `product_handle` (API Handle). -// If you are creating a subscription with a payment profile, the attribute to send will be `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. -// ## Taxable Subscriptions -// If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405275711885-Avalara-VAT-Tax) or [Custom Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405069041549-Custom-Taxes), there are a few considerations to be made regarding collecting subscription data. -// For subscribers to be eligible to be taxed, the following information for the `customer` object or `payment_profile` object must by supplied: -// + A subscription to a [taxable product](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221-Product-Editing#tax-settings) -// + [Full valid billing or shipping address](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#full-address-required-for-taxable-subscriptions) to identify the tax locale -// + The portion of the address that houses the [state information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#required-state-format-for-taxable-subscriptions) of either adddress must adhere to the ISO standard of a 2-3 character limit/format. -// + The portion of the address that houses the [country information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#required-country-format-for-taxable-subscriptions) must adhere to the ISO standard of a 2 character limit/format. -// ## Subscription Request Examples -// The subscription examples below will be split into two sections. -// The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure `chargify_token` generated by Chargify.js. -// The second section, "Passing Payment Information", will focus on passing payment information into Chargify. Please be aware that collecting and sending Chargify raw card details requires PCI compliance on your end; these examples are provided as guidance. If your business is not PCI compliant, we recommend using Chargify.js to collect credit cards or bank accounts. -// # Subscription Customization -// ## With Components -// Different components require slightly different data. For example, quantity-based and on/off components accept `allocated_quantity`, while metered components accept `unit_balance`. -// When creating a subscription with a component, a `price_point_id` can be passed in along with the `component_id` to specify which price point to use. If not passed in, the default price point will be used. -// Note: if an invalid `price_point_id` is used, the subscription will still proceed but will use the component's default price point. -// Components and their price points may be added by ID or by handle. See the example request body labeled "Components By Handle (Quantity-Based)"; the format will be the same for other component types. -// ## With Coupon(s) -// Pass an array of `coupon_codes`. See the example request body "With Coupon". -// ## With Manual Invoice Collection -// The `invoice` collection method works only on legacy Statement Architecture. -// On Relationship Invoicing Architecture use the `remittance` collection method. -// ## Prepaid Subscription -// A prepaid subscription can be created with the usual subscription creation parameters, specifying `prepaid` as the `payment_collection_method` and including a nested `prepaid_configuration`. -// After a prepaid subscription has been created, additional funds can be manually added to the prepayment account through the [Create Prepayment Endpoint](https://developers.chargify.com/docs/api-docs/7ec482de77ba7-create-prepayment). -// Prepaid subscriptions do not work on legacy Statement Architecture. -// ## With Metafields -// Metafields can either attach to subscriptions or customers. Metafields are popuplated with the supplied metadata to the resource specified. -// If the metafield doesn't exist yet, it will be created on-the-fly. -// ## With Custom Pricing -// Custom pricing is pricing specific to the subscription in question. -// Create a subscription with custom pricing by passing pricing information instead of a price point. -// For a custom priced product, pass the custom_price object in place of `product_price_point_id`. For a custom priced component, pass the `custom_price` object within the component object. -// Custom prices and price points can exist in harmony on a subscription. -// # Passing Payment Information -// ## Subscription with Chargify.js token -// The `chargify_token` can be obtained using [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). The token represents payment profile attributes that were provided by the customer in their browser and stored at the payment gateway. -// The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of payment method being added. If a bank account is being passed, the payment attributes should be changed to `bank_account_attributes`. -// ```json -// { -// "subscription": { -// "product_handle": "pro-plan", -// "customer_attributes": { -// "first_name": "Joe", -// "last_name": "Smith", -// "email": "j.smith@example.com" -// }, -// "credit_card_attributes": { -// "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn", -// "payment_type": "credit_card" -// } -// } -// } -// ``` -// ## Subscription with vault token -// If you already have a customer and card stored in your payment gateway, you may create a subscription with a `vault_token`. Providing the last_four, card type and expiration date will allow the card to be displayed properly in the Chargify UI. -// ```json -// { -// "subscription": { -// "product_handle": "pro-plan", -// "customer_attributes": { -// "first_name": "Joe", -// "last_name": "Smith", -// "email": "j.smith@example.com" -// }, -// "credit_card_attributes": { -// first_name: "Joe, -// last_name: "Smith", -// card_type: "visa", -// expiration_month: "05", -// expiration_year: "2025", -// last_four: "1234", -// vault_token: "12345abc", -// current_vault: "braintree_blue" -// } -// } -// ``` -// ## Subscription with Credit Card -// ```json -// "subscription": { -// "product_handle": "basic", -// "customer_attributes": { -// "first_name": "Joe", -// "last_name": "Blow", -// "email": "joe@example.com", -// "zip": "02120", -// "state": "MA", -// "reference": "XYZ", -// "phone": "(617) 111 - 0000", -// "organization": "Acme", -// "country": "US", -// "city": "Boston", -// "address_2": null, -// "address": "123 Mass Ave." -// }, -// "credit_card_attributes": { -// "last_name": "Smith", -// "first_name": "Joe", -// "full_number": "4111111111111111", -// "expiration_year": "2021", -// "expiration_month": "1", -// "card_type": "visa", -// "billing_zip": "02120", -// "billing_state": "MA", -// "billing_country": "US", -// "billing_city": "Boston", -// "billing_address_2": null, -// "billing_address": "123 Mass Ave." -// } -// } -// ``` -// ## Subscription with ACH as Payment Profile -// ```json -// { -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Joe", -// "last_name": "Blow", -// "email": "joe@example.com", -// "zip": "02120", -// "state": "MA", -// "reference": "XYZ", -// "phone": "(617) 111 - 0000", -// "organization": "Acme", -// "country": "US", -// "city": "Boston", -// "address_2": null, -// "address": "123 Mass Ave." -// }, -// "bank_account_attributes": { -// "bank_name": "Best Bank", -// "bank_routing_number": "021000089", -// "bank_account_number": "111111111111", -// "bank_account_type": "checking", -// "bank_account_holder_type": "business", -// "payment_type": "bank_account" -// } -// } -// } -// ``` -// ## Subscription with PayPal payment profile -// ### With the nonce from Braintree JS -// ```json -// { "subscription": { -// "product_handle":"test-product-b", -// "customer_attributes": { -// "first_name":"Amelia", -// "last_name":"Johnson", -// "email":"amelia@example.com", -// "organization":"My Awesome Company" -// }, -// "payment_profile_attributes":{ -// "paypal_email": "amelia@example.com", -// "current_vault": "braintree_blue", -// "payment_method_nonce":"abc123", -// "payment_type":"paypal_account" -// } -// } -// ``` -// ### With the Braintree Customer ID as the vault token: -// ```json -// { "subscription": { -// "product_handle":"test-product-b", -// "customer_attributes": { -// "first_name":"Amelia", -// "last_name":"Johnson", -// "email":"amelia@example.com", -// "organization":"My Awesome Company" -// }, -// "payment_profile_attributes":{ -// "paypal_email": "amelia@example.com", -// "current_vault": "braintree_blue", -// "vault_token":"58271347", -// "payment_type":"paypal_account" -// } -// } -// ``` -// ## Subscription using GoCardless Bank Number -// These examples creates a customer, bank account and mandate in GoCardless. -// For more information on GoCardless, please view the following two resources: -// + [Payment Profiles via API for GoCardless](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#gocardless) -// + [Full documentation on GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404501889677) -// + [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) -// + [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) -// ```json -// { -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "bank_account_attributes": { -// "bank_name": "Royal Bank of France", -// "bank_account_number": "0000000", -// "bank_routing_number": "0003", -// "bank_branch_code": "00006", -// "payment_type": "bank_account", -// "billing_address": "20 Place de la Gare", -// "billing_city": "Colombes", -// "billing_state": "Île-de-France", -// "billing_zip": "92700", -// "billing_country": "FR" -// } -// } -// } -// ``` -// ## Subscription using GoCardless IBAN Number -// ```json -// { -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "bank_account_attributes": { -// "bank_name": "French Bank", -// "bank_iban": "FR1420041010050500013M02606", -// "payment_type": "bank_account", -// "billing_address": "20 Place de la Gare", -// "billing_city": "Colombes", -// "billing_state": "Île-de-France", -// "billing_zip": "92700", -// "billing_country": "FR" -// } -// } -// } -// ``` -// ## Subscription using Stripe SEPA Direct Debit -// For more information on Stripe Direct Debit, please view the following two resources: -// + [Payment Profiles via API for Stripe SEPA Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#sepa-direct-debit) -// + [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) -// + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) -// + [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) -// ```json -// { -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "bank_account_attributes": { -// "bank_name": "Test Bank", -// "bank_iban": "DE89370400440532013000", -// "payment_type": "bank_account" -// } -// } -// } -// ``` -// ## Subscription using Stripe BECS Direct Debit -// For more information on Stripe Direct Debit, please view the following two resources: -// + [Payment Profiles via API for Stripe BECS Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#stripe-becs-direct-debit) -// + [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) -// + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) -// + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-becs-direct-debit-stripe-gateway) -// ```json -// { -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "bank_account_attributes": { -// "bank_name": "Test Bank", -// "bank_branch_code": "000000", -// "bank_account_number": "000123456", -// "payment_type": "bank_account" -// } -// } -// } -// ``` -// ## 3D Secure - Stripe -// It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: -// ```json -// { -// "errors": [ -// "Your card was declined. This transaction requires 3D secure authentication." -// ], -// "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", -// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", -// "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" -// } -// ``` -// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: -// - whether the authentication was successful (`success`) -// - the gateway ID for the payment (`gateway_payment_id`) -// - the subscription ID (`subscription_id`) -// Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. -// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. -// The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` -// ## 3D Secure - Checkout -// It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: -// ```json -// { -// "errors": [ -// "Your card was declined. This transaction requires 3D secure authentication." -// ], -// "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu", -// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", -// "action_link": "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123" -// } -// ``` -// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: -// - whether the authentication was successful (`success`) -// - the gateway ID for the payment (`gateway_payment_id`) -// - the subscription ID (`subscription_id`) -// Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. -// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. -// The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` -// ### Example Redirect Flow -// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: -// 1. Create a subscription via API; it requires 3DS -// 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. -// 3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id -// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to -// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -// 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not -// ## Subscriptions Import -// Subscriptions can be “imported” via the API to handle the following scenarios: -// + You already have existing subscriptions with specific start and renewal dates that you would like to import to Chargify -// + You already have credit cards stored in your provider’s vault and you would like to create subscriptions using those tokens -// Before importing, you should have already set up your products to match your offerings. Then, you can create Subscriptions via the API just like you normally would, but using a few special attributes. -// Full documentation on how import Subscriptions using the **import tool** in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#imports-0-0). -// ### Important Notices and Disclaimers regarding Imports -// Before performing a bulk import of subscriptions via the API, we suggest reading the [Subscriptions Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#important-notices-and-disclaimers) instructions to understand the repurcussions of a large import. -// ### Subscription Input Attributes -// The following _additional_ attributes to the subscription input attributes make imports possible: `next_billing_at`, `previous_billing_at`, and `import_mrr`. -// ### Current Vault -// If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe (Legacy)" then please contact Support for further instructions on subscription imports. -// ### Braintree Blue (Braintree v2) Imports -// Braintree Blue is Braintree’s newer (version 2) API. For this gateway, please provide the `vault_token` parameter with the value from Braintree’s “Customer ID” rather than the “Payment Profile Token”. At this time we do not use `current_vault_token` with the Braintree Blue gateway, and we only support a single payment profile per Braintree Customer. -// When importing PayPal type payment profiles, please set `payment_type` to `paypal_account`. -// ### Stripe ACH Imports -// If the bank account has already been verified, currently you will need to create the customer, create the payment profile in Chargify - setting verified=true, then create a subscription using the customer_id and payment_profile_id. -// ### Webhooks During Import -// If no `next_billing_at` is provided, webhooks will be fired as normal. If you do set a future `next_billing_at`, only a subset of the webhooks are fired when the subscription is created. Keep reading for more information as to what webhooks will be fired under which scenarios. -// #### Successful creation with Billing Date -// Scenario: If `next_billing_at` provided -// + `signup_success` -// + `billing_date_change` -// #### Successful creation without Billing Date -// Scenario: If no `next_billing_at` provided -// + `signup_success` -// + `payment_success` -// #### Unsuccessful creation -// Scenario: If card can’t be charged, and no `next_billing_at` provided -// + signup_failure -// #### Webhooks fired when next_billing_at is reached: -// + `renewal_success or renewal_failure` -// + `payment_success or payment_failure` -// ### Date and Time Formats -// We will attempt to parse any string you send as the value of next_billing_at in to a date or time. For best results, use a known format like described in “Date and Time Specification” of RFC 2822 or ISO 8601 . -// The following are all equivalent and will work as input to `next_billing_at`: -// ``` -// Aug 06 2030 11:34:00 -0400 -// Aug 06 2030 11:34 -0400 -// 2030-08-06T11:34:00-04:00 -// 8/6/2030 11:34:00 EDT -// 8/6/2030 8:34:00 PDT -// 2030-08-06T15:34:00Z -// ``` -// You may also pass just a date, in which case we will assume the time to be noon -// ``` -// 2010-08-06 -// ``` -// ## Subscription Hierarchies & WhoPays -// When subscription groups were first added to our Relationship Invoicing architecture, to group together invoices for related subscriptions and allow for complex customer hierarchies and WhoPays scenarios, they were designed to consist of a primary and a collection of group members. The primary would control many aspects of the group, such as when the consolidated invoice is generated. As of today, groups still function this way. -// In the future, the concept of a "primary" will be removed in order to offer more flexibility into group management and reduce confusion concerning what actions must be done on a primary level, rather than a member level. -// We have introduced a two scheme system as a bridge between these two group organizations. Scheme 1, which is relevant to all subscription groups today, marks the group as being "ruled" by a primary. -// When reading a subscription via API, they will return a top-level attribute called `group`, which will denote which scheme is being used. At this time, the `scheme` attribute will always be 1. -// ### Subscription in a Customer Hierarchy -// For sites making use of the [Relationship Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices) and [Customer Hierarchy](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404900384141) features, it is possible to create subscriptions within a customer hierarchy. This can be achieved through the API by passing group parameters in the **Create Subscription** request. -// + The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. -// When the `target` parameter specifies a customer that is already part of a hierarchy, the new subscription will become a member of the customer hierarchy as well. If the target customer is not part of a hierarchy, a new customer hierarchy will be created and both the target customer and the new subscription will become part of the hierarchy with the specified target customer set as the responsible payer for the hierarchy's subscriptions. -// Rather than specifying a customer, the `target` parameter could instead simply have a value of `self` which indicates the subscription will be paid for not by some other customer, but by the subscribing customer. This will be true whether the customer is being created new, is already part of a hierarchy, or already exists outside a hierarchy. A valid payment method must also be specified in the subscription parameters. -// Note that when creating subscriptions in a customer hierarchy, if the customer hierarchy does not already have a payment method, passing valid credit card attributes in the subscription parameters will also result in the payment method being established as the default payment method for the customer hierarchy irrespective of the responsible payer. -// The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the default subscription group in the customer hierarchy. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the default subscription group in the customer hierarchy also. -// ### Subscription in a Subscription Group -// For sites making use of [Relationship Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices) it may be desireable to create a subscription as part of a [subscription group](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577356173) in order to rely on [invoice consolidation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404980119949). This can be achieved through the API by passing group parameters in the Create Subscription request. The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. -// The `target` parameters specify an existing subscription with which the newly created subscription should be grouped. If the target subscription is already part of a group, the new subscription will become a member of the group as well. If the target subscription is not part of a group, a new group will be created and both the target and the new subscription will become part of the group with the target as the group's primary subscription. -// The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the target subscription. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the target subscription also. -// ## Providing Agreement Acceptance Params -// It is possible to provide a proof of customer's acceptance of terms and policies. -// We will be storing this proof in case it might be required (i.e. chargeback). -// Currently, we already keep it for subscriptions created via Public Signup Pages. -// In order to create a subscription with the proof of agreement acceptance, you must provide additional parameters `agreement acceptance` with `ip_address` and at least one url to the policy that was accepted: `terms_url` or `privacy_policy_url`. Additional urls that can be provided: `return_refund_policy_url`, `delivery_policy_url` and -// `secure_checkout_policy_url`. -// ```json -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "agreement_acceptance": { -// "ip_address": "1.2.3.4", -// "terms_url": "https://terms.url", -// "privacy_policy_url": "https://privacy_policy.url", -// "return_refund_policy_url": "https://return_refund_policy.url", -// "delivery_policy_url": "https://delivery_policy.url", -// "secure_checkout_policy_url": "https://secure_checkout_policy.url" -// } -// } -// } -// ``` -// **For Maxio Payments subscriptions, the agreement acceptance params are required, with at least terms_url provided.** -// ## Providing ACH Agreement params -// It is also possible to provide a proof that a customer authorized ACH agreement terms. -// The proof will be stored and the email will be sent to the customer with a copy of the terms (if enabled). -// In order to create a subscription with the proof of authorized ACH agreement terms, you must provide the additional parameter `ach_agreement` with the following nested parameters: `agreement_terms`, `authorizer_first_name`, `authorizer_last_name` and `ip_address`. -// Each of them is required. -// ```json -// "subscription": { -// "product_handle": "gold-product", -// "customer_attributes": { -// "first_name": "Jane", -// "last_name": "Doe", -// "email": "jd@chargify.test" -// }, -// "bank_account_attributes": { -// "bank_name": "Test Bank", -// "bank_routing_number": "021000089", -// "bank_account_number": "111111111111", -// "bank_account_type": "checking", -// "bank_account_holder_type": "business", -// "payment_type": "bank_account" -// }, -// "ach_agreement": { -// "agreement_terms": "ACH agreement terms", -// "authorizer_first_name": "Jane", -// "authorizer_last_name": "Doe", -// "ip_address": "1.2.3.4" -// } -// } +// CreateSubscription takes context, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Full documentation on how subscriptions operate within Chargify can be located under the following topics: +// + [Subscriptions Reference](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577172749-Subscription-Introduction) +// + [Subscriptions Actions](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510556557-Actions) +// + [Subscription Cancellation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510556557-Actions#initiate-cancellation) +// + [Subscription Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021-Reactivating-and-Resuming) +// + [Subscription Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821-Imports) +// When creating a subscription, you must specify a product and a customer. Credit card details may be required, depending on the options for the Product being subscribed ([see Product Options](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221#payment-method-settings)). +// The product may be specified by `product_id` or by `product_handle` (API Handle). In similar fashion, to pass a particular product price point, you may either use `product_price_point_handle` or `product_price_point_id`. +// An existing customer may be specified by a `customer_id` (ID within Chargify) or a `customer_reference` (unique value within your app that you have shared with Chargify via the reference attribute on a customer). You may also pass in an existing payment profile for that customer with `payment_profile_id`. A new customer may be created by providing `customer_attributes`. +// Credit card details may be required, depending on the options for the product being subscribed. The product can be specified by `product_id` or by `product_handle` (API Handle). +// If you are creating a subscription with a payment profile, the attribute to send will be `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. +// ## Taxable Subscriptions +// If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405275711885-Avalara-VAT-Tax) or [Custom Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405069041549-Custom-Taxes), there are a few considerations to be made regarding collecting subscription data. +// For subscribers to be eligible to be taxed, the following information for the `customer` object or `payment_profile` object must by supplied: +// + A subscription to a [taxable product](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221-Product-Editing#tax-settings) +// + [Full valid billing or shipping address](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#full-address-required-for-taxable-subscriptions) to identify the tax locale +// + The portion of the address that houses the [state information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#required-state-format-for-taxable-subscriptions) of either adddress must adhere to the ISO standard of a 2-3 character limit/format. +// + The portion of the address that houses the [country information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405356114317#required-country-format-for-taxable-subscriptions) must adhere to the ISO standard of a 2 character limit/format. +// ## Subscription Request Examples +// The subscription examples below will be split into two sections. +// The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure `chargify_token` generated by Chargify.js. +// The second section, "Passing Payment Information", will focus on passing payment information into Chargify. Please be aware that collecting and sending Chargify raw card details requires PCI compliance on your end; these examples are provided as guidance. If your business is not PCI compliant, we recommend using Chargify.js to collect credit cards or bank accounts. +// # Subscription Customization +// ## With Components +// Different components require slightly different data. For example, quantity-based and on/off components accept `allocated_quantity`, while metered components accept `unit_balance`. +// When creating a subscription with a component, a `price_point_id` can be passed in along with the `component_id` to specify which price point to use. If not passed in, the default price point will be used. +// Note: if an invalid `price_point_id` is used, the subscription will still proceed but will use the component's default price point. +// Components and their price points may be added by ID or by handle. See the example request body labeled "Components By Handle (Quantity-Based)"; the format will be the same for other component types. +// ## With Coupon(s) +// Pass an array of `coupon_codes`. See the example request body "With Coupon". +// ## With Manual Invoice Collection +// The `invoice` collection method works only on legacy Statement Architecture. +// On Relationship Invoicing Architecture use the `remittance` collection method. +// ## Prepaid Subscription +// A prepaid subscription can be created with the usual subscription creation parameters, specifying `prepaid` as the `payment_collection_method` and including a nested `prepaid_configuration`. +// After a prepaid subscription has been created, additional funds can be manually added to the prepayment account through the [Create Prepayment Endpoint](https://developers.chargify.com/docs/api-docs/7ec482de77ba7-create-prepayment). +// Prepaid subscriptions do not work on legacy Statement Architecture. +// ## With Metafields +// Metafields can either attach to subscriptions or customers. Metafields are popuplated with the supplied metadata to the resource specified. +// If the metafield doesn't exist yet, it will be created on-the-fly. +// ## With Custom Pricing +// Custom pricing is pricing specific to the subscription in question. +// Create a subscription with custom pricing by passing pricing information instead of a price point. +// For a custom priced product, pass the custom_price object in place of `product_price_point_id`. For a custom priced component, pass the `custom_price` object within the component object. +// Custom prices and price points can exist in harmony on a subscription. +// # Passing Payment Information +// ## Subscription with Chargify.js token +// The `chargify_token` can be obtained using [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). The token represents payment profile attributes that were provided by the customer in their browser and stored at the payment gateway. +// The `payment_type` attribute may either be `credit_card` or `bank_account`, depending on the type of payment method being added. If a bank account is being passed, the payment attributes should be changed to `bank_account_attributes`. +// ```json +// { +// "subscription": { +// "product_handle": "pro-plan", +// "customer_attributes": { +// "first_name": "Joe", +// "last_name": "Smith", +// "email": "j.smith@example.com" +// }, +// "credit_card_attributes": { +// "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn", +// "payment_type": "credit_card" +// } +// } +// } +// ``` +// ## Subscription with vault token +// If you already have a customer and card stored in your payment gateway, you may create a subscription with a `vault_token`. Providing the last_four, card type and expiration date will allow the card to be displayed properly in the Chargify UI. +// ```json +// { +// "subscription": { +// "product_handle": "pro-plan", +// "customer_attributes": { +// "first_name": "Joe", +// "last_name": "Smith", +// "email": "j.smith@example.com" +// }, +// "credit_card_attributes": { +// first_name: "Joe, +// last_name: "Smith", +// card_type: "visa", +// expiration_month: "05", +// expiration_year: "2025", +// last_four: "1234", +// vault_token: "12345abc", +// current_vault: "braintree_blue" +// } +// } +// ``` +// ## Subscription with Credit Card +// ```json +// "subscription": { +// "product_handle": "basic", +// "customer_attributes": { +// "first_name": "Joe", +// "last_name": "Blow", +// "email": "joe@example.com", +// "zip": "02120", +// "state": "MA", +// "reference": "XYZ", +// "phone": "(617) 111 - 0000", +// "organization": "Acme", +// "country": "US", +// "city": "Boston", +// "address_2": null, +// "address": "123 Mass Ave." +// }, +// "credit_card_attributes": { +// "last_name": "Smith", +// "first_name": "Joe", +// "full_number": "4111111111111111", +// "expiration_year": "2021", +// "expiration_month": "1", +// "card_type": "visa", +// "billing_zip": "02120", +// "billing_state": "MA", +// "billing_country": "US", +// "billing_city": "Boston", +// "billing_address_2": null, +// "billing_address": "123 Mass Ave." +// } +// } +// ``` +// ## Subscription with ACH as Payment Profile +// ```json +// { +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Joe", +// "last_name": "Blow", +// "email": "joe@example.com", +// "zip": "02120", +// "state": "MA", +// "reference": "XYZ", +// "phone": "(617) 111 - 0000", +// "organization": "Acme", +// "country": "US", +// "city": "Boston", +// "address_2": null, +// "address": "123 Mass Ave." +// }, +// "bank_account_attributes": { +// "bank_name": "Best Bank", +// "bank_routing_number": "021000089", +// "bank_account_number": "111111111111", +// "bank_account_type": "checking", +// "bank_account_holder_type": "business", +// "payment_type": "bank_account" +// } +// } +// } +// ``` +// ## Subscription with PayPal payment profile +// ### With the nonce from Braintree JS +// ```json +// { "subscription": { +// "product_handle":"test-product-b", +// "customer_attributes": { +// "first_name":"Amelia", +// "last_name":"Johnson", +// "email":"amelia@example.com", +// "organization":"My Awesome Company" +// }, +// "payment_profile_attributes":{ +// "paypal_email": "amelia@example.com", +// "current_vault": "braintree_blue", +// "payment_method_nonce":"abc123", +// "payment_type":"paypal_account" +// } +// } +// ``` +// ### With the Braintree Customer ID as the vault token: +// ```json +// { "subscription": { +// "product_handle":"test-product-b", +// "customer_attributes": { +// "first_name":"Amelia", +// "last_name":"Johnson", +// "email":"amelia@example.com", +// "organization":"My Awesome Company" +// }, +// "payment_profile_attributes":{ +// "paypal_email": "amelia@example.com", +// "current_vault": "braintree_blue", +// "vault_token":"58271347", +// "payment_type":"paypal_account" +// } +// } +// ``` +// ## Subscription using GoCardless Bank Number +// These examples creates a customer, bank account and mandate in GoCardless. +// For more information on GoCardless, please view the following two resources: +// + [Payment Profiles via API for GoCardless](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#gocardless) +// + [Full documentation on GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404501889677) +// + [Using Chargify.js with GoCardless - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-direct-debit-gocardless-gateway) +// + [Using Chargify.js with GoCardless - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-direct-debit-gocardless-gateway) +// ```json +// { +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "bank_account_attributes": { +// "bank_name": "Royal Bank of France", +// "bank_account_number": "0000000", +// "bank_routing_number": "0003", +// "bank_branch_code": "00006", +// "payment_type": "bank_account", +// "billing_address": "20 Place de la Gare", +// "billing_city": "Colombes", +// "billing_state": "Île-de-France", +// "billing_zip": "92700", +// "billing_country": "FR" +// } +// } +// } +// ``` +// ## Subscription using GoCardless IBAN Number +// ```json +// { +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "bank_account_attributes": { +// "bank_name": "French Bank", +// "bank_iban": "FR1420041010050500013M02606", +// "payment_type": "bank_account", +// "billing_address": "20 Place de la Gare", +// "billing_city": "Colombes", +// "billing_state": "Île-de-France", +// "billing_zip": "92700", +// "billing_country": "FR" +// } +// } +// } +// ``` +// ## Subscription using Stripe SEPA Direct Debit +// For more information on Stripe Direct Debit, please view the following two resources: +// + [Payment Profiles via API for Stripe SEPA Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#sepa-direct-debit) +// + [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) +// + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) +// + [Using Chargify.js with Stripe SEPA Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) +// ```json +// { +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "bank_account_attributes": { +// "bank_name": "Test Bank", +// "bank_iban": "DE89370400440532013000", +// "payment_type": "bank_account" +// } +// } +// } +// ``` +// ## Subscription using Stripe BECS Direct Debit +// For more information on Stripe Direct Debit, please view the following two resources: +// + [Payment Profiles via API for Stripe BECS Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#stripe-becs-direct-debit) +// + [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) +// + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) +// + [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-becs-direct-debit-stripe-gateway) +// ```json +// { +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "bank_account_attributes": { +// "bank_name": "Test Bank", +// "bank_branch_code": "000000", +// "bank_account_number": "000123456", +// "payment_type": "bank_account" +// } +// } +// } +// ``` +// ## 3D Secure - Stripe +// It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +// ```json +// { +// "errors": [ +// "Your card was declined. This transaction requires 3D secure authentication." +// ], +// "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", +// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", +// "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" +// } +// ``` +// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. +// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: +// - whether the authentication was successful (`success`) +// - the gateway ID for the payment (`gateway_payment_id`) +// - the subscription ID (`subscription_id`) +// Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. +// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +// The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` +// ## 3D Secure - Checkout +// It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: +// ```json +// { +// "errors": [ +// "Your card was declined. This transaction requires 3D secure authentication." +// ], +// "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu", +// "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", +// "action_link": "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123" +// } +// ``` +// To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. +// Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: +// - whether the authentication was successful (`success`) +// - the gateway ID for the payment (`gateway_payment_id`) +// - the subscription ID (`subscription_id`) +// Lastly, you can also specify a `redirect_url` parameter within the `action_link` URL if you’d like to redirect a customer back to your site. +// It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +// The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_time_token_id=123&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` +// ### Example Redirect Flow +// You may wish to redirect customers to different pages depending on whether their SCA was performed successfully. Here's an example flow to use as a reference: +// 1. Create a subscription via API; it requires 3DS +// 2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. +// 3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id +// 4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to +// 5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied +// 6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. +// 7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known +// 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not +// ## Subscriptions Import +// Subscriptions can be “imported” via the API to handle the following scenarios: +// + You already have existing subscriptions with specific start and renewal dates that you would like to import to Chargify +// + You already have credit cards stored in your provider’s vault and you would like to create subscriptions using those tokens +// Before importing, you should have already set up your products to match your offerings. Then, you can create Subscriptions via the API just like you normally would, but using a few special attributes. +// Full documentation on how import Subscriptions using the **import tool** in the Chargify UI can be located [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#imports-0-0). +// ### Important Notices and Disclaimers regarding Imports +// Before performing a bulk import of subscriptions via the API, we suggest reading the [Subscriptions Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#important-notices-and-disclaimers) instructions to understand the repurcussions of a large import. +// ### Subscription Input Attributes +// The following _additional_ attributes to the subscription input attributes make imports possible: `next_billing_at`, `previous_billing_at`, and `import_mrr`. +// ### Current Vault +// If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe (Legacy)" then please contact Support for further instructions on subscription imports. +// ### Braintree Blue (Braintree v2) Imports +// Braintree Blue is Braintree’s newer (version 2) API. For this gateway, please provide the `vault_token` parameter with the value from Braintree’s “Customer ID” rather than the “Payment Profile Token”. At this time we do not use `current_vault_token` with the Braintree Blue gateway, and we only support a single payment profile per Braintree Customer. +// When importing PayPal type payment profiles, please set `payment_type` to `paypal_account`. +// ### Stripe ACH Imports +// If the bank account has already been verified, currently you will need to create the customer, create the payment profile in Chargify - setting verified=true, then create a subscription using the customer_id and payment_profile_id. +// ### Webhooks During Import +// If no `next_billing_at` is provided, webhooks will be fired as normal. If you do set a future `next_billing_at`, only a subset of the webhooks are fired when the subscription is created. Keep reading for more information as to what webhooks will be fired under which scenarios. +// #### Successful creation with Billing Date +// Scenario: If `next_billing_at` provided +// + `signup_success` +// + `billing_date_change` +// #### Successful creation without Billing Date +// Scenario: If no `next_billing_at` provided +// + `signup_success` +// + `payment_success` +// #### Unsuccessful creation +// Scenario: If card can’t be charged, and no `next_billing_at` provided +// + signup_failure +// #### Webhooks fired when next_billing_at is reached: +// + `renewal_success or renewal_failure` +// + `payment_success or payment_failure` +// ### Date and Time Formats +// We will attempt to parse any string you send as the value of next_billing_at in to a date or time. For best results, use a known format like described in “Date and Time Specification” of RFC 2822 or ISO 8601 . +// The following are all equivalent and will work as input to `next_billing_at`: +// ``` +// Aug 06 2030 11:34:00 -0400 +// Aug 06 2030 11:34 -0400 +// 2030-08-06T11:34:00-04:00 +// 8/6/2030 11:34:00 EDT +// 8/6/2030 8:34:00 PDT +// 2030-08-06T15:34:00Z +// ``` +// You may also pass just a date, in which case we will assume the time to be noon +// ``` +// 2010-08-06 +// ``` +// ## Subscription Hierarchies & WhoPays +// When subscription groups were first added to our Relationship Invoicing architecture, to group together invoices for related subscriptions and allow for complex customer hierarchies and WhoPays scenarios, they were designed to consist of a primary and a collection of group members. The primary would control many aspects of the group, such as when the consolidated invoice is generated. As of today, groups still function this way. +// In the future, the concept of a "primary" will be removed in order to offer more flexibility into group management and reduce confusion concerning what actions must be done on a primary level, rather than a member level. +// We have introduced a two scheme system as a bridge between these two group organizations. Scheme 1, which is relevant to all subscription groups today, marks the group as being "ruled" by a primary. +// When reading a subscription via API, they will return a top-level attribute called `group`, which will denote which scheme is being used. At this time, the `scheme` attribute will always be 1. +// ### Subscription in a Customer Hierarchy +// For sites making use of the [Relationship Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices) and [Customer Hierarchy](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404900384141) features, it is possible to create subscriptions within a customer hierarchy. This can be achieved through the API by passing group parameters in the **Create Subscription** request. +// + The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. +// When the `target` parameter specifies a customer that is already part of a hierarchy, the new subscription will become a member of the customer hierarchy as well. If the target customer is not part of a hierarchy, a new customer hierarchy will be created and both the target customer and the new subscription will become part of the hierarchy with the specified target customer set as the responsible payer for the hierarchy's subscriptions. +// Rather than specifying a customer, the `target` parameter could instead simply have a value of `self` which indicates the subscription will be paid for not by some other customer, but by the subscribing customer. This will be true whether the customer is being created new, is already part of a hierarchy, or already exists outside a hierarchy. A valid payment method must also be specified in the subscription parameters. +// Note that when creating subscriptions in a customer hierarchy, if the customer hierarchy does not already have a payment method, passing valid credit card attributes in the subscription parameters will also result in the payment method being established as the default payment method for the customer hierarchy irrespective of the responsible payer. +// The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the default subscription group in the customer hierarchy. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the default subscription group in the customer hierarchy also. +// ### Subscription in a Subscription Group +// For sites making use of [Relationship Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices) it may be desireable to create a subscription as part of a [subscription group](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577356173) in order to rely on [invoice consolidation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404980119949). This can be achieved through the API by passing group parameters in the Create Subscription request. The `group` parameters are optional and consist of the required `target` and optional `billing` parameters. +// The `target` parameters specify an existing subscription with which the newly created subscription should be grouped. If the target subscription is already part of a group, the new subscription will become a member of the group as well. If the target subscription is not part of a group, a new group will be created and both the target and the new subscription will become part of the group with the target as the group's primary subscription. +// The optional `billing` parameters specify how some aspects of the billing for the new subscription should be handled. Rather than capturing payment immediately, the `accrue` parameter can be included so that the new subscription charges accrue until the next assessment date. Regarding the date, the `align_date` parameter can be included so that the billing date of the new subscription matches up with the target subscription. When choosing to align the dates, the `prorate` parameter can also be specified so that the new subscription charges are prorated based on the billing period of the target subscription also. +// ## Providing Agreement Acceptance Params +// It is possible to provide a proof of customer's acceptance of terms and policies. +// We will be storing this proof in case it might be required (i.e. chargeback). +// Currently, we already keep it for subscriptions created via Public Signup Pages. +// In order to create a subscription with the proof of agreement acceptance, you must provide additional parameters `agreement acceptance` with `ip_address` and at least one url to the policy that was accepted: `terms_url` or `privacy_policy_url`. Additional urls that can be provided: `return_refund_policy_url`, `delivery_policy_url` and +// `secure_checkout_policy_url`. +// ```json +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "agreement_acceptance": { +// "ip_address": "1.2.3.4", +// "terms_url": "https://terms.url", +// "privacy_policy_url": "https://privacy_policy.url", +// "return_refund_policy_url": "https://return_refund_policy.url", +// "delivery_policy_url": "https://delivery_policy.url", +// "secure_checkout_policy_url": "https://secure_checkout_policy.url" +// } +// } +// } +// ``` +// **For Maxio Payments subscriptions, the agreement acceptance params are required, with at least terms_url provided.** +// ## Providing ACH Agreement params +// It is also possible to provide a proof that a customer authorized ACH agreement terms. +// The proof will be stored and the email will be sent to the customer with a copy of the terms (if enabled). +// In order to create a subscription with the proof of authorized ACH agreement terms, you must provide the additional parameter `ach_agreement` with the following nested parameters: `agreement_terms`, `authorizer_first_name`, `authorizer_last_name` and `ip_address`. +// Each of them is required. +// ```json +// "subscription": { +// "product_handle": "gold-product", +// "customer_attributes": { +// "first_name": "Jane", +// "last_name": "Doe", +// "email": "jd@chargify.test" +// }, +// "bank_account_attributes": { +// "bank_name": "Test Bank", +// "bank_routing_number": "021000089", +// "bank_account_number": "111111111111", +// "bank_account_type": "checking", +// "bank_account_holder_type": "business", +// "payment_type": "bank_account" +// }, +// "ach_agreement": { +// "agreement_terms": "ACH agreement terms", +// "authorizer_first_name": "Jane", +// "authorizer_last_name": "Doe", +// "ip_address": "1.2.3.4" +// } +// } // ``` func (s *SubscriptionsController) CreateSubscription( - ctx context.Context, - body *models.CreateSubscriptionRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest(ctx, "POST", "/subscriptions.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateSubscriptionRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest(ctx, "POST", "/subscriptions.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListSubscriptions takes context, page, perPage, state, product, productPricePointId, coupon, dateField, startDate, endDate, startDatetime, endDatetime, metadata, direction, sort, include as parameters and -// returns an models.ApiResponse with []models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// This method will return an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. -// ## 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. -// ## Self-Service Page token +// ListSubscriptions takes context, page, perPage, state, product, productPricePointId, coupon, dateField, startDate, endDate, startDatetime, endDatetime, metadata, direction, sort, include as parameters and +// returns an models.ApiResponse with []models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// This method will return an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +// ## 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. +// ## Self-Service Page token // Self-Service Page token for the subscriptions is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. func (s *SubscriptionsController) ListSubscriptions( - ctx context.Context, - page *int, - perPage *int, - state *models.SubscriptionStateFilter, - product *int, - productPricePointId *int, - coupon *int, - dateField *models.SubscriptionDateField, - startDate *time.Time, - endDate *time.Time, - startDatetime *time.Time, - endDatetime *time.Time, - metadata map[string]string, - direction *models.SortingDirection, - sort *models.SubscriptionSort, - include []models.SubscriptionListInclude) ( - models.ApiResponse[[]models.SubscriptionResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/subscriptions.json") - req.Authenticate(true) - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if state != nil { - req.QueryParam("state", *state) - } - if product != nil { - req.QueryParam("product", *product) - } - if productPricePointId != nil { - req.QueryParam("product_price_point_id", *productPricePointId) - } - if coupon != nil { - req.QueryParam("coupon", *coupon) - } - if dateField != nil { - req.QueryParam("date_field", *dateField) - } - if startDate != nil { - req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) - } - if endDate != nil { - req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) - } - if startDatetime != nil { - req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) - } - if endDatetime != nil { - req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) - } - if metadata != nil { - req.QueryParam("metadata", metadata) - } - if direction != nil { - req.QueryParam("direction", *direction) - } - if sort != nil { - req.QueryParam("sort", *sort) - } - if include != nil { - req.QueryParam("include[]", include) - } - var result []models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + page *int, + perPage *int, + state *models.SubscriptionStateFilter, + product *int, + productPricePointId *int, + coupon *int, + dateField *models.SubscriptionDateField, + startDate *time.Time, + endDate *time.Time, + startDatetime *time.Time, + endDatetime *time.Time, + metadata map[string]string, + direction *models.SortingDirection, + sort *models.SubscriptionSort, + include []models.SubscriptionListInclude) ( + models.ApiResponse[[]models.SubscriptionResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/subscriptions.json") + req.Authenticate(true) + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if state != nil { + req.QueryParam("state", *state) + } + if product != nil { + req.QueryParam("product", *product) + } + if productPricePointId != nil { + req.QueryParam("product_price_point_id", *productPricePointId) + } + if coupon != nil { + req.QueryParam("coupon", *coupon) + } + if dateField != nil { + req.QueryParam("date_field", *dateField) + } + if startDate != nil { + req.QueryParam("start_date", startDate.Format(models.DEFAULT_DATE)) + } + if endDate != nil { + req.QueryParam("end_date", endDate.Format(models.DEFAULT_DATE)) + } + if startDatetime != nil { + req.QueryParam("start_datetime", startDatetime.Format(time.RFC3339)) + } + if endDatetime != nil { + req.QueryParam("end_datetime", endDatetime.Format(time.RFC3339)) + } + if metadata != nil { + req.QueryParam("metadata", metadata) + } + if direction != nil { + req.QueryParam("direction", *direction) + } + if sort != nil { + req.QueryParam("sort", *sort) + } + if include != nil { + req.QueryParam("include[]", include) + } + var result []models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// The subscription endpoint allows you to instantly update one or many attributes about a subscription in a single call. -// ## Update Subscription Payment Method -// Change the card that your Subscriber uses for their subscription. You can also use this method to simply change the expiration date of the card **if your gateway allows**. -// Note that partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing Payment Profile must be directly updated instead. -// You also use this method to change the subscription to a different product by setting a new value for product_handle. A product change can be done in two different ways, **product change** or **delayed product change**. -// ## Product Change -// This endpoint may be used to change a subscription's product. The new payment amount is calculated and charged at the normal start of the next period. If you desire complex product changes or prorated upgrades and downgrades instead, please see the documentation on Migrating Subscription Products. -// To perform a product change, simply set either the `product_handle` or `product_id` attribute to that of a different product from the same site as the subscription. You can also change the price point by passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the new product's default price point will be used. -// ### Delayed Product Change -// This method also changes the product and/or price point, and the new payment amount is calculated and charged at the normal start of the next period. -// This method schedules the product change to happen automatically at the subscription’s next renewal date. To perform a Delayed Product Change, set the `product_handle` attribute as you would in a regular product change, but also set the `product_change_delayed` attribute to `true`. No proration applies in this case. -// You can also perform a delayed change to the price point by passing in either `product_price_point_id` or `product_price_point_handle` -// **Note: To cancel a delayed product change, set `next_product_id` to an empty string.** -// ## Billing Date Changes -// ### Regular Billing Date Changes -// Send the `next_billing_at` to set the next billing date for the subscription. After that date passes and the subscription is processed, the following billing date will be set according to the subscription's product period. -// Note that if you pass an invalid date, we will automatically interpret and set the correct date. For example, when February 30 is entered, the next billing will be set to March 2nd in a non-leap year. -// The server response will not return data under the key/value pair of `next_billing`. Please view the key/value pair of `current_period_ends_at` to verify that the `next_billing` date has been changed successfully. -// ### Snap Day Changes -// 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**. +// UpdateSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// The subscription endpoint allows you to instantly update one or many attributes about a subscription in a single call. +// ## Update Subscription Payment Method +// Change the card that your Subscriber uses for their subscription. You can also use this method to simply change the expiration date of the card **if your gateway allows**. +// Note that partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing Payment Profile must be directly updated instead. +// You also use this method to change the subscription to a different product by setting a new value for product_handle. A product change can be done in two different ways, **product change** or **delayed product change**. +// ## Product Change +// This endpoint may be used to change a subscription's product. The new payment amount is calculated and charged at the normal start of the next period. If you desire complex product changes or prorated upgrades and downgrades instead, please see the documentation on Migrating Subscription Products. +// To perform a product change, simply set either the `product_handle` or `product_id` attribute to that of a different product from the same site as the subscription. You can also change the price point by passing in either `product_price_point_id` or `product_price_point_handle` - otherwise the new product's default price point will be used. +// ### Delayed Product Change +// This method also changes the product and/or price point, and the new payment amount is calculated and charged at the normal start of the next period. +// This method schedules the product change to happen automatically at the subscription’s next renewal date. To perform a Delayed Product Change, set the `product_handle` attribute as you would in a regular product change, but also set the `product_change_delayed` attribute to `true`. No proration applies in this case. +// You can also perform a delayed change to the price point by passing in either `product_price_point_id` or `product_price_point_handle` +// **Note: To cancel a delayed product change, set `next_product_id` to an empty string.** +// ## Billing Date Changes +// ### Regular Billing Date Changes +// Send the `next_billing_at` to set the next billing date for the subscription. After that date passes and the subscription is processed, the following billing date will be set according to the subscription's product period. +// Note that if you pass an invalid date, we will automatically interpret and set the correct date. For example, when February 30 is entered, the next billing will be set to March 2nd in a non-leap year. +// The server response will not return data under the key/value pair of `next_billing`. Please view the key/value pair of `current_period_ends_at` to verify that the `next_billing` date has been changed successfully. +// ### Snap Day Changes +// 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_date` and immediately `READ/GET` the subscription data, it will still contain evidence of the existing `snap_date`. This is due to the fact that a product change is instantanous and only affects the product associated with a subscription. After the `next_billing` date arrives, the `snap_day` associated with the subscription will return to `null.` Another way of looking at this is that you willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. func (s *SubscriptionsController) UpdateSubscription( - ctx context.Context, - subscriptionId int, - body *models.UpdateSubscriptionRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.UpdateSubscriptionRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ReadSubscription takes context, subscriptionId, include as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Use this endpoint to find subscription details. -// ## Self-Service Page token +// ReadSubscription takes context, subscriptionId, include as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Use this endpoint to find subscription details. +// ## 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. func (s *SubscriptionsController) ReadSubscription( - ctx context.Context, - subscriptionId int, - include []models.SubscriptionInclude) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "GET", - fmt.Sprintf("/subscriptions/%v.json", subscriptionId), - ) - req.Authenticate(true) - if include != nil { - req.QueryParam("include[]", include) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + include []models.SubscriptionInclude) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "GET", + fmt.Sprintf("/subscriptions/%v.json", subscriptionId), + ) + req.Authenticate(true) + if include != nil { + req.QueryParam("include[]", include) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// OverrideSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// This API endpoint allows you to set certain subscription fields that are usually managed for you automatically. Some of the fields can be set via the normal Subscriptions Update API, but others can only be set using this endpoint. -// This endpoint is provided for cases where you need to “align” Chargify data with data that happened in your system, perhaps before you started using Chargify. For example, you may choose to import your historical subscription data, and would like the activation and cancellation dates in Chargify to match your existing historical dates. Chargify does not backfill historical events (i.e. from the Events API), but some static data can be changed via this API. -// Why are some fields only settable from this endpoint, and not the normal subscription create and update endpoints? Because we want users of this endpoint to be aware that these fields are usually managed by Chargify, and using this API means **you are stepping out on your own.** -// Changing these fields will not affect any other attributes. For example, adding an expiration date will not affect the next assessment date on the subscription. -// If you regularly need to override the current_period_starts_at for new subscriptions, this can also be accomplished by setting both `previous_billing_at` and `next_billing_at` at subscription creation. See the documentation on [Importing Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-import) for more information. -// ## Limitations -// When passing `current_period_starts_at` some validations are made: -// 1. The subscription needs to be unbilled (no statements or invoices). -// 2. The value passed must be a valid date/time. We recommend using the iso 8601 format. -// 3. The value passed must be before the current date/time. +// OverrideSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// This API endpoint allows you to set certain subscription fields that are usually managed for you automatically. Some of the fields can be set via the normal Subscriptions Update API, but others can only be set using this endpoint. +// This endpoint is provided for cases where you need to “align” Chargify data with data that happened in your system, perhaps before you started using Chargify. For example, you may choose to import your historical subscription data, and would like the activation and cancellation dates in Chargify to match your existing historical dates. Chargify does not backfill historical events (i.e. from the Events API), but some static data can be changed via this API. +// Why are some fields only settable from this endpoint, and not the normal subscription create and update endpoints? Because we want users of this endpoint to be aware that these fields are usually managed by Chargify, and using this API means **you are stepping out on your own.** +// Changing these fields will not affect any other attributes. For example, adding an expiration date will not affect the next assessment date on the subscription. +// If you regularly need to override the current_period_starts_at for new subscriptions, this can also be accomplished by setting both `previous_billing_at` and `next_billing_at` at subscription creation. See the documentation on [Importing Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-import) for more information. +// ## Limitations +// When passing `current_period_starts_at` some validations are made: +// 1. The subscription needs to be unbilled (no statements or invoices). +// 2. The value passed must be a valid date/time. We recommend using the iso 8601 format. +// 3. The value passed must be before the current date/time. // If unpermitted parameters are sent, a 400 HTTP response is sent along with a string giving the reason for the problem. func (s *SubscriptionsController) OverrideSubscription( - ctx context.Context, - subscriptionId int, - body *models.OverrideSubscriptionRequest) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/override.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - if context.Response.StatusCode == 422 { - err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") - } - return context.Response, err + ctx context.Context, + subscriptionId int, + body *models.OverrideSubscriptionRequest) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/override.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + if context.Response.StatusCode == 422 { + err = errors.NewSingleErrorResponse(422, "Unprocessable Entity (WebDAV)") + } + return context.Response, err } -// ReadSubscriptionByReference takes context, reference as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. +// FindSubscription takes context, reference as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to find a subscription by its reference. -func (s *SubscriptionsController) ReadSubscriptionByReference( - ctx context.Context, - reference *string) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest(ctx, "GET", "/subscriptions/lookup.json") - req.Authenticate(true) - if reference != nil { - req.QueryParam("reference", *reference) - } - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (s *SubscriptionsController) FindSubscription( + ctx context.Context, + reference *string) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest(ctx, "GET", "/subscriptions/lookup.json") + req.Authenticate(true) + if reference != nil { + req.QueryParam("reference", *reference) + } + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// PurgeSubscription takes context, subscriptionId, ack, cascade as parameters and -// returns an models.ApiResponse with data and -// an error if there was an issue with the request or response. -// For sites in test mode, you may purge individual subscriptions. -// 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, please contact support to discuss your use case. -// ### Delete customer and payment profile +// PurgeSubscription takes context, subscriptionId, ack, cascade as parameters and +// returns an models.ApiResponse with data and +// an error if there was an issue with the request or response. +// For sites in test mode, you may purge individual subscriptions. +// 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, please contact support to discuss your use case. +// ### Delete customer and payment profile // The query params will be: `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile` func (s *SubscriptionsController) PurgeSubscription( - ctx context.Context, - subscriptionId int, - ack int, - cascade []models.SubscriptionPurgeType) ( - *http.Response, - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/purge.json", subscriptionId), - ) - req.Authenticate(true) - req.QueryParam("ack", ack) - if cascade != nil { - req.QueryParam("cascade[]", cascade) - } - - context, err := req.Call() - if err != nil { - return context.Response, err - } - err = validateResponse(*context.Response) - if err != nil { - return context.Response, err - } - return context.Response, err + ctx context.Context, + subscriptionId int, + ack int, + cascade []models.SubscriptionPurgeType) ( + *http.Response, + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/purge.json", subscriptionId), + ) + req.Authenticate(true) + req.QueryParam("ack", ack) + if cascade != nil { + req.QueryParam("cascade[]", cascade) + } + + context, err := req.Call() + if err != nil { + return context.Response, err + } + err = validateResponse(*context.Response) + if err != nil { + return context.Response, err + } + return context.Response, err } -// CreatePrepaidSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.PrepaidConfigurationResponse data and -// an error if there was an issue with the request or response. +// UpdatePrepaidSubscriptionConfiguration takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.PrepaidConfigurationResponse data and +// an error if there was an issue with the request or response. // Use this endpoint to update a subscription's prepaid configuration. -func (s *SubscriptionsController) CreatePrepaidSubscription( - ctx context.Context, - subscriptionId int, - body *models.UpsertPrepaidConfigurationRequest) ( - models.ApiResponse[models.PrepaidConfigurationResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/prepaid_configurations.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.PrepaidConfigurationResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.PrepaidConfigurationResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err +func (s *SubscriptionsController) UpdatePrepaidSubscriptionConfiguration( + ctx context.Context, + subscriptionId int, + body *models.UpsertPrepaidConfigurationRequest) ( + models.ApiResponse[models.PrepaidConfigurationResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/prepaid_configurations.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.PrepaidConfigurationResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.PrepaidConfigurationResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// PreviewSubscription takes context, body as parameters and -// returns an models.ApiResponse with models.SubscriptionPreviewResponse data and -// an error if there was an issue with the request or response. -// The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. -// The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For more information, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). -// ## Side effects -// A subscription will not be created by sending a POST to this endpoint. It is meant to serve as a prediction. -// ## Taxable Subscriptions -// This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: -// + 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, please see our documentation guide on how to create [taxable subscriptions.](https://chargify.zendesk.com/hc/en-us/articles/4407904217755#creating-taxable-subscriptions) -// You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, please note that 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 Chargify. 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 Chargify 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 +// PreviewSubscription takes context, body as parameters and +// returns an models.ApiResponse with models.SubscriptionPreviewResponse data and +// an error if there was an issue with the request or response. +// The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. +// The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For more information, please see our documentation [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-billing). +// ## Side effects +// A subscription will not be created by sending a POST to this endpoint. It is meant to serve as a prediction. +// ## Taxable Subscriptions +// This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: +// + 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, please see our documentation guide on how to create [taxable subscriptions.](https://chargify.zendesk.com/hc/en-us/articles/4407904217755#creating-taxable-subscriptions) +// You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, please note that 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 Chargify. 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 Chargify 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, please feel free to leave off the billing information. func (s *SubscriptionsController) PreviewSubscription( - ctx context.Context, - body *models.CreateSubscriptionRequest) ( - models.ApiResponse[models.SubscriptionPreviewResponse], - error) { - req := s.prepareRequest(ctx, "POST", "/subscriptions/preview.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.SubscriptionPreviewResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionPreviewResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.CreateSubscriptionRequest) ( + models.ApiResponse[models.SubscriptionPreviewResponse], + error) { + req := s.prepareRequest(ctx, "POST", "/subscriptions/preview.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.SubscriptionPreviewResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionPreviewResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ApplyCouponToSubscription takes context, subscriptionId, code, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// An existing subscription can accommodate multiple discounts/coupon codes. This is only applicable if each coupon is stackable. For more information on stackable coupons, we recommend reviewing our [coupon documentation.](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#stackable-coupons) -// ## Query Parameters vs Request Body Parameters -// Passing in a coupon code as a query parameter will add the code to the subscription, completely replacing all existing coupon codes on the subscription. +// ApplyCouponsToSubscription takes context, subscriptionId, code, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// An existing subscription can accommodate multiple discounts/coupon codes. This is only applicable if each coupon is stackable. For more information on stackable coupons, we recommend reviewing our [coupon documentation.](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#stackable-coupons) +// ## Query Parameters vs Request Body Parameters +// Passing in a coupon code as a query parameter will add the code to the subscription, completely replacing all existing coupon codes on the subscription. // For this reason, using this query parameter on this endpoint has been deprecated in favor of using the request body parameters as described below. When passing in request body parameters, the list of coupon codes will simply be added to any existing list of codes on the subscription. -func (s *SubscriptionsController) ApplyCouponToSubscription( - ctx context.Context, - subscriptionId int, - code *string, - body *models.AddCouponsRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "POST", - fmt.Sprintf("/subscriptions/%v/add_coupon.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if code != nil { - req.QueryParam("code", *code) - } - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewSubscriptionAddCouponError(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err +func (s *SubscriptionsController) ApplyCouponsToSubscription( + ctx context.Context, + subscriptionId int, + code *string, + body *models.AddCouponsRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "POST", + fmt.Sprintf("/subscriptions/%v/add_coupon.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if code != nil { + req.QueryParam("code", *code) + } + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewSubscriptionAddCouponError(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// DeleteCouponFromSubscription takes context, subscriptionId, couponCode as parameters and -// returns an models.ApiResponse with string data and -// an error if there was an issue with the request or response. -// Use this endpoint to remove a coupon from an existing subscription. +// RemoveCouponFromSubscription takes context, subscriptionId, couponCode as parameters and +// returns an models.ApiResponse with string data and +// an error if there was an issue with the request or response. +// Use this endpoint to remove a coupon from an existing subscription. // For more information on the expected behaviour of removing a coupon from a subscription, please see our documentation [here.](https://chargify.zendesk.com/hc/en-us/articles/4407896488987#removing-a-coupon) -func (s *SubscriptionsController) DeleteCouponFromSubscription( - ctx context.Context, - subscriptionId int, - couponCode *string) ( - models.ApiResponse[string], - error) { - req := s.prepareRequest( - ctx, - "DELETE", - fmt.Sprintf("/subscriptions/%v/remove_coupon.json", subscriptionId), - ) - req.Authenticate(true) - if couponCode != nil { - req.QueryParam("coupon_code", *couponCode) - } - - str, resp, err := req.CallAsText() - var result string = str +func (s *SubscriptionsController) RemoveCouponFromSubscription( + ctx context.Context, + subscriptionId int, + couponCode *string) ( + models.ApiResponse[string], + error) { + req := s.prepareRequest( + ctx, + "DELETE", + fmt.Sprintf("/subscriptions/%v/remove_coupon.json", subscriptionId), + ) + req.Authenticate(true) + if couponCode != nil { + req.QueryParam("coupon_code", *couponCode) + } + + str, resp, err := req.CallAsText() + var result string = str - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - if resp.StatusCode == 422 { - err = errors.NewSubscriptionRemoveCouponErrors(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + if resp.StatusCode == 422 { + err = errors.NewSubscriptionRemoveCouponErrors(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ActivateSubscription takes context, subscriptionId, body as parameters and -// returns an models.ApiResponse with models.SubscriptionResponse data and -// an error if there was an issue with the request or response. -// Chargify offers the ability to activate 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](#). -// The `revert_on_failure` parameter controls the behavior upon activation failure. -// - If set to `true` and something goes wrong i.e. payment fails, then Chargify 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 Chargify 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. -// The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. -// ## Activation Scenarios -// ### Activate Awaiting Signup subscription -// - Given you have a product without trial -// - Given you have a site without dunning strategy -// ```mermaid -// flowchart LR -// AS[Awaiting Signup] --> A{Activate} -// A -->|Success| Active -// A -->|Failure| ROF{revert_on_failure} -// ROF -->|true| AS -// ROF -->|false| Canceled -// ``` -// - Given you have a product with trial -// - Given you have a site with dunning strategy -// ```mermaid -// flowchart LR -// AS[Awaiting Signup] --> A{Activate} -// A -->|Success| Trialing -// A -->|Failure| ROF{revert_on_failure} -// ROF -->|true| AS -// ROF -->|false| PD[Past Due] -// ``` -// ### Activate Trialing subscription -// You can read more about the behavior of trialing subscriptions [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404494617357#trialing-subscriptions-0-0). +// ActivateSubscription takes context, subscriptionId, body as parameters and +// returns an models.ApiResponse with models.SubscriptionResponse data and +// an error if there was an issue with the request or response. +// Chargify offers the ability to activate 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](#). +// The `revert_on_failure` parameter controls the behavior upon activation failure. +// - If set to `true` and something goes wrong i.e. payment fails, then Chargify 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 Chargify 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. +// The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. +// ## Activation Scenarios +// ### Activate Awaiting Signup subscription +// - Given you have a product without trial +// - Given you have a site without dunning strategy +// ```mermaid +// flowchart LR +// AS[Awaiting Signup] --> A{Activate} +// A -->|Success| Active +// A -->|Failure| ROF{revert_on_failure} +// ROF -->|true| AS +// ROF -->|false| Canceled +// ``` +// - Given you have a product with trial +// - Given you have a site with dunning strategy +// ```mermaid +// flowchart LR +// AS[Awaiting Signup] --> A{Activate} +// A -->|Success| Trialing +// A -->|Failure| ROF{revert_on_failure} +// ROF -->|true| AS +// ROF -->|false| PD[Past Due] +// ``` +// ### Activate Trialing subscription +// You can read more about the behavior of trialing subscriptions [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404494617357#trialing-subscriptions-0-0). // 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. func (s *SubscriptionsController) ActivateSubscription( - ctx context.Context, - subscriptionId int, - body *models.ActivateSubscriptionRequest) ( - models.ApiResponse[models.SubscriptionResponse], - error) { - req := s.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/subscriptions/%v/activate.json", subscriptionId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.SubscriptionResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 400 { - err = errors.NewErrorArrayMapResponse(400, "Bad Request") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + subscriptionId int, + body *models.ActivateSubscriptionRequest) ( + models.ApiResponse[models.SubscriptionResponse], + error) { + req := s.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/subscriptions/%v/activate.json", subscriptionId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.SubscriptionResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.SubscriptionResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 400 { + err = errors.NewErrorArrayMapResponse(400, "Bad Request") + } + return models.NewApiResponse(result, resp), err } diff --git a/test/go.mod b/test/go.mod index 126b3282..3ee22133 100644 --- a/test/go.mod +++ b/test/go.mod @@ -3,7 +3,7 @@ module github.com/maxio-com/ab-golang-sdk/test go 1.21 require ( - github.com/apimatic/go-core-runtime v0.0.13 // indirect + github.com/apimatic/go-core-runtime v0.0.14 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/test/go.sum b/test/go.sum index 744496ff..ffd5d3a8 100644 --- a/test/go.sum +++ b/test/go.sum @@ -1,5 +1,5 @@ -github.com/apimatic/go-core-runtime v0.0.13 h1:KBrOoUbgdIYbjH+TrQNXkbK7QGBovdX43wr7q5Ta6yE= -github.com/apimatic/go-core-runtime v0.0.13/go.mod h1:kyqGg2v3OTV7o2fXHgbHLZPMinqZvIqw1JwdEd64OzM= +github.com/apimatic/go-core-runtime v0.0.14 h1:haZq9sk9Z7gWZjnMHnTBnKcasY53prmyiNHHqWbc3dM= +github.com/apimatic/go-core-runtime v0.0.14/go.mod h1:kyqGg2v3OTV7o2fXHgbHLZPMinqZvIqw1JwdEd64OzM= github.com/caarlos0/env/v10 v10.0.0 h1:yIHUBZGsyqCnpTkbjk8asUlx6RFhhEs+h7TOBdgdzXA= github.com/caarlos0/env/v10 v10.0.0/go.mod h1:ZfulV76NvVPw3tm591U4SwL3Xx9ldzBP9aGxzeN7G18= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/test/metafields_test.go b/test/metafields_test.go index 6ed40dee..b0b3661a 100644 --- a/test/metafields_test.go +++ b/test/metafields_test.go @@ -2,7 +2,6 @@ package test import ( "context" - "fmt" "net/http" "testing" @@ -42,9 +41,9 @@ func (s *MetafieldsSuite) TestMetafields() { dropdownFieldName := s.fkr.RandomStringWithLength(20) textFieldName := s.fkr.RandomStringWithLength(20) - dropdownInputType := "dropdown" - radioInputType := "radio" - textInputType := "text" + dropdownInputType := models.MetafieldInput_DROPDOWN + radioInputType := models.MetafieldInput_RADIO + textInputType := models.MetafieldInput_TEXT enums := []string{ "option 1", @@ -104,20 +103,20 @@ func (s *MetafieldsSuite) TestMetafields() { r, err := s.client.CustomFieldsController().CreateMetadata( ctx, models.ResourceType_SUBSCRIPTIONS, - fmt.Sprintf("%d", *subscription.Id), + *subscription.Id, &models.CreateMetadataRequest{ Metadata: metadata, }) s.NoError(err) s.Equal(http.StatusOK, r.Response.StatusCode) - s.Equal(subscription.Id, r.Data[0].ResourceId) + s.Equal(subscription.Id, r.Data[0].ResourceId.Value()) s.Len(r.Data, 2) s.Equal(metadata[0].Name, r.Data[0].Name) - s.Equal(*metadata[0].Value, *r.Data[0].Value) + s.Equal(*metadata[0].Value, *r.Data[0].Value.Value()) s.Equal(metadata[1].Name, r.Data[1].Name) - s.Equal(*metadata[1].Value, *r.Data[1].Value) + s.Equal(*metadata[1].Value, *r.Data[1].Value.Value()) rSubs, err := s.client.SubscriptionsController().ListSubscriptions( ctx, @@ -163,7 +162,7 @@ func (s *MetafieldsSuite) TestMetafields() { resourceType: models.ResourceType_CUSTOMERS, metafields: metafield{ Name: &radioFieldName, - InputType: &radioInputType, + InputType: strPtr("radio"), Enum: enums, Scope: &models.MetafieldScope{ Csv: toPtr[models.IncludeOption](models.IncludeOption_INCLUDE), @@ -186,7 +185,7 @@ func (s *MetafieldsSuite) TestMetafields() { customerResp, err := s.client.CustomFieldsController().CreateMetadata( ctx, models.ResourceType_CUSTOMERS, - fmt.Sprintf("%d", *customer.Id), + *customer.Id, &models.CreateMetadataRequest{ Metadata: []models.CreateMetadata{ { @@ -200,9 +199,9 @@ func (s *MetafieldsSuite) TestMetafields() { s.Equal(http.StatusOK, customerResp.Response.StatusCode) s.Len(customerResp.Data, 1) - s.Equal(customer.Id, customerResp.Data[0].ResourceId) + s.Equal(customer.Id, customerResp.Data[0].ResourceId.Value()) s.Equal(radioField.Name, customerResp.Data[0].Name) - s.Equal(enums[1], *customerResp.Data[0].Value) + s.Equal(enums[1], *customerResp.Data[0].Value.Value()) }, afterTest: func(t *testing.T, metafields []models.Metafield) { for _, metafield := range metafields { diff --git a/test/site_test.go b/test/site_test.go index e3789073..0d297ff2 100644 --- a/test/site_test.go +++ b/test/site_test.go @@ -43,7 +43,7 @@ func (s *SiteSuite) TestReadSite() { s.False(*respSite.CustomerHierarchyEnabled, "CustomerHierarchyEnabled,") s.False(*respSite.WhopaysEnabled, "WhopaysEnabled") s.Equal("self-ungrouped", *respSite.WhopaysDefaultPayer, "WhopaysDefaultPayer") - s.Equal(string(models.PaymentCollectionMethod_AUTOMATIC), *respSite.DefaultPaymentCollectionMethod, "DefaultPaymentCollectionMethod") + s.Equal(string(models.CollectionMethod_AUTOMATIC), *respSite.DefaultPaymentCollectionMethod, "DefaultPaymentCollectionMethod") allocationSettings := respSite.AllocationSettings s.Equal(models.CreditType_PRORATED, *allocationSettings.UpgradeCharge.Value(), "UpgradeCharge") diff --git a/test/subscription_test.go b/test/subscription_test.go index 1af89cf1..16a25695 100644 --- a/test/subscription_test.go +++ b/test/subscription_test.go @@ -160,10 +160,10 @@ func (s *APISuite) newSubscription( ) models.CreateSubscription { return models.CreateSubscription{ ProductId: product.Id, - PaymentCollectionMethod: toPtr[models.PaymentCollectionMethod](models.PaymentCollectionMethod_AUTOMATIC), + PaymentCollectionMethod: toPtr[models.CollectionMethod](models.CollectionMethod_AUTOMATIC), CustomerId: customer.Id, Currency: strPtr("USD"), - InitialBillingAt: strPtr("2029-08-29T12:00:00-04:00"), + InitialBillingAt: timePtr(time.Date(2029, 8, 29, 12, 0, 0, 0, time.UTC)), CouponCode: &couponCode, Components: components, PaymentProfileAttributes: &models.PaymentProfileAttributes{ diff --git a/test/suite.go b/test/suite.go index 8de3736f..695d7542 100644 --- a/test/suite.go +++ b/test/suite.go @@ -205,10 +205,10 @@ func (s *APISuite) generateSubscription( &models.CreateSubscriptionRequest{ Subscription: models.CreateSubscription{ ProductId: product.Id, - PaymentCollectionMethod: toPtr[models.PaymentCollectionMethod](models.PaymentCollectionMethod_AUTOMATIC), + PaymentCollectionMethod: toPtr[models.CollectionMethod](models.CollectionMethod_AUTOMATIC), CustomerId: customer.Id, Currency: strPtr("USD"), - InitialBillingAt: strPtr("2029-08-29T12:00:00-04:00"), + InitialBillingAt: timePtr(time.Date(2029, 8, 29, 12, 0, 0, 0, time.UTC)), CouponCode: &couponCode, Components: components, PaymentProfileAttributes: &models.PaymentProfileAttributes{ diff --git a/webhooks_controller.go b/webhooks_controller.go index 9423a5b7..a7b1609b 100644 --- a/webhooks_controller.go +++ b/webhooks_controller.go @@ -1,267 +1,267 @@ package advancedbilling import ( - "context" - "fmt" - "github.com/apimatic/go-core-runtime/utilities" - "github.com/maxio-com/ab-golang-sdk/errors" - "github.com/maxio-com/ab-golang-sdk/models" + "context" + "fmt" + "github.com/apimatic/go-core-runtime/utilities" + "github.com/maxio-com/ab-golang-sdk/errors" + "github.com/maxio-com/ab-golang-sdk/models" ) // WebhooksController represents a controller struct. type WebhooksController struct { - baseController + baseController } -// NewWebhooksController creates a new instance of WebhooksController. +// NewWebhooksController creates a new instance of WebhooksController. // It takes a baseController as a parameter and returns a pointer to the WebhooksController. func NewWebhooksController(baseController baseController) *WebhooksController { - webhooksController := WebhooksController{baseController: baseController} - return &webhooksController + webhooksController := WebhooksController{baseController: baseController} + return &webhooksController } -// ListWebhooks takes context, status, sinceDate, untilDate, page, perPage, order, subscription as parameters and -// returns an models.ApiResponse with []models.WebhookResponse data and -// an error if there was an issue with the request or response. -// ## Webhooks Intro -// The Webhooks API allows you to view a list of all webhooks and to selectively resend individual or groups of webhooks. Webhooks will be sent on endpoints specified by you. Endpoints can be added via API or Web UI. There is also an option to enable / disable webhooks via API request. -// We recommend that you review Chargify's webhook documentation located in our help site. The following resources will help guide you on how to use webhooks in Chargify, in addition to these webhook endpoints: -// + [Adding/editing new webhooks](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404448450317#configure-webhook-url) -// + [Webhooks introduction and delivery information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405568068365#webhooks-introduction-0-0) -// + [Main webhook overview](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#webhooks-reference-0-0) -// + [Available webhooks and payloads](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#events) -// ## List Webhooks for a Site +// ListWebhooks takes context, status, sinceDate, untilDate, page, perPage, order, subscription as parameters and +// returns an models.ApiResponse with []models.WebhookResponse data and +// an error if there was an issue with the request or response. +// ## Webhooks Intro +// The Webhooks API allows you to view a list of all webhooks and to selectively resend individual or groups of webhooks. Webhooks will be sent on endpoints specified by you. Endpoints can be added via API or Web UI. There is also an option to enable / disable webhooks via API request. +// We recommend that you review Chargify's webhook documentation located in our help site. The following resources will help guide you on how to use webhooks in Chargify, in addition to these webhook endpoints: +// + [Adding/editing new webhooks](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404448450317#configure-webhook-url) +// + [Webhooks introduction and delivery information](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405568068365#webhooks-introduction-0-0) +// + [Main webhook overview](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#webhooks-reference-0-0) +// + [Available webhooks and payloads](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#events) +// ## List Webhooks for a Site // This method allows you to fetch data about webhooks. You can pass query parameters if you want to filter webhooks. func (w *WebhooksController) ListWebhooks( - ctx context.Context, - status *models.WebhookStatus, - sinceDate *string, - untilDate *string, - page *int, - perPage *int, - order *models.WebhookOrder, - subscription *int) ( - models.ApiResponse[[]models.WebhookResponse], - error) { - req := w.prepareRequest(ctx, "GET", "/webhooks.json") - req.Authenticate(true) - if status != nil { - req.QueryParam("status", *status) - } - if sinceDate != nil { - req.QueryParam("since_date", *sinceDate) - } - if untilDate != nil { - req.QueryParam("until_date", *untilDate) - } - if page != nil { - req.QueryParam("page", *page) - } - if perPage != nil { - req.QueryParam("per_page", *perPage) - } - if order != nil { - req.QueryParam("order", *order) - } - if subscription != nil { - req.QueryParam("subscription", *subscription) - } - var result []models.WebhookResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.WebhookResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + status *models.WebhookStatus, + sinceDate *string, + untilDate *string, + page *int, + perPage *int, + order *models.WebhookOrder, + subscription *int) ( + models.ApiResponse[[]models.WebhookResponse], + error) { + req := w.prepareRequest(ctx, "GET", "/webhooks.json") + req.Authenticate(true) + if status != nil { + req.QueryParam("status", *status) + } + if sinceDate != nil { + req.QueryParam("since_date", *sinceDate) + } + if untilDate != nil { + req.QueryParam("until_date", *untilDate) + } + if page != nil { + req.QueryParam("page", *page) + } + if perPage != nil { + req.QueryParam("per_page", *perPage) + } + if order != nil { + req.QueryParam("order", *order) + } + if subscription != nil { + req.QueryParam("subscription", *subscription) + } + var result []models.WebhookResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.WebhookResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// EnableWebhooks takes context, body as parameters and -// returns an models.ApiResponse with models.EnableWebhooksResponse data and -// an error if there was an issue with the request or response. +// EnableWebhooks takes context, body as parameters and +// returns an models.ApiResponse with models.EnableWebhooksResponse data and +// an error if there was an issue with the request or response. // This method allows you to enable webhooks via API for your site func (w *WebhooksController) EnableWebhooks( - ctx context.Context, - body *models.EnableWebhooksRequest) ( - models.ApiResponse[models.EnableWebhooksResponse], - error) { - req := w.prepareRequest(ctx, "PUT", "/webhooks/settings.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.EnableWebhooksResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.EnableWebhooksResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.EnableWebhooksRequest) ( + models.ApiResponse[models.EnableWebhooksResponse], + error) { + req := w.prepareRequest(ctx, "PUT", "/webhooks/settings.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.EnableWebhooksResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.EnableWebhooksResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// ReplayWebhooks takes context, body as parameters and -// returns an models.ApiResponse with models.ReplayWebhooksResponse data and -// an error if there was an issue with the request or response. -// Posting to the replay endpoint does not immediately resend the webhooks. They are added to a queue and will be sent as soon as possible, depending on available system resources. +// ReplayWebhooks takes context, body as parameters and +// returns an models.ApiResponse with models.ReplayWebhooksResponse data and +// an error if there was an issue with the request or response. +// Posting to the replay endpoint does not immediately resend the webhooks. They are added to a queue and will be sent as soon as possible, depending on available system resources. // You may submit an array of up to 1000 webhook IDs to replay in the request. func (w *WebhooksController) ReplayWebhooks( - ctx context.Context, - body *models.ReplayWebhooksRequest) ( - models.ApiResponse[models.ReplayWebhooksResponse], - error) { - req := w.prepareRequest(ctx, "POST", "/webhooks/replay.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.ReplayWebhooksResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.ReplayWebhooksResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.ReplayWebhooksRequest) ( + models.ApiResponse[models.ReplayWebhooksResponse], + error) { + req := w.prepareRequest(ctx, "POST", "/webhooks/replay.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.ReplayWebhooksResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.ReplayWebhooksResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// CreateEndpoint takes context, body as parameters and -// returns an models.ApiResponse with models.EndpointResponse data and -// an error if there was an issue with the request or response. -// The Chargify API allows you to create an endpoint and assign a list of webhooks subscriptions (events) to it. -// You can check available events here. +// CreateEndpoint takes context, body as parameters and +// returns an models.ApiResponse with models.EndpointResponse data and +// an error if there was an issue with the request or response. +// The Chargify API allows you to create an endpoint and assign a list of webhooks subscriptions (events) to it. +// You can check available events here. // [Event keys](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405357509645-Webhooks-Reference#example-payloads) func (w *WebhooksController) CreateEndpoint( - ctx context.Context, - body *models.UpdateEndpointRequest) ( - models.ApiResponse[models.EndpointResponse], - error) { - req := w.prepareRequest(ctx, "POST", "/endpoints.json") - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - var result models.EndpointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.EndpointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + body *models.UpdateEndpointRequest) ( + models.ApiResponse[models.EndpointResponse], + error) { + req := w.prepareRequest(ctx, "POST", "/endpoints.json") + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + var result models.EndpointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.EndpointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err } -// ListEndpoints takes context as parameters and -// returns an models.ApiResponse with []models.Endpoint data and -// an error if there was an issue with the request or response. +// ListEndpoints takes context as parameters and +// returns an models.ApiResponse with []models.Endpoint data and +// an error if there was an issue with the request or response. // This method returns created endpoints for site. func (w *WebhooksController) ListEndpoints(ctx context.Context) ( - models.ApiResponse[[]models.Endpoint], - error) { - req := w.prepareRequest(ctx, "GET", "/endpoints.json") - req.Authenticate(true) - var result []models.Endpoint - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[[]models.Endpoint](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - return models.NewApiResponse(result, resp), err + models.ApiResponse[[]models.Endpoint], + error) { + req := w.prepareRequest(ctx, "GET", "/endpoints.json") + req.Authenticate(true) + var result []models.Endpoint + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[[]models.Endpoint](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + return models.NewApiResponse(result, resp), err } -// UpdateEndpoint takes context, endpointId, body as parameters and -// returns an models.ApiResponse with models.EndpointResponse data and -// an error if there was an issue with the request or response. -// You can update an Endpoint via the API with a PUT request to the resource endpoint. -// You can change the `url` of your endpoint which consumes webhooks or list of `webhook_subscriptions`. -// Check available [Event keys](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404448450317-Webhooks#configure-webhook-url). -// Always send a complete list of events which you want subscribe/watch. -// Sending an PUT request for existing endpoint with empty list of `webhook_subscriptions` will end with unsubscribe from all events. +// UpdateEndpoint takes context, endpointId, body as parameters and +// returns an models.ApiResponse with models.EndpointResponse data and +// an error if there was an issue with the request or response. +// You can update an Endpoint via the API with a PUT request to the resource endpoint. +// You can change the `url` of your endpoint which consumes webhooks or list of `webhook_subscriptions`. +// Check available [Event keys](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404448450317-Webhooks#configure-webhook-url). +// Always send a complete list of events which you want subscribe/watch. +// Sending an PUT request for existing endpoint with empty list of `webhook_subscriptions` will end with unsubscribe from all events. // If you want unsubscribe from specific event, just send a list of `webhook_subscriptions` without the specific event key. func (w *WebhooksController) UpdateEndpoint( - ctx context.Context, - endpointId int, - body *models.UpdateEndpointRequest) ( - models.ApiResponse[models.EndpointResponse], - error) { - req := w.prepareRequest( - ctx, - "PUT", - fmt.Sprintf("/endpoints/%v.json", endpointId), - ) - req.Authenticate(true) - req.Header("Content-Type", "application/json") - if body != nil { - req.Json(*body) - } - - var result models.EndpointResponse - decoder, resp, err := req.CallAsJson() - if err != nil { - return models.NewApiResponse(result, resp), err - } - err = validateResponse(*resp) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - result, err = utilities.DecodeResults[models.EndpointResponse](decoder) - if err != nil { - return models.NewApiResponse(result, resp), err - } - - if resp.StatusCode == 404 { - err = errors.NewApiError(404, "Not Found") - } - if resp.StatusCode == 422 { - err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") - } - return models.NewApiResponse(result, resp), err + ctx context.Context, + endpointId int, + body *models.UpdateEndpointRequest) ( + models.ApiResponse[models.EndpointResponse], + error) { + req := w.prepareRequest( + ctx, + "PUT", + fmt.Sprintf("/endpoints/%v.json", endpointId), + ) + req.Authenticate(true) + req.Header("Content-Type", "application/json") + if body != nil { + req.Json(*body) + } + + var result models.EndpointResponse + decoder, resp, err := req.CallAsJson() + if err != nil { + return models.NewApiResponse(result, resp), err + } + err = validateResponse(*resp) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + result, err = utilities.DecodeResults[models.EndpointResponse](decoder) + if err != nil { + return models.NewApiResponse(result, resp), err + } + + if resp.StatusCode == 404 { + err = errors.NewApiError(404, "Not Found") + } + if resp.StatusCode == 422 { + err = errors.NewErrorListResponse(422, "Unprocessable Entity (WebDAV)") + } + return models.NewApiResponse(result, resp), err }