Documentation
¶
Overview ¶
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 ).
Index ¶
- Variables
- func NewBaseController(cb callBuilderFactory) *baseController
- type APIExportsController
- func (a *APIExportsController) ExportInvoices(ctx context.Context) (models.ApiResponse[models.BatchJobResponse], error)
- func (a *APIExportsController) ExportProformaInvoices(ctx context.Context) (models.ApiResponse[models.BatchJobResponse], error)
- func (a *APIExportsController) ExportSubscriptions(ctx context.Context) (models.ApiResponse[models.BatchJobResponse], error)
- func (a *APIExportsController) ListExportedInvoices(ctx context.Context, input ListExportedInvoicesInput) (models.ApiResponse[[]models.Invoice], error)
- func (a *APIExportsController) ListExportedProformaInvoices(ctx context.Context, input ListExportedProformaInvoicesInput) (models.ApiResponse[[]models.ProformaInvoice], error)
- func (a *APIExportsController) ListExportedSubscriptions(ctx context.Context, input ListExportedSubscriptionsInput) (models.ApiResponse[[]models.Subscription], error)
- func (a *APIExportsController) ReadInvoicesExport(ctx context.Context, batchId string) (models.ApiResponse[models.BatchJobResponse], error)
- func (a *APIExportsController) ReadProformaInvoicesExport(ctx context.Context, batchId string) (models.ApiResponse[models.BatchJobResponse], error)
- func (a *APIExportsController) ReadSubscriptionsExport(ctx context.Context, batchId string) (models.ApiResponse[models.BatchJobResponse], error)
- type AdvanceInvoiceController
- func (a *AdvanceInvoiceController) IssueAdvanceInvoice(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.Invoice], error)
- func (a *AdvanceInvoiceController) ReadAdvanceInvoice(ctx context.Context, subscriptionId int) (models.ApiResponse[models.Invoice], error)
- func (a *AdvanceInvoiceController) VoidAdvanceInvoice(ctx context.Context, subscriptionId int, body *models.VoidInvoiceRequest) (models.ApiResponse[models.Invoice], error)
- type BasicAuthCredentials
- func (b BasicAuthCredentials) Authenticator() https.HttpInterceptor
- func (b BasicAuthCredentials) Password() string
- func (b BasicAuthCredentials) Username() string
- func (b BasicAuthCredentials) Validate() error
- func (b BasicAuthCredentials) WithPassword(password string) BasicAuthCredentials
- func (b BasicAuthCredentials) WithUsername(username string) BasicAuthCredentials
- type BillingPortalController
- func (b *BillingPortalController) EnableBillingPortalForCustomer(ctx context.Context, customerId int, autoInvite *models.AutoInvite) (models.ApiResponse[models.CustomerResponse], error)
- func (b *BillingPortalController) ReadBillingPortalLink(ctx context.Context, customerId int) (models.ApiResponse[models.PortalManagementLink], error)
- func (b *BillingPortalController) ResendBillingPortalInvitation(ctx context.Context, customerId int) (models.ApiResponse[models.ResentInvitation], error)
- func (b *BillingPortalController) RevokeBillingPortalAccess(ctx context.Context, customerId int) (models.ApiResponse[models.RevokedInvitation], error)
- type ClientInterface
- type ComponentPricePointsController
- func (c *ComponentPricePointsController) ArchiveComponentPricePoint(ctx context.Context, componentId models.ArchiveComponentPricePointComponentId, ...) (models.ApiResponse[models.ComponentPricePointResponse], error)
- func (c *ComponentPricePointsController) BulkCreateComponentPricePoints(ctx context.Context, componentId string, ...) (models.ApiResponse[models.ComponentPricePointsResponse], error)
- func (c *ComponentPricePointsController) CloneComponentPricePoint(ctx context.Context, componentId models.CloneComponentPricePointComponentId, ...) (models.ApiResponse[models.ComponentPricePointCurrencyOverageResponse], error)
- func (c *ComponentPricePointsController) CreateComponentPricePoint(ctx context.Context, componentId int, ...) (models.ApiResponse[models.ComponentPricePointResponse], error)
- func (c *ComponentPricePointsController) CreateCurrencyPrices(ctx context.Context, pricePointId int, ...) (models.ApiResponse[models.ComponentCurrencyPricesResponse], error)
- func (c *ComponentPricePointsController) ListAllComponentPricePoints(ctx context.Context, input ListAllComponentPricePointsInput) (models.ApiResponse[models.ListComponentsPricePointsResponse], error)
- func (c *ComponentPricePointsController) ListComponentPricePoints(ctx context.Context, input ListComponentPricePointsInput) (models.ApiResponse[models.ComponentPricePointsResponse], error)
- func (c *ComponentPricePointsController) PromoteComponentPricePointToDefault(ctx context.Context, componentId int, pricePointId int) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentPricePointsController) ReadComponentPricePoint(ctx context.Context, componentId models.ReadComponentPricePointComponentId, ...) (models.ApiResponse[models.ComponentPricePointCurrencyOverageResponse], error)
- func (c *ComponentPricePointsController) UnarchiveComponentPricePoint(ctx context.Context, componentId int, pricePointId int) (models.ApiResponse[models.ComponentPricePointResponse], error)
- func (c *ComponentPricePointsController) UpdateComponentPricePoint(ctx context.Context, componentId models.UpdateComponentPricePointComponentId, ...) (models.ApiResponse[models.ComponentPricePointResponse], error)
- func (c *ComponentPricePointsController) UpdateCurrencyPrices(ctx context.Context, pricePointId int, ...) (models.ApiResponse[models.ComponentCurrencyPricesResponse], error)
- type ComponentsController
- func (c *ComponentsController) ArchiveComponent(ctx context.Context, productFamilyId int, componentId string) (models.ApiResponse[models.Component], error)
- func (c *ComponentsController) CreateEventBasedComponent(ctx context.Context, productFamilyId string, body *models.CreateEBBComponent) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) CreateMeteredComponent(ctx context.Context, productFamilyId string, ...) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) CreateOnOffComponent(ctx context.Context, productFamilyId string, body *models.CreateOnOffComponent) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) CreatePrepaidUsageComponent(ctx context.Context, productFamilyId string, ...) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) CreateQuantityBasedComponent(ctx context.Context, productFamilyId string, ...) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) FindComponent(ctx context.Context, handle string) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) ListComponents(ctx context.Context, input ListComponentsInput) (models.ApiResponse[[]models.ComponentResponse], error)
- func (c *ComponentsController) ListComponentsForProductFamily(ctx context.Context, input ListComponentsForProductFamilyInput) (models.ApiResponse[[]models.ComponentResponse], error)
- func (c *ComponentsController) ReadComponent(ctx context.Context, productFamilyId int, componentId string) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) UpdateComponent(ctx context.Context, componentId string, body *models.UpdateComponentRequest) (models.ApiResponse[models.ComponentResponse], error)
- func (c *ComponentsController) UpdateProductFamilyComponent(ctx context.Context, productFamilyId int, componentId string, ...) (models.ApiResponse[models.ComponentResponse], error)
- type Configuration
- type ConfigurationOptions
- type CouponsController
- func (c *CouponsController) ArchiveCoupon(ctx context.Context, productFamilyId int, couponId int) (models.ApiResponse[models.CouponResponse], error)
- func (c *CouponsController) CreateCoupon(ctx context.Context, productFamilyId int, body *models.CouponRequest) (models.ApiResponse[models.CouponResponse], error)
- func (c *CouponsController) CreateCouponSubcodes(ctx context.Context, couponId int, body *models.CouponSubcodes) (models.ApiResponse[models.CouponSubcodesResponse], error)
- func (c *CouponsController) CreateOrUpdateCouponCurrencyPrices(ctx context.Context, couponId int, body *models.CouponCurrencyRequest) (models.ApiResponse[models.CouponCurrencyResponse], error)
- func (c *CouponsController) DeleteCouponSubcode(ctx context.Context, couponId int, subcode string) (*http.Response, error)
- func (c *CouponsController) FindCoupon(ctx context.Context, productFamilyId *int, code *string, currencyPrices *bool) (models.ApiResponse[models.CouponResponse], error)
- func (c *CouponsController) ListCouponSubcodes(ctx context.Context, input ListCouponSubcodesInput) (models.ApiResponse[models.CouponSubcodes], error)
- func (c *CouponsController) ListCoupons(ctx context.Context, input ListCouponsInput) (models.ApiResponse[[]models.CouponResponse], error)
- func (c *CouponsController) ListCouponsForProductFamily(ctx context.Context, input ListCouponsForProductFamilyInput) (models.ApiResponse[[]models.CouponResponse], error)
- func (c *CouponsController) ReadCoupon(ctx context.Context, productFamilyId int, couponId int, currencyPrices *bool) (models.ApiResponse[models.CouponResponse], error)
- func (c *CouponsController) ReadCouponUsage(ctx context.Context, productFamilyId int, couponId int) (models.ApiResponse[[]models.CouponUsage], error)
- func (c *CouponsController) UpdateCoupon(ctx context.Context, productFamilyId int, couponId int, ...) (models.ApiResponse[models.CouponResponse], error)
- func (c *CouponsController) UpdateCouponSubcodes(ctx context.Context, couponId int, body *models.CouponSubcodes) (models.ApiResponse[models.CouponSubcodesResponse], error)
- func (c *CouponsController) ValidateCoupon(ctx context.Context, code string, productFamilyId *int) (models.ApiResponse[models.CouponResponse], error)
- type CustomFieldsController
- func (c *CustomFieldsController) CreateMetadata(ctx context.Context, resourceType models.ResourceType, resourceId int, ...) (models.ApiResponse[[]models.Metadata], error)
- func (c *CustomFieldsController) CreateMetafields(ctx context.Context, resourceType models.ResourceType, ...) (models.ApiResponse[[]models.Metafield], error)
- func (c *CustomFieldsController) DeleteMetadata(ctx context.Context, resourceType models.ResourceType, resourceId int, ...) (*http.Response, error)
- func (c *CustomFieldsController) DeleteMetafield(ctx context.Context, resourceType models.ResourceType, name *string) (*http.Response, error)
- func (c *CustomFieldsController) ListMetadata(ctx context.Context, input ListMetadataInput) (models.ApiResponse[models.PaginatedMetadata], error)
- func (c *CustomFieldsController) ListMetadataForResourceType(ctx context.Context, input ListMetadataForResourceTypeInput) (models.ApiResponse[models.PaginatedMetadata], error)
- func (c *CustomFieldsController) ListMetafields(ctx context.Context, input ListMetafieldsInput) (models.ApiResponse[models.ListMetafieldsResponse], error)
- func (c *CustomFieldsController) UpdateMetadata(ctx context.Context, resourceType models.ResourceType, resourceId int, ...) (models.ApiResponse[[]models.Metadata], error)
- func (c *CustomFieldsController) UpdateMetafield(ctx context.Context, resourceType models.ResourceType, ...) (models.ApiResponse[[]models.Metafield], error)
- type CustomersController
- func (c *CustomersController) CreateCustomer(ctx context.Context, body *models.CreateCustomerRequest) (models.ApiResponse[models.CustomerResponse], error)
- func (c *CustomersController) DeleteCustomer(ctx context.Context, id int) (*http.Response, error)
- func (c *CustomersController) ListCustomerSubscriptions(ctx context.Context, customerId int) (models.ApiResponse[[]models.SubscriptionResponse], error)
- func (c *CustomersController) ListCustomers(ctx context.Context, input ListCustomersInput) (models.ApiResponse[[]models.CustomerResponse], error)
- func (c *CustomersController) ReadCustomer(ctx context.Context, id int) (models.ApiResponse[models.CustomerResponse], error)
- func (c *CustomersController) ReadCustomerByReference(ctx context.Context, reference string) (models.ApiResponse[models.CustomerResponse], error)
- func (c *CustomersController) UpdateCustomer(ctx context.Context, id int, body *models.UpdateCustomerRequest) (models.ApiResponse[models.CustomerResponse], error)
- type Environment
- type EventsBasedBillingSegmentsController
- func (e *EventsBasedBillingSegmentsController) BulkCreateSegments(ctx context.Context, componentId string, pricePointId string, ...) (models.ApiResponse[models.ListSegmentsResponse], error)
- func (e *EventsBasedBillingSegmentsController) BulkUpdateSegments(ctx context.Context, componentId string, pricePointId string, ...) (models.ApiResponse[models.ListSegmentsResponse], error)
- func (e *EventsBasedBillingSegmentsController) CreateSegment(ctx context.Context, componentId string, pricePointId string, ...) (models.ApiResponse[models.SegmentResponse], error)
- func (e *EventsBasedBillingSegmentsController) DeleteSegment(ctx context.Context, componentId string, pricePointId string, id float64) (*http.Response, error)
- func (e *EventsBasedBillingSegmentsController) ListSegmentsForPricePoint(ctx context.Context, input ListSegmentsForPricePointInput) (models.ApiResponse[models.ListSegmentsResponse], error)
- func (e *EventsBasedBillingSegmentsController) UpdateSegment(ctx context.Context, componentId string, pricePointId string, id float64, ...) (models.ApiResponse[models.SegmentResponse], error)
- type EventsController
- func (e *EventsController) ListEvents(ctx context.Context, input ListEventsInput) (models.ApiResponse[[]models.EventResponse], error)
- func (e *EventsController) ListSubscriptionEvents(ctx context.Context, input ListSubscriptionEventsInput) (models.ApiResponse[[]models.EventResponse], error)
- func (e *EventsController) ReadEventsCount(ctx context.Context, input ReadEventsCountInput) (models.ApiResponse[models.CountResponse], error)
- type HttpConfiguration
- type HttpConfigurationOptions
- type InsightsController
- func (i *InsightsController) ListMrrMovements(ctx context.Context, input ListMrrMovementsInput) (models.ApiResponse[models.ListMRRResponse], error)
- func (i *InsightsController) ListMrrPerSubscription(ctx context.Context, input ListMrrPerSubscriptionInput) (models.ApiResponse[models.SubscriptionMRRResponse], error)
- func (i *InsightsController) ReadMrr(ctx context.Context, atTime *time.Time, subscriptionId *int) (models.ApiResponse[models.MRRResponse], error)
- func (i *InsightsController) ReadSiteStats(ctx context.Context) (models.ApiResponse[models.SiteSummary], error)
- type InvoicesController
- func (i *InvoicesController) CreateInvoice(ctx context.Context, subscriptionId int, body *models.CreateInvoiceRequest) (models.ApiResponse[models.InvoiceResponse], error)
- func (i *InvoicesController) DeleteInvoice(ctx context.Context, subscriptionId int, uid string) (*http.Response, error)
- func (i *InvoicesController) IssueInvoice(ctx context.Context, uid string, body *models.IssueInvoiceRequest) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) ListConsolidatedInvoiceSegments(ctx context.Context, input ListConsolidatedInvoiceSegmentsInput) (models.ApiResponse[models.ConsolidatedInvoice], error)
- func (i *InvoicesController) ListCreditNotes(ctx context.Context, input ListCreditNotesInput) (models.ApiResponse[models.ListCreditNotesResponse], error)
- func (i *InvoicesController) ListInvoiceEvents(ctx context.Context, input ListInvoiceEventsInput) (models.ApiResponse[models.ListInvoiceEventsResponse], error)
- func (i *InvoicesController) ListInvoices(ctx context.Context, input ListInvoicesInput) (models.ApiResponse[models.ListInvoicesResponse], error)
- func (i *InvoicesController) PreviewCustomerInformationChanges(ctx context.Context, uid string) (models.ApiResponse[models.CustomerChangesPreviewResponse], error)
- func (i *InvoicesController) ReadCreditNote(ctx context.Context, uid string) (models.ApiResponse[models.CreditNote], error)
- func (i *InvoicesController) ReadInvoice(ctx context.Context, uid string) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) RecordPaymentForInvoice(ctx context.Context, uid string, body *models.CreateInvoicePaymentRequest) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) RecordPaymentForMultipleInvoices(ctx context.Context, body *models.CreateMultiInvoicePaymentRequest) (models.ApiResponse[models.MultiInvoicePaymentResponse], error)
- func (i *InvoicesController) RecordPaymentForSubscription(ctx context.Context, subscriptionId int, body *models.RecordPaymentRequest) (models.ApiResponse[models.RecordPaymentResponse], error)
- func (i *InvoicesController) RefundInvoice(ctx context.Context, uid string, body *models.RefundInvoiceRequest) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) ReopenInvoice(ctx context.Context, uid string) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) SendInvoice(ctx context.Context, uid string, body *models.SendInvoiceRequest) (*http.Response, error)
- func (i *InvoicesController) UpdateCustomerInformation(ctx context.Context, uid string) (models.ApiResponse[models.Invoice], error)
- func (i *InvoicesController) UpdateInvoice(ctx context.Context, subscriptionId int, uid string, ...) (models.ApiResponse[models.InvoiceResponse], error)
- func (i *InvoicesController) VoidInvoice(ctx context.Context, uid string, body *models.VoidInvoiceRequest) (models.ApiResponse[models.Invoice], error)
- type ListAllComponentPricePointsInput
- type ListAllProductPricePointsInput
- type ListChargifyJsPublicKeysInput
- type ListComponentPricePointsInput
- type ListComponentsForProductFamilyInput
- type ListComponentsInput
- type ListConsolidatedInvoiceSegmentsInput
- type ListCouponSubcodesInput
- type ListCouponsForProductFamilyInput
- type ListCouponsInput
- type ListCreditNotesInput
- type ListCustomersInput
- type ListEventsInput
- type ListExportedInvoicesInput
- type ListExportedProformaInvoicesInput
- type ListExportedSubscriptionsInput
- type ListInvoiceEventsInput
- type ListInvoicesInput
- type ListMetadataForResourceTypeInput
- type ListMetadataInput
- type ListMetafieldsInput
- type ListMrrMovementsInput
- type ListMrrPerSubscriptionInput
- type ListOffersInput
- type ListPaymentProfilesInput
- type ListPrepaymentsForSubscriptionGroupInput
- type ListPrepaymentsInput
- type ListProductFamiliesInput
- type ListProductPricePointsInput
- type ListProductsForProductFamilyInput
- type ListProductsInput
- type ListProformaInvoicesInput
- type ListReasonCodesInput
- type ListSalesCommissionSettingsInput
- type ListSalesRepsInput
- type ListSegmentsForPricePointInput
- type ListSubscriptionComponentsForSiteInput
- type ListSubscriptionComponentsInput
- type ListSubscriptionEventsInput
- type ListSubscriptionGroupProformaInvoicesInput
- type ListSubscriptionGroupsInput
- type ListSubscriptionNotesInput
- type ListSubscriptionsInput
- type ListUsagesInput
- type ListWebhooksInput
- type OffersController
- func (o *OffersController) ArchiveOffer(ctx context.Context, offerId int) (*http.Response, error)
- func (o *OffersController) CreateOffer(ctx context.Context, body *models.CreateOfferRequest) (models.ApiResponse[models.OfferResponse], error)
- func (o *OffersController) ListOffers(ctx context.Context, input ListOffersInput) (models.ApiResponse[models.ListOffersResponse], error)
- func (o *OffersController) ReadOffer(ctx context.Context, offerId int) (models.ApiResponse[models.OfferResponse], error)
- func (o *OffersController) UnarchiveOffer(ctx context.Context, offerId int) (*http.Response, error)
- type PaymentProfilesController
- func (p *PaymentProfilesController) ChangeSubscriptionDefaultPaymentProfile(ctx context.Context, subscriptionId int, paymentProfileId int) (models.ApiResponse[models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) ChangeSubscriptionGroupDefaultPaymentProfile(ctx context.Context, uid string, paymentProfileId int) (models.ApiResponse[models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) CreatePaymentProfile(ctx context.Context, body *models.CreatePaymentProfileRequest) (models.ApiResponse[models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) DeleteSubscriptionGroupPaymentProfile(ctx context.Context, uid string, paymentProfileId int) (*http.Response, error)
- func (p *PaymentProfilesController) DeleteSubscriptionsPaymentProfile(ctx context.Context, subscriptionId int, paymentProfileId int) (*http.Response, error)
- func (p *PaymentProfilesController) DeleteUnusedPaymentProfile(ctx context.Context, paymentProfileId int) (*http.Response, error)
- func (p *PaymentProfilesController) ListPaymentProfiles(ctx context.Context, input ListPaymentProfilesInput) (models.ApiResponse[[]models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) ReadOneTimeToken(ctx context.Context, chargifyToken string) (models.ApiResponse[models.GetOneTimeTokenRequest], error)
- func (p *PaymentProfilesController) ReadPaymentProfile(ctx context.Context, paymentProfileId int) (models.ApiResponse[models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) SendRequestUpdatePaymentEmail(ctx context.Context, subscriptionId int) (*http.Response, error)
- func (p *PaymentProfilesController) UpdatePaymentProfile(ctx context.Context, paymentProfileId int, ...) (models.ApiResponse[models.PaymentProfileResponse], error)
- func (p *PaymentProfilesController) VerifyBankAccount(ctx context.Context, bankAccountId int, ...) (models.ApiResponse[models.BankAccountResponse], error)
- type ProductFamiliesController
- func (p *ProductFamiliesController) CreateProductFamily(ctx context.Context, body *models.CreateProductFamilyRequest) (models.ApiResponse[models.ProductFamilyResponse], error)
- func (p *ProductFamiliesController) ListProductFamilies(ctx context.Context, input ListProductFamiliesInput) (models.ApiResponse[[]models.ProductFamilyResponse], error)
- func (p *ProductFamiliesController) ListProductsForProductFamily(ctx context.Context, input ListProductsForProductFamilyInput) (models.ApiResponse[[]models.ProductResponse], error)
- func (p *ProductFamiliesController) ReadProductFamily(ctx context.Context, id int) (models.ApiResponse[models.ProductFamilyResponse], error)
- type ProductPricePointsController
- func (p *ProductPricePointsController) ArchiveProductPricePoint(ctx context.Context, productId models.ArchiveProductPricePointProductId, ...) (models.ApiResponse[models.ProductPricePointResponse], error)
- func (p *ProductPricePointsController) BulkCreateProductPricePoints(ctx context.Context, productId int, ...) (models.ApiResponse[models.BulkCreateProductPricePointsResponse], error)
- func (p *ProductPricePointsController) CreateProductCurrencyPrices(ctx context.Context, productPricePointId int, ...) (models.ApiResponse[models.CurrencyPricesResponse], error)
- func (p *ProductPricePointsController) CreateProductPricePoint(ctx context.Context, productId models.CreateProductPricePointProductId, ...) (models.ApiResponse[models.ProductPricePointResponse], error)
- func (p *ProductPricePointsController) ListAllProductPricePoints(ctx context.Context, input ListAllProductPricePointsInput) (models.ApiResponse[models.ListProductPricePointsResponse], error)
- func (p *ProductPricePointsController) ListProductPricePoints(ctx context.Context, input ListProductPricePointsInput) (models.ApiResponse[models.ListProductPricePointsResponse], error)
- func (p *ProductPricePointsController) PromoteProductPricePointToDefault(ctx context.Context, productId int, pricePointId int) (models.ApiResponse[models.ProductResponse], error)
- func (p *ProductPricePointsController) ReadProductPricePoint(ctx context.Context, productId models.ReadProductPricePointProductId, ...) (models.ApiResponse[models.ProductPricePointResponse], error)
- func (p *ProductPricePointsController) UnarchiveProductPricePoint(ctx context.Context, productId int, pricePointId int) (models.ApiResponse[models.ProductPricePointResponse], error)
- func (p *ProductPricePointsController) UpdateProductCurrencyPrices(ctx context.Context, productPricePointId int, ...) (models.ApiResponse[models.CurrencyPricesResponse], error)
- func (p *ProductPricePointsController) UpdateProductPricePoint(ctx context.Context, productId models.UpdateProductPricePointProductId, ...) (models.ApiResponse[models.ProductPricePointResponse], error)
- type ProductsController
- func (p *ProductsController) ArchiveProduct(ctx context.Context, productId int) (models.ApiResponse[models.ProductResponse], error)
- func (p *ProductsController) CreateProduct(ctx context.Context, productFamilyId string, ...) (models.ApiResponse[models.ProductResponse], error)
- func (p *ProductsController) ListProducts(ctx context.Context, input ListProductsInput) (models.ApiResponse[[]models.ProductResponse], error)
- func (p *ProductsController) ReadProduct(ctx context.Context, productId int) (models.ApiResponse[models.ProductResponse], error)
- func (p *ProductsController) ReadProductByHandle(ctx context.Context, apiHandle string) (models.ApiResponse[models.ProductResponse], error)
- func (p *ProductsController) UpdateProduct(ctx context.Context, productId int, body *models.CreateOrUpdateProductRequest) (models.ApiResponse[models.ProductResponse], error)
- type ProformaInvoicesController
- func (p *ProformaInvoicesController) CreateConsolidatedProformaInvoice(ctx context.Context, uid string) (*http.Response, error)
- func (p *ProformaInvoicesController) CreateProformaInvoice(ctx context.Context, subscriptionId int) (models.ApiResponse[models.ProformaInvoice], error)
- func (p *ProformaInvoicesController) CreateSignupProformaInvoice(ctx context.Context, body *models.CreateSubscriptionRequest) (models.ApiResponse[models.ProformaInvoice], error)
- func (p *ProformaInvoicesController) DeliverProformaInvoice(ctx context.Context, proformaInvoiceUid string, ...) (models.ApiResponse[models.ProformaInvoice], error)
- func (p *ProformaInvoicesController) ListProformaInvoices(ctx context.Context, input ListProformaInvoicesInput) (models.ApiResponse[models.ListProformaInvoicesResponse], error)
- func (p *ProformaInvoicesController) ListSubscriptionGroupProformaInvoices(ctx context.Context, input ListSubscriptionGroupProformaInvoicesInput) (models.ApiResponse[models.ListProformaInvoicesResponse], error)
- func (p *ProformaInvoicesController) PreviewProformaInvoice(ctx context.Context, subscriptionId int) (models.ApiResponse[models.ProformaInvoice], error)
- func (p *ProformaInvoicesController) PreviewSignupProformaInvoice(ctx context.Context, include *models.CreateSignupProformaPreviewInclude, ...) (models.ApiResponse[models.SignupProformaPreviewResponse], error)
- func (p *ProformaInvoicesController) ReadProformaInvoice(ctx context.Context, proformaInvoiceUid string) (models.ApiResponse[models.ProformaInvoice], error)
- func (p *ProformaInvoicesController) VoidProformaInvoice(ctx context.Context, proformaInvoiceUid string, ...) (models.ApiResponse[models.ProformaInvoice], error)
- type ReadEventsCountInput
- type ReasonCodesController
- func (r *ReasonCodesController) CreateReasonCode(ctx context.Context, body *models.CreateReasonCodeRequest) (models.ApiResponse[models.ReasonCodeResponse], error)
- func (r *ReasonCodesController) DeleteReasonCode(ctx context.Context, reasonCodeId int) (models.ApiResponse[models.OkResponse], error)
- func (r *ReasonCodesController) ListReasonCodes(ctx context.Context, input ListReasonCodesInput) (models.ApiResponse[[]models.ReasonCodeResponse], error)
- func (r *ReasonCodesController) ReadReasonCode(ctx context.Context, reasonCodeId int) (models.ApiResponse[models.ReasonCodeResponse], error)
- func (r *ReasonCodesController) UpdateReasonCode(ctx context.Context, reasonCodeId int, body *models.UpdateReasonCodeRequest) (models.ApiResponse[models.ReasonCodeResponse], error)
- type ReferralCodesController
- type RetryConfiguration
- type RetryConfigurationOptions
- type SalesCommissionsController
- func (s *SalesCommissionsController) ListSalesCommissionSettings(ctx context.Context, input ListSalesCommissionSettingsInput) (models.ApiResponse[[]models.SaleRepSettings], error)
- func (s *SalesCommissionsController) ListSalesReps(ctx context.Context, input ListSalesRepsInput) (models.ApiResponse[[]models.ListSaleRepItem], error)
- func (s *SalesCommissionsController) ReadSalesRep(ctx context.Context, sellerId string, salesRepId string, authorization *string, ...) (models.ApiResponse[models.SaleRep], error)
- type Server
- type SitesController
- func (s *SitesController) ClearSite(ctx context.Context, cleanupScope *models.CleanupScope) (*http.Response, error)
- func (s *SitesController) ListChargifyJsPublicKeys(ctx context.Context, input ListChargifyJsPublicKeysInput) (models.ApiResponse[models.ListPublicKeysResponse], error)
- func (s *SitesController) ReadSite(ctx context.Context) (models.ApiResponse[models.SiteResponse], error)
- type SubscriptionComponentsController
- func (s *SubscriptionComponentsController) ActivateEventBasedComponent(ctx context.Context, subscriptionId int, componentId int, ...) (*http.Response, error)
- func (s *SubscriptionComponentsController) AllocateComponent(ctx context.Context, subscriptionId int, componentId int, ...) (models.ApiResponse[models.AllocationResponse], error)
- func (s *SubscriptionComponentsController) AllocateComponents(ctx context.Context, subscriptionId int, body *models.AllocateComponents) (models.ApiResponse[[]models.AllocationResponse], error)
- func (s *SubscriptionComponentsController) BulkRecordEvents(ctx context.Context, apiHandle string, storeUid *string, ...) (*http.Response, error)
- func (s *SubscriptionComponentsController) BulkResetSubscriptionComponentsPricePoints(ctx context.Context, subscriptionId int) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionComponentsController) BulkUpdateSubscriptionComponentsPricePoints(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.BulkComponentsPricePointAssignment], error)
- func (s *SubscriptionComponentsController) CreateUsage(ctx context.Context, ...) (models.ApiResponse[models.UsageResponse], error)
- func (s *SubscriptionComponentsController) DeactivateEventBasedComponent(ctx context.Context, subscriptionId int, componentId int) (*http.Response, error)
- func (s *SubscriptionComponentsController) DeletePrepaidUsageAllocation(ctx context.Context, subscriptionId int, componentId int, allocationId int, ...) (*http.Response, error)
- func (s *SubscriptionComponentsController) ListAllocations(ctx context.Context, subscriptionId int, componentId int, page *int) (models.ApiResponse[[]models.AllocationResponse], error)
- func (s *SubscriptionComponentsController) ListSubscriptionComponents(ctx context.Context, input ListSubscriptionComponentsInput) (models.ApiResponse[[]models.SubscriptionComponentResponse], error)
- func (s *SubscriptionComponentsController) ListSubscriptionComponentsForSite(ctx context.Context, input ListSubscriptionComponentsForSiteInput) (models.ApiResponse[models.ListSubscriptionComponentsResponse], error)
- func (s *SubscriptionComponentsController) ListUsages(ctx context.Context, input ListUsagesInput) (models.ApiResponse[[]models.UsageResponse], error)
- func (s *SubscriptionComponentsController) PreviewAllocations(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.AllocationPreviewResponse], error)
- func (s *SubscriptionComponentsController) ReadSubscriptionComponent(ctx context.Context, subscriptionId int, componentId int) (models.ApiResponse[models.SubscriptionComponentResponse], error)
- func (s *SubscriptionComponentsController) RecordEvent(ctx context.Context, apiHandle string, storeUid *string, body *models.EBBEvent) (*http.Response, error)
- func (s *SubscriptionComponentsController) UpdatePrepaidUsageAllocationExpirationDate(ctx context.Context, subscriptionId int, componentId int, allocationId int, ...) (*http.Response, error)
- type SubscriptionGroupInvoiceAccountController
- func (s *SubscriptionGroupInvoiceAccountController) CreateSubscriptionGroupPrepayment(ctx context.Context, uid string, ...) (models.ApiResponse[models.SubscriptionGroupPrepaymentResponse], error)
- func (s *SubscriptionGroupInvoiceAccountController) DeductSubscriptionGroupServiceCredit(ctx context.Context, uid string, body *models.DeductServiceCreditRequest) (models.ApiResponse[models.ServiceCredit], error)
- func (s *SubscriptionGroupInvoiceAccountController) IssueSubscriptionGroupServiceCredit(ctx context.Context, uid string, body *models.IssueServiceCreditRequest) (models.ApiResponse[models.ServiceCreditResponse], error)
- func (s *SubscriptionGroupInvoiceAccountController) ListPrepaymentsForSubscriptionGroup(ctx context.Context, input ListPrepaymentsForSubscriptionGroupInput) (models.ApiResponse[models.ListSubscriptionGroupPrepaymentResponse], error)
- type SubscriptionGroupStatusController
- func (s *SubscriptionGroupStatusController) CancelDelayedCancellationForGroup(ctx context.Context, uid string) (*http.Response, error)
- func (s *SubscriptionGroupStatusController) CancelSubscriptionsInGroup(ctx context.Context, uid string, ...) (*http.Response, error)
- func (s *SubscriptionGroupStatusController) InitiateDelayedCancellationForGroup(ctx context.Context, uid string) (*http.Response, error)
- func (s *SubscriptionGroupStatusController) ReactivateSubscriptionGroup(ctx context.Context, uid string, ...) (models.ApiResponse[models.ReactivateSubscriptionGroupResponse], error)
- type SubscriptionGroupsController
- func (s *SubscriptionGroupsController) AddSubscriptionToGroup(ctx context.Context, subscriptionId int, body *models.AddSubscriptionToAGroup) (models.ApiResponse[models.SubscriptionGroupResponse], error)
- func (s *SubscriptionGroupsController) CreateSubscriptionGroup(ctx context.Context, body *models.CreateSubscriptionGroupRequest) (models.ApiResponse[models.SubscriptionGroupResponse], error)
- func (s *SubscriptionGroupsController) DeleteSubscriptionGroup(ctx context.Context, uid string) (models.ApiResponse[models.DeleteSubscriptionGroupResponse], error)
- func (s *SubscriptionGroupsController) FindSubscriptionGroup(ctx context.Context, subscriptionId string) (models.ApiResponse[models.FullSubscriptionGroupResponse], error)
- func (s *SubscriptionGroupsController) ListSubscriptionGroups(ctx context.Context, input ListSubscriptionGroupsInput) (models.ApiResponse[models.ListSubscriptionGroupsResponse], error)
- func (s *SubscriptionGroupsController) ReadSubscriptionGroup(ctx context.Context, uid string, include []models.SubscriptionGroupInclude) (models.ApiResponse[models.FullSubscriptionGroupResponse], error)
- func (s *SubscriptionGroupsController) RemoveSubscriptionFromGroup(ctx context.Context, subscriptionId int) (*http.Response, error)
- func (s *SubscriptionGroupsController) SignupWithSubscriptionGroup(ctx context.Context, body *models.SubscriptionGroupSignupRequest) (models.ApiResponse[models.SubscriptionGroupSignupResponse], error)
- func (s *SubscriptionGroupsController) UpdateSubscriptionGroupMembers(ctx context.Context, uid string, body *models.UpdateSubscriptionGroupRequest) (models.ApiResponse[models.SubscriptionGroupResponse], error)
- type SubscriptionInvoiceAccountController
- func (s *SubscriptionInvoiceAccountController) CreatePrepayment(ctx context.Context, subscriptionId int, body *models.CreatePrepaymentRequest) (models.ApiResponse[models.CreatePrepaymentResponse], error)
- func (s *SubscriptionInvoiceAccountController) DeductServiceCredit(ctx context.Context, subscriptionId int, ...) (*http.Response, error)
- func (s *SubscriptionInvoiceAccountController) IssueServiceCredit(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.ServiceCredit], error)
- func (s *SubscriptionInvoiceAccountController) ListPrepayments(ctx context.Context, input ListPrepaymentsInput) (models.ApiResponse[models.PrepaymentsResponse], error)
- func (s *SubscriptionInvoiceAccountController) ListServiceCredits(ctx context.Context, subscriptionId int, page *int, perPage *int, ...) (models.ApiResponse[models.ListServiceCreditsResponse], error)
- func (s *SubscriptionInvoiceAccountController) ReadAccountBalances(ctx context.Context, subscriptionId int) (models.ApiResponse[models.AccountBalances], error)
- func (s *SubscriptionInvoiceAccountController) RefundPrepayment(ctx context.Context, subscriptionId int, prepaymentId int64, ...) (models.ApiResponse[models.PrepaymentResponse], error)
- type SubscriptionNotesController
- func (s *SubscriptionNotesController) CreateSubscriptionNote(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionNoteResponse], error)
- func (s *SubscriptionNotesController) DeleteSubscriptionNote(ctx context.Context, subscriptionId int, noteId int) (*http.Response, error)
- func (s *SubscriptionNotesController) ListSubscriptionNotes(ctx context.Context, input ListSubscriptionNotesInput) (models.ApiResponse[[]models.SubscriptionNoteResponse], error)
- func (s *SubscriptionNotesController) ReadSubscriptionNote(ctx context.Context, subscriptionId int, noteId int) (models.ApiResponse[models.SubscriptionNoteResponse], error)
- func (s *SubscriptionNotesController) UpdateSubscriptionNote(ctx context.Context, subscriptionId int, noteId int, ...) (models.ApiResponse[models.SubscriptionNoteResponse], error)
- type SubscriptionProductsController
- func (s *SubscriptionProductsController) MigrateSubscriptionProduct(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionProductsController) PreviewSubscriptionProductMigration(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionMigrationPreviewResponse], error)
- type SubscriptionRenewalsController
- func (s *SubscriptionRenewalsController) CancelScheduledRenewalConfiguration(ctx context.Context, subscriptionId int, id int) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) CreateScheduledRenewalConfiguration(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) CreateScheduledRenewalConfigurationItem(ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, ...) (models.ApiResponse[models.ScheduledRenewalConfigurationItemResponse], error)
- func (s *SubscriptionRenewalsController) DeleteScheduledRenewalConfigurationItem(ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, ...) (*http.Response, error)
- func (s *SubscriptionRenewalsController) ListScheduledRenewalConfigurations(ctx context.Context, subscriptionId int, status *models.Status) (models.ApiResponse[models.ScheduledRenewalConfigurationsResponse], error)
- func (s *SubscriptionRenewalsController) LockInScheduledRenewalImmediately(ctx context.Context, subscriptionId int, id int) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) ReadScheduledRenewalConfiguration(ctx context.Context, subscriptionId int, id int) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) ScheduleScheduledRenewalLockIn(ctx context.Context, subscriptionId int, id int, ...) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) UnpublishScheduledRenewalConfiguration(ctx context.Context, subscriptionId int, id int) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) UpdateScheduledRenewalConfiguration(ctx context.Context, subscriptionId int, id int, ...) (models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
- func (s *SubscriptionRenewalsController) UpdateScheduledRenewalConfigurationItem(ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, ...) (models.ApiResponse[models.ScheduledRenewalConfigurationItemResponse], error)
- type SubscriptionStatusController
- func (s *SubscriptionStatusController) CancelDelayedCancellation(ctx context.Context, subscriptionId int) (models.ApiResponse[models.DelayedCancellationResponse], error)
- func (s *SubscriptionStatusController) CancelDunning(ctx context.Context, subscriptionId int) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) CancelSubscription(ctx context.Context, subscriptionId int, body *models.CancellationRequest) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) InitiateDelayedCancellation(ctx context.Context, subscriptionId int, body *models.CancellationRequest) (models.ApiResponse[models.DelayedCancellationResponse], error)
- func (s *SubscriptionStatusController) PauseSubscription(ctx context.Context, subscriptionId int, body *models.PauseRequest) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) PreviewRenewal(ctx context.Context, subscriptionId int, body *models.RenewalPreviewRequest) (models.ApiResponse[models.RenewalPreviewResponse], error)
- func (s *SubscriptionStatusController) ReactivateSubscription(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) ResumeSubscription(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) RetrySubscription(ctx context.Context, subscriptionId int) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionStatusController) UpdateAutomaticSubscriptionResumption(ctx context.Context, subscriptionId int, body *models.PauseRequest) (models.ApiResponse[models.SubscriptionResponse], error)
- type SubscriptionsController
- func (s *SubscriptionsController) ActivateSubscription(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) ApplyCouponsToSubscription(ctx context.Context, subscriptionId int, code *string, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) CreateSubscription(ctx context.Context, body *models.CreateSubscriptionRequest) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) FindSubscription(ctx context.Context, reference *string) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) ListSubscriptions(ctx context.Context, input ListSubscriptionsInput) (models.ApiResponse[[]models.SubscriptionResponse], error)
- func (s *SubscriptionsController) OverrideSubscription(ctx context.Context, subscriptionId int, ...) (*http.Response, error)
- func (s *SubscriptionsController) PreviewSubscription(ctx context.Context, body *models.CreateSubscriptionRequest) (models.ApiResponse[models.SubscriptionPreviewResponse], error)
- func (s *SubscriptionsController) PurgeSubscription(ctx context.Context, subscriptionId int, ack int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) ReadSubscription(ctx context.Context, subscriptionId int, include []models.SubscriptionInclude) (models.ApiResponse[models.SubscriptionResponse], error)
- func (s *SubscriptionsController) RemoveCouponFromSubscription(ctx context.Context, subscriptionId int, couponCode *string) (models.ApiResponse[string], error)
- func (s *SubscriptionsController) UpdatePrepaidSubscriptionConfiguration(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.PrepaidConfigurationResponse], error)
- func (s *SubscriptionsController) UpdateSubscription(ctx context.Context, subscriptionId int, ...) (models.ApiResponse[models.SubscriptionResponse], error)
- type WebhooksController
- func (w *WebhooksController) CreateEndpoint(ctx context.Context, body *models.CreateOrUpdateEndpointRequest) (models.ApiResponse[models.EndpointResponse], error)
- func (w *WebhooksController) EnableWebhooks(ctx context.Context, body *models.EnableWebhooksRequest) (models.ApiResponse[models.EnableWebhooksResponse], error)
- func (w *WebhooksController) ListEndpoints(ctx context.Context) (models.ApiResponse[[]models.Endpoint], error)
- func (w *WebhooksController) ListWebhooks(ctx context.Context, input ListWebhooksInput) (models.ApiResponse[[]models.WebhookResponse], error)
- func (w *WebhooksController) ReplayWebhooks(ctx context.Context, body *models.ReplayWebhooksRequest) (models.ApiResponse[models.ReplayWebhooksResponse], error)
- func (w *WebhooksController) UpdateEndpoint(ctx context.Context, endpointId int, ...) (models.ApiResponse[models.EndpointResponse], error)
Constants ¶
This section is empty.
Variables ¶
var NewAndAuth = https.NewAndAuth
NewAndAuth creates a new AndAuth.
var NewAuth = https.NewAuth
NewAuth creates a new Auth.
var NewHttpConfiguration = https.NewHttpConfiguration
NewHttpConfiguration creates a new HttpConfiguration.
var NewOrAuth = https.NewOrAuth
NewOrAuth creates a new OrAuth.
var NewRetryConfiguration = https.NewRetryConfiguration
NewRetryConfiguration creates a new RetryConfiguration.
var WithBackoffFactor = https.WithBackoffFactor
WithBackoffFactor sets the BackoffFactor.
var WithHttpMethodsToRetry = https.WithHttpMethodsToRetry
WithHttpMethodsToRetry sets the HttpMethodsToRetry.
var WithHttpStatusCodesToRetry = https.WithHttpStatusCodesToRetry
WithHttpStatusCodesToRetry sets the HttpStatusCodesToRetry.
var WithMaxRetryAttempts = https.WithMaxRetryAttempts
WithMaxRetryAttempts sets the MaxRetryAttempts.
var WithMaximumRetryWaitTime = https.WithMaximumRetryWaitTime
WithMaximumRetryWaitTime sets the MaximumRetryWaitTime.
var WithRetryConfiguration = https.WithRetryConfiguration
WithRetryConfiguration sets the RetryConfiguration.
var WithRetryInterval = https.WithRetryInterval
WithRetryInterval sets the RetryInterval.
var WithRetryOnTimeout = https.WithRetryOnTimeout
WithRetryOnTimeout sets the RetryOnTimeout.
var WithTimeout = https.WithTimeout
WithTimeout sets the Timeout.
var WithTransport = https.WithTransport
WithTransport sets the Transport.
Functions ¶
func NewBaseController ¶
func NewBaseController(cb callBuilderFactory) *baseController
NewBaseController creates a new instance of baseController. It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.
Types ¶
type APIExportsController ¶
type APIExportsController struct {
// contains filtered or unexported fields
}
APIExportsController represents a controller struct.
func NewAPIExportsController ¶
func NewAPIExportsController(baseController baseController) *APIExportsController
NewAPIExportsController creates a new instance of APIExportsController. It takes a baseController as a parameter and returns a pointer to the APIExportsController.
func (*APIExportsController) ExportInvoices ¶
func (a *APIExportsController) ExportInvoices(ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], error)
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. Creates an invoices export and returns a batch job object.
func (*APIExportsController) ExportProformaInvoices ¶
func (a *APIExportsController) ExportProformaInvoices(ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], error)
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. Creates a proforma invoices export and returns a batch job object. Proforma invoices are only available on Relationship Invoicing sites.
func (*APIExportsController) ExportSubscriptions ¶
func (a *APIExportsController) ExportSubscriptions(ctx context.Context) ( models.ApiResponse[models.BatchJobResponse], error)
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. Creates a subscriptions export and returns a batch job object.
func (*APIExportsController) ListExportedInvoices ¶
func (a *APIExportsController) ListExportedInvoices( ctx context.Context, input ListExportedInvoicesInput) ( models.ApiResponse[[]models.Invoice], error)
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. Lists exported invoices for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`.
func (*APIExportsController) ListExportedProformaInvoices ¶
func (a *APIExportsController) ListExportedProformaInvoices( ctx context.Context, input ListExportedProformaInvoicesInput) ( models.ApiResponse[[]models.ProformaInvoice], error)
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. Lists exported proforma invoices for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`.
func (*APIExportsController) ListExportedSubscriptions ¶
func (a *APIExportsController) ListExportedSubscriptions( ctx context.Context, input ListExportedSubscriptionsInput) ( models.ApiResponse[[]models.Subscription], error)
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. Lists exported subscriptions for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`.
func (*APIExportsController) ReadInvoicesExport ¶
func (a *APIExportsController) ReadInvoicesExport( ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], error)
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. Returns a batch job object for an invoices export.
func (*APIExportsController) ReadProformaInvoicesExport ¶
func (a *APIExportsController) ReadProformaInvoicesExport( ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], error)
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. Returns a batch job object for a proforma invoices export. Proforma invoices are only available on Relationship Invoicing sites.
func (*APIExportsController) ReadSubscriptionsExport ¶
func (a *APIExportsController) ReadSubscriptionsExport( ctx context.Context, batchId string) ( models.ApiResponse[models.BatchJobResponse], error)
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. Returns a batch job object for a subscriptions export.
type AdvanceInvoiceController ¶
type AdvanceInvoiceController struct {
// contains filtered or unexported fields
}
AdvanceInvoiceController represents a controller struct.
func NewAdvanceInvoiceController ¶
func NewAdvanceInvoiceController(baseController baseController) *AdvanceInvoiceController
NewAdvanceInvoiceController creates a new instance of AdvanceInvoiceController. It takes a baseController as a parameter and returns a pointer to the AdvanceInvoiceController.
func (*AdvanceInvoiceController) IssueAdvanceInvoice ¶
func (a *AdvanceInvoiceController) IssueAdvanceInvoice( ctx context.Context, subscriptionId int, body *models.IssueAdvanceInvoiceRequest) ( models.ApiResponse[models.Invoice], error)
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. Issues an invoice in advance for a subscription's next renewal date. For the most part, advance invoices function like any other invoice, except they are issued early and have special behavior upon being voided. For more information on advance invoices, including eligibility for generating one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). A subscription can only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists returns an error. Regeneration of the invoice can be forced with the params `force: true`, which voids an advance invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. Consider using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it.
func (*AdvanceInvoiceController) ReadAdvanceInvoice ¶
func (a *AdvanceInvoiceController) ReadAdvanceInvoice( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.Invoice], error)
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. Returns the advance invoice generated for a subscription's upcoming renewal. There can only be one advance invoice per subscription per billing cycle.
func (*AdvanceInvoiceController) VoidAdvanceInvoice ¶
func (a *AdvanceInvoiceController) VoidAdvanceInvoice( ctx context.Context, subscriptionId int, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.Invoice], error)
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. Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. A `reason` is required to void, and the invoice must have an open status. Voiding causes any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, see [Invoice]($m/Invoice).
type BasicAuthCredentials ¶ added in v0.1.0
type BasicAuthCredentials struct {
// contains filtered or unexported fields
}
BasicAuthCredentials represents the credentials required for `BasicAuth` authentication.
func NewBasicAuthCredentials ¶ added in v0.1.0
func NewBasicAuthCredentials( username string, password string) BasicAuthCredentials
NewBasicAuthCredentials creates a new instance of BasicAuthCredentials with provided parameters.
func (BasicAuthCredentials) Authenticator ¶ added in v0.1.0
func (b BasicAuthCredentials) Authenticator() https.HttpInterceptor
Authenticator function returns HttpInterceptor function that provides authentication for API calls.
func (BasicAuthCredentials) Password ¶ added in v0.1.0
func (b BasicAuthCredentials) Password() string
Password returns the password associated with the BasicAuthCredentials.
func (BasicAuthCredentials) Username ¶ added in v0.1.0
func (b BasicAuthCredentials) Username() string
Username returns the username associated with the BasicAuthCredentials.
func (BasicAuthCredentials) Validate ¶ added in v0.1.0
func (b BasicAuthCredentials) Validate() error
Validate function returns validation error associated with the BasicAuthCredentials.
func (BasicAuthCredentials) WithPassword ¶ added in v0.1.0
func (b BasicAuthCredentials) WithPassword(password string) BasicAuthCredentials
WithPassword sets password in BasicAuthCredentials.
func (BasicAuthCredentials) WithUsername ¶ added in v0.1.0
func (b BasicAuthCredentials) WithUsername(username string) BasicAuthCredentials
WithUsername sets username in BasicAuthCredentials.
type BillingPortalController ¶
type BillingPortalController struct {
// contains filtered or unexported fields
}
BillingPortalController represents a controller struct.
func NewBillingPortalController ¶
func NewBillingPortalController(baseController baseController) *BillingPortalController
NewBillingPortalController creates a new instance of BillingPortalController. It takes a baseController as a parameter and returns a pointer to the BillingPortalController.
func (*BillingPortalController) EnableBillingPortalForCustomer ¶
func (b *BillingPortalController) EnableBillingPortalForCustomer( ctx context.Context, customerId int, autoInvite *models.AutoInvite) ( models.ApiResponse[models.CustomerResponse], error)
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. Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. ## Billing Portal Security If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** If you need to provide your customer their Management URL through other means, you can retrieve it [via the API]($e/Billing%20Portal/readBillingPortalLink). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. To prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request every time. For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview).
func (*BillingPortalController) ReadBillingPortalLink ¶
func (b *BillingPortalController) ReadBillingPortalLink( ctx context.Context, customerId int) ( models.ApiResponse[models.PortalManagementLink], error)
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. Returns the exact URL required for a subscriber to access the Billing Portal. ## Management Link Request Rules + When retrieving a management URL, multiple requests for the same customer in a short period return the **same** URL + A new URL is not generated for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date + You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`).
func (*BillingPortalController) ResendBillingPortalInvitation ¶
func (b *BillingPortalController) ResendBillingPortalInvitation( ctx context.Context, customerId int) ( models.ApiResponse[models.ResentInvitation], error)
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. Resends 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 an `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 Customer does not exist, you will receive a `404` error response. ## Limitations This endpoint will only return a JSON response.
func (*BillingPortalController) RevokeBillingPortalAccess ¶
func (b *BillingPortalController) RevokeBillingPortalAccess( ctx context.Context, customerId int) ( models.ApiResponse[models.RevokedInvitation], error)
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. Revokes 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.
type ClientInterface ¶
type ClientInterface interface {
Configuration() Configuration
CloneWithConfiguration(options ...ConfigurationOptions) ClientInterface
APIExportsController() *APIExportsController
AdvanceInvoiceController() *AdvanceInvoiceController
BillingPortalController() *BillingPortalController
CouponsController() *CouponsController
ComponentsController() *ComponentsController
ComponentPricePointsController() *ComponentPricePointsController
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
SubscriptionRenewalsController() *SubscriptionRenewalsController
SubscriptionStatusController() *SubscriptionStatusController
WebhooksController() *WebhooksController
UserAgent() *string
}
Client is an interface representing the main client for accessing configuration and controllers.
func NewClient ¶
func NewClient(configuration Configuration) ClientInterface
NewClient is the constructor for creating a new client instance. It takes a Configuration object as a parameter and returns the Client interface.
type ComponentPricePointsController ¶ added in v0.3.0
type ComponentPricePointsController struct {
// contains filtered or unexported fields
}
ComponentPricePointsController represents a controller struct.
func NewComponentPricePointsController ¶ added in v0.3.0
func NewComponentPricePointsController(baseController baseController) *ComponentPricePointsController
NewComponentPricePointsController creates a new instance of ComponentPricePointsController. It takes a baseController as a parameter and returns a pointer to the ComponentPricePointsController.
func (*ComponentPricePointsController) ArchiveComponentPricePoint ¶ added in v0.3.0
func (c *ComponentPricePointsController) ArchiveComponentPricePoint( ctx context.Context, componentId models.ArchiveComponentPricePointComponentId, pricePointId models.ArchiveComponentPricePointPricePointId) ( models.ApiResponse[models.ComponentPricePointResponse], error)
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. Archives a component price point. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point.
func (*ComponentPricePointsController) BulkCreateComponentPricePoints ¶ added in v0.3.0
func (c *ComponentPricePointsController) BulkCreateComponentPricePoints( ctx context.Context, componentId string, body *models.CreateComponentPricePointsRequest) ( models.ApiResponse[models.ComponentPricePointsResponse], error)
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. Creates multiple component price points in one request.
func (*ComponentPricePointsController) CloneComponentPricePoint ¶ added in v0.9.0
func (c *ComponentPricePointsController) CloneComponentPricePoint( ctx context.Context, componentId models.CloneComponentPricePointComponentId, pricePointId models.CloneComponentPricePointPricePointId, body *models.CloneComponentPricePointRequest) ( models.ApiResponse[models.ComponentPricePointCurrencyOverageResponse], error)
CloneComponentPricePoint takes context, componentId, pricePointId, body as parameters and returns an models.ApiResponse with models.ComponentPricePointCurrencyOverageResponse data and an error if there was an issue with the request or response. Clones a component price point. Custom price points (tied to a specific subscription) cannot be cloned. The following attributes are copied from the source price point: - Pricing scheme - All price tiers (with starting/ending quantities and unit prices) - Tax included setting - Currency prices (if definitive pricing is set) - Overage pricing (for prepaid usage components) - Interval settings (if multi-frequency is enabled) - Event-based billing segments (if applicable)
func (*ComponentPricePointsController) CreateComponentPricePoint ¶ added in v0.3.0
func (c *ComponentPricePointsController) CreateComponentPricePoint( ctx context.Context, componentId int, body *models.CreateComponentPricePointRequest) ( models.ApiResponse[models.ComponentPricePointResponse], error)
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. Creates a price point for an existing component.
func (*ComponentPricePointsController) CreateCurrencyPrices ¶ added in v0.3.0
func (c *ComponentPricePointsController) CreateCurrencyPrices( ctx context.Context, pricePointId int, body *models.CreateCurrencyPricesRequest) ( models.ApiResponse[models.ComponentCurrencyPricesResponse], error)
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. Creates currency prices for a given currency defined at the site level. 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 (*ComponentPricePointsController) ListAllComponentPricePoints ¶ added in v0.3.0
func (c *ComponentPricePointsController) ListAllComponentPricePoints( ctx context.Context, input ListAllComponentPricePointsInput) ( models.ApiResponse[models.ListComponentsPricePointsResponse], error)
ListAllComponentPricePoints takes context, include, page, perPage, direction, filter as parameters and returns an models.ApiResponse with models.ListComponentsPricePointsResponse data and an error if there was an issue with the request or response. Lists all component price points belonging to a site.
func (*ComponentPricePointsController) ListComponentPricePoints ¶ added in v0.3.0
func (c *ComponentPricePointsController) ListComponentPricePoints( ctx context.Context, input ListComponentPricePointsInput) ( models.ApiResponse[models.ComponentPricePointsResponse], error)
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. Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. 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 (*ComponentPricePointsController) PromoteComponentPricePointToDefault ¶ added in v0.3.0
func (c *ComponentPricePointsController) PromoteComponentPricePointToDefault( ctx context.Context, componentId int, pricePointId int) ( models.ApiResponse[models.ComponentResponse], error)
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://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Points-Components) 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 (*ComponentPricePointsController) ReadComponentPricePoint ¶ added in v0.3.0
func (c *ComponentPricePointsController) ReadComponentPricePoint( ctx context.Context, componentId models.ReadComponentPricePointComponentId, pricePointId models.ReadComponentPricePointPricePointId, currencyPrices *bool) ( models.ApiResponse[models.ComponentPricePointCurrencyOverageResponse], error)
ReadComponentPricePoint takes context, componentId, pricePointId, currencyPrices as parameters and returns an models.ApiResponse with models.ComponentPricePointCurrencyOverageResponse data and an error if there was an issue with the request or response. Returns details for a specific component price point. You can achieve this by using either the component price point ID or handle.
func (*ComponentPricePointsController) UnarchiveComponentPricePoint ¶ added in v0.3.0
func (c *ComponentPricePointsController) UnarchiveComponentPricePoint( ctx context.Context, componentId int, pricePointId int) ( models.ApiResponse[models.ComponentPricePointResponse], error)
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. Unarchives a component price point.
func (*ComponentPricePointsController) UpdateComponentPricePoint ¶ added in v0.3.0
func (c *ComponentPricePointsController) UpdateComponentPricePoint( ctx context.Context, componentId models.UpdateComponentPricePointComponentId, pricePointId models.UpdateComponentPricePointPricePointId, body *models.UpdateComponentPricePointRequest) ( models.ApiResponse[models.ComponentPricePointResponse], error)
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. Updates a component price point and its associated prices. 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 (*ComponentPricePointsController) UpdateCurrencyPrices ¶ added in v0.3.0
func (c *ComponentPricePointsController) UpdateCurrencyPrices( ctx context.Context, pricePointId int, body *models.UpdateCurrencyPricesRequest) ( models.ApiResponse[models.ComponentCurrencyPricesResponse], error)
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. Updates currency prices for a given currency defined at the site level. Note: Currency Prices are not able to be updated for custom price points.
type ComponentsController ¶
type ComponentsController struct {
// contains filtered or unexported fields
}
ComponentsController represents a controller struct.
func NewComponentsController ¶
func NewComponentsController(baseController baseController) *ComponentsController
NewComponentsController creates a new instance of ComponentsController. It takes a baseController as a parameter and returns a pointer to the ComponentsController.
func (*ComponentsController) ArchiveComponent ¶
func (c *ComponentsController) ArchiveComponent( ctx context.Context, productFamilyId int, componentId string) ( models.ApiResponse[models.Component], error)
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. Archives the component; all current subscribers will continue to be charged as usual.
func (*ComponentsController) CreateEventBasedComponent ¶ added in v0.1.0
func (c *ComponentsController) CreateEventBasedComponent( ctx context.Context, productFamilyId string, body *models.CreateEBBComponent) ( models.ApiResponse[models.ComponentResponse], error)
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. Creates an event-based component definition under the specified product family. An 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, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error.
func (*ComponentsController) CreateMeteredComponent ¶ added in v0.1.0
func (c *ComponentsController) CreateMeteredComponent( ctx context.Context, productFamilyId string, body *models.CreateMeteredComponent) ( models.ApiResponse[models.ComponentResponse], error)
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. Creates a metered component definition under the specified product family. A 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 Ads 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. #### Hybrid Pricing A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. This does not apply to metered components configured for event-based billing (metric, meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`.
func (*ComponentsController) CreateOnOffComponent ¶ added in v0.1.0
func (c *ComponentsController) CreateOnOffComponent( ctx context.Context, productFamilyId string, body *models.CreateOnOffComponent) ( models.ApiResponse[models.ComponentResponse], error)
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. Creates an On/Off component definition under the specified product family. An 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, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`.
func (*ComponentsController) CreatePrepaidUsageComponent ¶ added in v0.1.0
func (c *ComponentsController) CreatePrepaidUsageComponent( ctx context.Context, productFamilyId string, body *models.CreatePrepaidComponent) ( models.ApiResponse[models.ComponentResponse], error)
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. Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and usage is subsequently tracked against the amount purchased. For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error.
func (*ComponentsController) CreateQuantityBasedComponent ¶ added in v0.1.0
func (c *ComponentsController) CreateQuantityBasedComponent( ctx context.Context, productFamilyId string, body *models.CreateQuantityBasedComponent) ( models.ApiResponse[models.ComponentResponse], error)
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. Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. When defining a Quantity Based component, you can choose one of two types: #### Recurring Recurring quantity-based components are used to bill for the number of some unit (think monthly software user licenses or the number of pairs of socks in 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, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). #### Hybrid Pricing A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`.
func (*ComponentsController) FindComponent ¶ added in v0.1.0
func (c *ComponentsController) FindComponent( ctx context.Context, handle string) ( models.ApiResponse[models.ComponentResponse], error)
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. Returns information for a component matching the provided handle. You can identify your components with a handle so you don't have to save or reference the IDs we generate.
func (*ComponentsController) ListComponents ¶
func (c *ComponentsController) ListComponents( ctx context.Context, input ListComponentsInput) ( models.ApiResponse[[]models.ComponentResponse], error)
ListComponents takes context, dateField, startDate, endDate, startDatetime, endDatetime, includeArchived, page, perPage, filter as parameters and returns an models.ApiResponse with []models.ComponentResponse data and an error if there was an issue with the request or response. Lists components for a site.
func (*ComponentsController) ListComponentsForProductFamily ¶
func (c *ComponentsController) ListComponentsForProductFamily( ctx context.Context, input ListComponentsForProductFamilyInput) ( models.ApiResponse[[]models.ComponentResponse], error)
ListComponentsForProductFamily takes context, productFamilyId, includeArchived, page, perPage, filter, dateField, endDate, endDatetime, startDate, startDatetime as parameters and returns an models.ApiResponse with []models.ComponentResponse data and an error if there was an issue with the request or response. Lists components for a particular product family.
func (*ComponentsController) ReadComponent ¶ added in v0.1.0
func (c *ComponentsController) ReadComponent( ctx context.Context, productFamilyId int, componentId string) ( models.ApiResponse[models.ComponentResponse], error)
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. Returns information regarding a component from a specific product family. You can read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`.
func (*ComponentsController) UpdateComponent ¶
func (c *ComponentsController) UpdateComponent( ctx context.Context, componentId string, body *models.UpdateComponentRequest) ( models.ApiResponse[models.ComponentResponse], error)
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. Updates a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`.
func (*ComponentsController) UpdateProductFamilyComponent ¶
func (c *ComponentsController) UpdateProductFamilyComponent( ctx context.Context, productFamilyId int, componentId string, body *models.UpdateComponentRequest) ( models.ApiResponse[models.ComponentResponse], error)
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. Updates a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`.
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration holds configuration settings.
func CreateConfiguration ¶
func CreateConfiguration(options ...ConfigurationOptions) Configuration
CreateConfiguration creates a new Configuration with the provided options.
func CreateConfigurationFromEnvironment ¶
func CreateConfigurationFromEnvironment(options ...ConfigurationOptions) Configuration
CreateConfigurationFromEnvironment creates a new Configuration with default settings. It also configures various Configuration options.
func DefaultConfiguration ¶
func DefaultConfiguration() Configuration
DefaultConfiguration returns the default Configuration.
func (Configuration) BasicAuthCredentials ¶ added in v0.1.0
func (c Configuration) BasicAuthCredentials() BasicAuthCredentials
BasicAuthCredentials returns the basicAuthCredentials from the Configuration.
func (Configuration) Environment ¶
func (c Configuration) Environment() Environment
Environment returns the environment from the Configuration.
func (Configuration) HttpConfiguration ¶
func (c Configuration) HttpConfiguration() HttpConfiguration
HttpConfiguration returns the httpConfiguration from the Configuration.
func (Configuration) Site ¶ added in v0.5.0
func (c Configuration) Site() string
Site returns the site from the Configuration.
type ConfigurationOptions ¶
type ConfigurationOptions func(*Configuration)
ConfigurationOptions represents a function type that can be used to apply options to the Configuration struct.
func WithBasicAuthCredentials ¶ added in v0.1.0
func WithBasicAuthCredentials(basicAuthCredentials BasicAuthCredentials) ConfigurationOptions
WithBasicAuthCredentials is an option that sets the BasicAuthCredentials in the Configuration.
func WithEnvironment ¶
func WithEnvironment(environment Environment) ConfigurationOptions
WithEnvironment is an option that sets the Environment in the Configuration.
func WithHttpConfiguration ¶
func WithHttpConfiguration(httpConfiguration HttpConfiguration) ConfigurationOptions
WithHttpConfiguration is an option that sets the HttpConfiguration in the Configuration.
func WithSite ¶ added in v0.5.0
func WithSite(site string) ConfigurationOptions
WithSite is an option that sets the Site in the Configuration.
type CouponsController ¶
type CouponsController struct {
// contains filtered or unexported fields
}
CouponsController represents a controller struct.
func NewCouponsController ¶
func NewCouponsController(baseController baseController) *CouponsController
NewCouponsController creates a new instance of CouponsController. It takes a baseController as a parameter and returns a pointer to the CouponsController.
func (*CouponsController) ArchiveCoupon ¶
func (c *CouponsController) ArchiveCoupon( ctx context.Context, productFamilyId int, couponId int) ( models.ApiResponse[models.CouponResponse], error)
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. Archives a coupon, making it unavailable for future use while remaining active on existing subscriptions. Archiving makes that Coupon unavailable for future use, but allows it to remain attached and functional on existing Subscriptions that are using it. The `archived_at` date and time will be assigned.
func (*CouponsController) CreateCoupon ¶
func (c *CouponsController) CreateCoupon( ctx context.Context, productFamilyId int, body *models.CouponRequest) ( models.ApiResponse[models.CouponResponse], error)
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. Creates a coupon under the specified product family. You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI.
func (*CouponsController) CreateCouponSubcodes ¶
func (c *CouponsController) CreateCouponSubcodes( ctx context.Context, couponId int, body *models.CouponSubcodes) ( models.ApiResponse[models.CouponSubcodesResponse], error)
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. Creates subcodes for an existing coupon. 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 When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created. 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://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`. For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions).
func (*CouponsController) CreateOrUpdateCouponCurrencyPrices ¶ added in v0.1.0
func (c *CouponsController) CreateOrUpdateCouponCurrencyPrices( ctx context.Context, couponId int, body *models.CouponCurrencyRequest) ( models.ApiResponse[models.CouponCurrencyResponse], error)
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. Creates and/or updates currency prices for an existing coupon. Multiple prices can be created or updated in a single request but each of the currencies must be defined on the site level already and the coupon must be 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 (*CouponsController) DeleteCouponSubcode ¶
func (c *CouponsController) DeleteCouponSubcode( ctx context.Context, couponId int, subcode string) ( *http.Response, error)
DeleteCouponSubcode takes context, couponId, subcode as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a specific subcode from a coupon. ## Example Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to `DELETE` this coupon subcode would be: ``` http://subdomain.chargify.com/coupons/567/codes/20OFF.<format> ``` 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://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>.
func (*CouponsController) FindCoupon ¶ added in v0.1.0
func (c *CouponsController) FindCoupon( ctx context.Context, productFamilyId *int, code *string, currencyPrices *bool) ( models.ApiResponse[models.CouponResponse], error)
FindCoupon takes context, productFamilyId, code, currencyPrices as parameters and returns an models.ApiResponse with models.CouponResponse data and an error if there was an issue with the request or response. Searches for a coupon by code. If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, you need to specify (either in the URL or as a query string param) the `product_family_id`.
func (*CouponsController) ListCouponSubcodes ¶
func (c *CouponsController) ListCouponSubcodes( ctx context.Context, input ListCouponSubcodesInput) ( models.ApiResponse[models.CouponSubcodes], error)
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. Lists the subcodes attached to a coupon.
func (*CouponsController) ListCoupons ¶
func (c *CouponsController) ListCoupons( ctx context.Context, input ListCouponsInput) ( models.ApiResponse[[]models.CouponResponse], error)
ListCoupons takes context, page, perPage, filter, currencyPrices as parameters and returns an models.ApiResponse with []models.CouponResponse data and an error if there was an issue with the request or response. Lists coupons for a site.
func (*CouponsController) ListCouponsForProductFamily ¶
func (c *CouponsController) ListCouponsForProductFamily( ctx context.Context, input ListCouponsForProductFamilyInput) ( models.ApiResponse[[]models.CouponResponse], error)
ListCouponsForProductFamily takes context, productFamilyId, page, perPage, filter, currencyPrices as parameters and returns an models.ApiResponse with []models.CouponResponse data and an error if there was an issue with the request or response. Lists coupons for a specific product family in a site.
func (*CouponsController) ReadCoupon ¶
func (c *CouponsController) ReadCoupon( ctx context.Context, productFamilyId int, couponId int, currencyPrices *bool) ( models.ApiResponse[models.CouponResponse], error)
ReadCoupon takes context, productFamilyId, couponId, currencyPrices as parameters and returns an models.ApiResponse with models.CouponResponse data and an error if there was an issue with the request or response. Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. If instead you would like to find a Coupon using a Coupon code, use the [Find Coupon]($e/Coupons/findCoupon) endpoint. If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency.
func (*CouponsController) ReadCouponUsage ¶
func (c *CouponsController) ReadCouponUsage( ctx context.Context, productFamilyId int, couponId int) ( models.ApiResponse[[]models.CouponUsage], error)
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. Lists coupon usage details, one entry per product.
func (*CouponsController) UpdateCoupon ¶
func (c *CouponsController) UpdateCoupon( ctx context.Context, productFamilyId int, couponId int, body *models.CouponRequest) ( models.ApiResponse[models.CouponResponse], error)
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. Updates a coupon. You can restrict a coupon to only apply to specific products / components by optionally passing in hashes of `restricted_products` and/or `restricted_components` in the format: `{ "<product/component_id>": boolean_value }`
func (*CouponsController) UpdateCouponSubcodes ¶
func (c *CouponsController) UpdateCouponSubcodes( ctx context.Context, couponId int, body *models.CouponSubcodes) ( models.ApiResponse[models.CouponSubcodesResponse], error)
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. Updates the subcodes for a coupon, replacing all existing subcodes with the new list. 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 (*CouponsController) ValidateCoupon ¶
func (c *CouponsController) ValidateCoupon( ctx context.Context, code string, productFamilyId *int) ( models.ApiResponse[models.CouponResponse], error)
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. Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. Supplying the `product_family_handle` in the URL: ``` https://<subdomain>.chargify.com/product_families/handle:<product_family_handle>/coupons/validate.<format>?code=<coupon_code> ``` Supplying the `product_family_id` as a query parameter: ``` https://<subdomain>.chargify.com/coupons/validate.<format>?code=<coupon_code>&product_family_id=<id> ```
type CustomFieldsController ¶
type CustomFieldsController struct {
// contains filtered or unexported fields
}
CustomFieldsController represents a controller struct.
func NewCustomFieldsController ¶
func NewCustomFieldsController(baseController baseController) *CustomFieldsController
NewCustomFieldsController creates a new instance of CustomFieldsController. It takes a baseController as a parameter and returns a pointer to the CustomFieldsController.
func (*CustomFieldsController) CreateMetadata ¶
func (c *CustomFieldsController) CreateMetadata( ctx context.Context, resourceType models.ResourceType, resourceId int, body *models.CreateMetadataRequest) ( models.ApiResponse[[]models.Metadata], error)
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. Creates metadata and metafields for a specific subscription or customer, or updates metadata values of existing metafields for a subscription or customer. Metadata values are limited to 2 KB in size. If you create metadata on a subscription or customer with a metafield that does not already exist, the metafield is created with the metadata you specify and it is always added as a text field. You can update the input_type for the metafield with the [Update Metafield]($e/Custom%20Fields/updateMetafield) endpoint. >Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers.
func (*CustomFieldsController) CreateMetafields ¶
func (c *CustomFieldsController) CreateMetafields( ctx context.Context, resourceType models.ResourceType, body *models.CreateMetafieldsRequest) ( models.ApiResponse[[]models.Metafield], error)
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. Creates metafields on a Site for either the Subscriptions or Customers resource. Metafields and their metadata are created in the Custom Fields configuration page on your Site. Metafields can be populated with metadata when you create them or later with the [Update Metafield]($e/Custom%20Fields/updateMetafield), [Create Metadata]($e/Custom%20Fields/createMetadata), or [Update Metadata]($e/Custom%20Fields/updateMetadata) endpoints. The Create Metadata and Update Metadata endpoints allow you to add metafields and metadata values to a specific subscription or customer. Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers. > Note: After creating a metafield, the resource type cannot be modified. In the UI and product documentation, metafields and metadata are called Custom Fields. - Metafield is the custom field - Metadata is the data populating the custom field. See [Custom Fields Reference](https://docs.maxio.com/hc/en-us/articles/24266140850573-Custom-Fields-Reference) and [Custom Fields Tab](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscription-Summary-Custom-Fields-Tab) for information on using Custom Fields in the Advanced Billing UI.
func (*CustomFieldsController) DeleteMetadata ¶
func (c *CustomFieldsController) DeleteMetadata( ctx context.Context, resourceType models.ResourceType, resourceId int, name *string, names []string) ( *http.Response, error)
DeleteMetadata takes context, resourceType, resourceId, name, names as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes one or more metafields (and associated metadata) from the specified subscription or customer.
func (*CustomFieldsController) DeleteMetafield ¶
func (c *CustomFieldsController) DeleteMetafield( ctx context.Context, resourceType models.ResourceType, name *string) ( *http.Response, error)
DeleteMetafield takes context, resourceType, name as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a metafield from your Site. Removes the metafield and associated metadata from all Subscriptions or Customers resources on the Site.
func (*CustomFieldsController) ListMetadata ¶
func (c *CustomFieldsController) ListMetadata( ctx context.Context, input ListMetadataInput) ( models.ApiResponse[models.PaginatedMetadata], error)
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. Lists metadata and metafields for a specific customer or subscription.
func (*CustomFieldsController) ListMetadataForResourceType ¶
func (c *CustomFieldsController) ListMetadataForResourceType( ctx context.Context, input ListMetadataForResourceTypeInput) ( models.ApiResponse[models.PaginatedMetadata], error)
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. Lists metadata for a specified array of subscriptions or customers.
func (*CustomFieldsController) ListMetafields ¶
func (c *CustomFieldsController) ListMetafields( ctx context.Context, input ListMetafieldsInput) ( models.ApiResponse[models.ListMetafieldsResponse], error)
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. Lists the metafields and their associated details for a Site and resource type. You can filter the request to a specific metafield.
func (*CustomFieldsController) UpdateMetadata ¶
func (c *CustomFieldsController) UpdateMetadata( ctx context.Context, resourceType models.ResourceType, resourceId int, body *models.UpdateMetadataRequest) ( models.ApiResponse[[]models.Metadata], error)
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. Updates metadata and metafields on the Site and the customer or subscription specified, and updates the metadata value on a subscription or customer. If you update metadata on a subscription or customer with a metafield that does not already exist, the metafield is created with the metadata you specify and it is always added as a text field to the Site and to the subscription or customer you specify. You can update the input_type for the metafield with the Update Metafield endpoint. Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for the Subscription resource and another 100 for the Customer resource.
func (*CustomFieldsController) UpdateMetafield ¶
func (c *CustomFieldsController) UpdateMetafield( ctx context.Context, resourceType models.ResourceType, body *models.UpdateMetafieldsRequest) ( models.ApiResponse[[]models.Metafield], error)
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. Updates metafields on your Site for a resource type. Depending on the request structure, you can update or add metafields and metadata to the Subscriptions or Customers resource. With this endpoint, you can: - Add metafields. If the metafield specified in current_name does not exist, a new metafield is added. >Note: Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscriptions and another 100 for Customers. - Change the name of a metafield. >Note: To keep the metafield name the same and only update the metadata for the metafield, you must use the current metafield name in both the `current_name` and `name` parameters. - Change the input type for the metafield. For example, you can change a metafield input type from text to a dropdown. If you change the input type from text to a dropdown or radio, you must update the specific subscriptions or customers where the metafield was used to reflect the updated metafield and metadata. - Add metadata values to the existing metadata for a dropdown or radio metafield. >Note: Updates to metadata overwrite. To add one or more values, you must specify all metadata values including the new value you want to add. - Add new metadata to a dropdown or radio for a metafield that was created without metadata. - Remove metadata for a dropdown or radio for a metafield. >Note: Updates to metadata overwrite existing values. To remove one or more values, specify all metadata values except those you want to remove. - Add or update scope settings for a metafield. >Note: Scope changes overwrite existing settings. You must specify the complete scope, including the changes you want to make.
type CustomersController ¶
type CustomersController struct {
// contains filtered or unexported fields
}
CustomersController represents a controller struct.
func NewCustomersController ¶
func NewCustomersController(baseController baseController) *CustomersController
NewCustomersController creates a new instance of CustomersController. It takes a baseController as a parameter and returns a pointer to the CustomersController.
func (*CustomersController) CreateCustomer ¶
func (c *CustomersController) CreateCustomer( ctx context.Context, body *models.CreateCustomerRequest) ( models.ApiResponse[models.CustomerResponse], error)
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. Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you can only create one customer for a given reference value. If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store the system-assigned unique ID for the customer, which is in the `id` attribute. For more information, see [Customer Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## Required Country Format Format the country attribute of the customer using the ISO Standard Country codes. Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format Format the state attribute of the customer using the ISO Standard State codes. + US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). + States Outside the US (two to three characters): To find the correct state codes outside the US, go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale You can attribute a language/region to the customer to deliver invoices in any required language. For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale).
func (*CustomersController) DeleteCustomer ¶
DeleteCustomer takes context, id as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes the customer.
func (*CustomersController) ListCustomerSubscriptions ¶
func (c *CustomersController) ListCustomerSubscriptions( ctx context.Context, customerId int) ( models.ApiResponse[[]models.SubscriptionResponse], error)
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. Lists all subscriptions that belong to a customer. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, subscriptions no longer require an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'.
func (*CustomersController) ListCustomers ¶
func (c *CustomersController) ListCustomers( ctx context.Context, input ListCustomersInput) ( models.ApiResponse[[]models.CustomerResponse], error)
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. Lists all customers associated with your site, or filters results using the search parameter. ## 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 an Advanced Billing 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, use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference).
func (*CustomersController) ReadCustomer ¶
func (c *CustomersController) ReadCustomer( ctx context.Context, id int) ( models.ApiResponse[models.CustomerResponse], error)
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. Retrieves the Customer properties by Advanced Billing-generated Customer ID.
func (*CustomersController) ReadCustomerByReference ¶
func (c *CustomersController) ReadCustomerByReference( ctx context.Context, reference string) ( models.ApiResponse[models.CustomerResponse], error)
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. Returns a customer by their unique reference ID. It will return a single match.
func (*CustomersController) UpdateCustomer ¶
func (c *CustomersController) UpdateCustomer( ctx context.Context, id int, body *models.UpdateCustomerRequest) ( models.ApiResponse[models.CustomerResponse], error)
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. Updates the customer.
type Environment ¶
type Environment string
Environment represents available environments.
const ( US Environment = "US" EU Environment = "EU" )
type EventsBasedBillingSegmentsController ¶
type EventsBasedBillingSegmentsController struct {
// contains filtered or unexported fields
}
EventsBasedBillingSegmentsController represents a controller struct.
func NewEventsBasedBillingSegmentsController ¶
func NewEventsBasedBillingSegmentsController(baseController baseController) *EventsBasedBillingSegmentsController
NewEventsBasedBillingSegmentsController creates a new instance of EventsBasedBillingSegmentsController. It takes a baseController as a parameter and returns a pointer to the EventsBasedBillingSegmentsController.
func (*EventsBasedBillingSegmentsController) BulkCreateSegments ¶ added in v0.1.0
func (e *EventsBasedBillingSegmentsController) BulkCreateSegments( ctx context.Context, componentId string, pricePointId string, body *models.BulkCreateSegments) ( models.ApiResponse[models.ListSegmentsResponse], error)
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. Creates 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 (*EventsBasedBillingSegmentsController) BulkUpdateSegments ¶ added in v0.1.0
func (e *EventsBasedBillingSegmentsController) BulkUpdateSegments( ctx context.Context, componentId string, pricePointId string, body *models.BulkUpdateSegments) ( models.ApiResponse[models.ListSegmentsResponse], error)
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. Updates 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 (*EventsBasedBillingSegmentsController) CreateSegment ¶
func (e *EventsBasedBillingSegmentsController) CreateSegment( ctx context.Context, componentId string, pricePointId string, body *models.CreateSegmentRequest) ( models.ApiResponse[models.SegmentResponse], error)
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. Creates a new segment for a component with a 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 (*EventsBasedBillingSegmentsController) DeleteSegment ¶
func (e *EventsBasedBillingSegmentsController) DeleteSegment( ctx context.Context, componentId string, pricePointId string, id float64) ( *http.Response, error)
DeleteSegment takes context, componentId, pricePointId, id as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a segment with the specified ID. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.
func (*EventsBasedBillingSegmentsController) ListSegmentsForPricePoint ¶
func (e *EventsBasedBillingSegmentsController) ListSegmentsForPricePoint( ctx context.Context, input ListSegmentsForPricePointInput) ( models.ApiResponse[models.ListSegmentsResponse], error)
ListSegmentsForPricePoint takes context, componentId, pricePointId, page, perPage, filter as parameters and returns an models.ApiResponse with models.ListSegmentsResponse data and an error if there was an issue with the request or response. Lists segments created for a given price point, in 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 (*EventsBasedBillingSegmentsController) UpdateSegment ¶
func (e *EventsBasedBillingSegmentsController) UpdateSegment( ctx context.Context, componentId string, pricePointId string, id float64, body *models.UpdateSegmentRequest) ( models.ApiResponse[models.SegmentResponse], error)
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. Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment. You can specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.
type EventsController ¶
type EventsController struct {
// contains filtered or unexported fields
}
EventsController represents a controller struct.
func NewEventsController ¶
func NewEventsController(baseController baseController) *EventsController
NewEventsController creates a new instance of EventsController. It takes a baseController as a parameter and returns a pointer to the EventsController.
func (*EventsController) ListEvents ¶
func (e *EventsController) ListEvents( ctx context.Context, input ListEventsInput) ( models.ApiResponse[[]models.EventResponse], error)
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. Lists events for a site. Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. Within the UI, Events are referred to as Site Activity. For more information, see [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). Use query string filters to narrow down results. You can use the `filter` parameter to filter by event key. ### Legacy Filters The following keys are no longer supported. + `payment_failure_recreated` + `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 Key The event type is identified by the key property. See [Event Key]($m/Event%20Key) for a complete list of supported keys. ## Event Specific Data Different event types may include additional data in `event_specific_data` property. While some events share the same schema for `event_specific_data`, others may not include it at all. For precise mappings from key to event_specific_data, refer to [Event]($m/Event). ### Example Here’s an example event for the `subscription_product_change` event: ``` { "event": { "id": 351, "key": "subscription_product_change", "message": "Product changed on Mark Alan'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 Mark Alan'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" } } ``` ## Enhanced Catalog Experience If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. Event name changes: - subscription_product_change → subscription_plan_change - component_allocation_change → allocation_change - component_billing_date_change → product_billing_date_change Message updates: - “Plan changed on Subscription from previous plan to new plan” - “Successful payment for allocation changes to Product on Subscription” - “Failed payment for allocation changes to Product on Subscription”
func (*EventsController) ListSubscriptionEvents ¶
func (e *EventsController) ListSubscriptionEvents( ctx context.Context, input ListSubscriptionEventsInput) ( models.ApiResponse[[]models.EventResponse], error)
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. Lists events for a subscription. ## Event Key The event type is identified by the key property. See [Event Key]($m/Event%20Key) for a complete list of supported keys. ## Event Specific Data Different event types may include additional data in `event_specific_data` property. While some events share the same schema for `event_specific_data`, others may not include it at all. For precise mappings from key to event_specific_data, refer to [Event]($m/Event). ## Enhanced Catalog Experience If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. Event name changes: - subscription_product_change → subscription_plan_change - component_allocation_change → allocation_change - component_billing_date_change → product_billing_date_change Message updates: - “Successful payment for allocation changes to Product on Subscription” - “Failed payment for allocation changes to Product on Subscription” - “Plan changed on Subscription from previous plan to new plan”
func (*EventsController) ReadEventsCount ¶
func (e *EventsController) ReadEventsCount( ctx context.Context, input ReadEventsCountInput) ( models.ApiResponse[models.CountResponse], error)
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. Returns the total count of events for a given site. If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. Event name changes: - subscription_product_change → subscription_plan_change - component_allocation_change → allocation_change - component_billing_date_change → product_billing_date_change Message updates: - “Successful payment for allocation changes to Product on Subscription” - “Failed payment for allocation changes to Product on Subscription” - “Plan changed on Subscription from previous plan to new plan”
type HttpConfiguration ¶
type HttpConfiguration = https.HttpConfiguration
HttpConfiguration holds the configuration options for the client.
func CreateHttpConfiguration ¶
func CreateHttpConfiguration(options ...HttpConfigurationOptions) HttpConfiguration
CreateHttpConfiguration creates a new HttpConfiguration with the provided options.
func DefaultHttpConfiguration ¶
func DefaultHttpConfiguration() HttpConfiguration
DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests. It also configures various HttpConfiguration options.
type HttpConfigurationOptions ¶
type HttpConfigurationOptions = https.HttpConfigurationOptions
HttpConfigurationOptions is a function type that modifies the HttpConfiguration.
type InsightsController ¶
type InsightsController struct {
// contains filtered or unexported fields
}
InsightsController represents a controller struct.
func NewInsightsController ¶
func NewInsightsController(baseController baseController) *InsightsController
NewInsightsController creates a new instance of InsightsController. It takes a baseController as a parameter and returns a pointer to the InsightsController.
func (*InsightsController) ListMrrMovements ¶ added in v0.1.0
func (i *InsightsController) ListMrrMovements( ctx context.Context, input ListMrrMovementsInput) ( models.ApiResponse[models.ListMRRResponse], error)
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 Lists your site's MRR movements. ## Understanding MRR movements This endpoint will aid in accessing your site's [MRR Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Analytics) 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://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Analytics#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 (*InsightsController) ListMrrPerSubscription ¶
func (i *InsightsController) ListMrrPerSubscription( ctx context.Context, input ListMrrPerSubscriptionInput) ( models.ApiResponse[models.SubscriptionMRRResponse], error)
ListMrrPerSubscription takes context, filter, 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 Lists your site's current MRR, including plan and usage breakouts split per subscription.
func (*InsightsController) ReadMrr ¶
func (i *InsightsController) ReadMrr( ctx context.Context, atTime *time.Time, subscriptionId *int) ( models.ApiResponse[models.MRRResponse], error)
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 Returns your site's current MRR, including plan and usage breakouts.
func (*InsightsController) ReadSiteStats ¶
func (i *InsightsController) ReadSiteStats(ctx context.Context) ( models.ApiResponse[models.SiteSummary], error)
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. Returns basic 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 response. ``` https://subdomain.chargify.com/dashboard ```
type InvoicesController ¶
type InvoicesController struct {
// contains filtered or unexported fields
}
InvoicesController represents a controller struct.
func NewInvoicesController ¶
func NewInvoicesController(baseController baseController) *InvoicesController
NewInvoicesController creates a new instance of InvoicesController. It takes a baseController as a parameter and returns a pointer to the InvoicesController.
func (*InvoicesController) CreateInvoice ¶
func (i *InvoicesController) CreateInvoice( ctx context.Context, subscriptionId int, body *models.CreateInvoiceRequest) ( models.ApiResponse[models.InvoiceResponse], error)
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. Creates an ad hoc invoice. ### Basic Behavior You can create a basic invoice by sending an array of line items to this endpoint. Each line item, at a minimum, must include a title, a quantity and 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 item types When defining a line item, You can choose one of 3 types for a line item: #### Custom item As shown in the basic behavior example, 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 supported 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 } ] ... ``` #### Using Coupon Subcodes You can also use coupon subcodes to apply existing coupons with specific subcodes: ```json ... "coupons": [ { "subcode": "SUB1", "product_family_id": 1 } ] ... ``` **Important:** You cannot specify both `code` and `subcode` for the same coupon. Use either: - `code` to apply a main coupon - `subcode` to apply a specific coupon subcode The API response will include both the main coupon code and the subcode used: ```json ... "coupons": [ { "code": "MAIN123", "subcode": "SUB1", "product_family_id": 1, "percentage": 10, "description": "Special discount" } ] ... ``` ### 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`. #### Subcode Coupon `subcode` allows you to apply existing coupons using their subcodes. When a subcode is used, the API response will include both the main coupon code and the specific subcode that was applied. Subcodes are case-insensitive and will be converted to uppercase automatically. #### 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 in your site's time zone. The `issue_date` parameter can be sent to alter the default. Only today or dates in the past are accepted. This date is interpreted and validated in your site's time zone. The format for `issue_date` is `YYYY-MM-DD`. #### 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. 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_instructions` parameter. #### Status By default, invoices will be created with open status. Possible alternative is `draft`.
func (*InvoicesController) DeleteInvoice ¶ added in v0.10.0
func (i *InvoicesController) DeleteInvoice( ctx context.Context, subscriptionId int, uid string) ( *http.Response, error)
DeleteInvoice takes context, subscriptionId, uid as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes an ad hoc invoice while it is in the `draft` state. **Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If the invoice does not belong to the provided subscription, a `404` error is returned. A successful deletion returns a `204 No Content` response and the invoice is permanently removed.
func (*InvoicesController) IssueInvoice ¶
func (i *InvoicesController) IssueInvoice( ctx context.Context, uid string, body *models.IssueInvoiceRequest) ( models.ApiResponse[models.Invoice], error)
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. Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. For Remittance subscriptions, the invoice will go into "open" status and payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. Any prepayments or service credits that exist on the subscription will be automatically applied. Additionally, if the setting is enabled, an email will be sent for the issued invoice. For Automatic subscriptions, prepayments and service credits will apply to the invoice 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 (*InvoicesController) ListConsolidatedInvoiceSegments ¶ added in v0.1.0
func (i *InvoicesController) ListConsolidatedInvoiceSegments( ctx context.Context, input ListConsolidatedInvoiceSegmentsInput) ( models.ApiResponse[models.ConsolidatedInvoice], error)
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. Lists segments for a consolidated invoice. Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`.
func (*InvoicesController) ListCreditNotes ¶
func (i *InvoicesController) ListCreditNotes( ctx context.Context, input ListCreditNotesInput) ( models.ApiResponse[models.ListCreditNotesResponse], error)
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. Lists credit notes for a site. Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, the credit notes returned by this endpoint will exclude the arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the specific field as a key in the query with a value set to `true`.
func (*InvoicesController) ListInvoiceEvents ¶
func (i *InvoicesController) ListInvoiceEvents( ctx context.Context, input ListInvoiceEventsInput) ( models.ApiResponse[models.ListInvoiceEventsResponse], error)
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. Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed event types are: + issue_invoice + apply_credit_note + 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 (*InvoicesController) ListInvoices ¶
func (i *InvoicesController) ListInvoices( ctx context.Context, input ListInvoicesInput) ( models.ApiResponse[models.ListInvoicesResponse], error)
ListInvoices takes context, startDate, endDate, status, subscriptionId, subscriptionGroupUid, consolidationLevel, 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. Lists invoices for a site. By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`.
func (*InvoicesController) PreviewCustomerInformationChanges ¶
func (i *InvoicesController) PreviewCustomerInformationChanges( ctx context.Context, uid string) ( models.ApiResponse[models.CustomerChangesPreviewResponse], error)
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. Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side.
func (*InvoicesController) ReadCreditNote ¶
func (i *InvoicesController) ReadCreditNote( ctx context.Context, uid string) ( models.ApiResponse[models.CreditNote], error)
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. Returns the details for a credit note.
func (*InvoicesController) ReadInvoice ¶
func (i *InvoicesController) ReadInvoice( ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], error)
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. Returns the details for an invoice. ## PDF Invoice retrieval Individual PDF Invoices can be retrieved by using the "Accept" header application/pdf or appending .pdf as the format portion of the URL: ```curl -u <api_key>:x -H Accept:application/pdf -H https://acme.chargify.com/invoices/inv_8gd8tdhtd3hgr.pdf > output_file.pdf URL: `https://<subdomain>.chargify.com/invoices/<uid>.<format>` Method: GET Required parameters: `uid` Response: A single Invoice. ```
func (*InvoicesController) RecordPaymentForInvoice ¶
func (i *InvoicesController) RecordPaymentForInvoice( ctx context.Context, uid string, body *models.CreateInvoicePaymentRequest) ( models.ApiResponse[models.Invoice], error)
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. Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the [Record Payment for Multiple Invoices]($e/Invoices/recordPaymentForMultipleInvoices) endpoint.
func (*InvoicesController) RecordPaymentForMultipleInvoices ¶ added in v0.1.0
func (i *InvoicesController) RecordPaymentForMultipleInvoices( ctx context.Context, body *models.CreateMultiInvoicePaymentRequest) ( models.ApiResponse[models.MultiInvoicePaymentResponse], error)
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. Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum.
func (*InvoicesController) RecordPaymentForSubscription ¶
func (i *InvoicesController) RecordPaymentForSubscription( ctx context.Context, subscriptionId int, body *models.RecordPaymentRequest) ( models.ApiResponse[models.RecordPaymentResponse], error)
RecordPaymentForSubscription takes context, subscriptionId, body as parameters and returns an models.ApiResponse with models.RecordPaymentResponse data and an error if there was an issue with the request or response. Records an external payment made against a subscription that will pay partially or in full one or more invoices. Payment will be applied starting with the oldest open invoice and then next oldest, and so on until the amount of the payment is fully consumed. 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 (*InvoicesController) RefundInvoice ¶
func (i *InvoicesController) RefundInvoice( ctx context.Context, uid string, body *models.RefundInvoiceRequest) ( models.ApiResponse[models.Invoice], error)
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. Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice A refund less than the total of a consolidated invoice will be split across its segments. For a $50.00 refund on a $100.00 consolidated invoice with one $60.00 segment and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00, respectively).
func (*InvoicesController) ReopenInvoice ¶
func (i *InvoicesController) ReopenInvoice( ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], error)
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. Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). Invoices with "canceled" status are no longer considered to be due. Once reopened, they are considered due for payment. Payment may then be captured in one of the following ways: - 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 (*InvoicesController) SendInvoice ¶
func (i *InvoicesController) SendInvoice( ctx context.Context, uid string, body *models.SendInvoiceRequest) ( *http.Response, error)
SendInvoice takes context, uid, body as parameters and returns an *Response and an error if there was an issue with the request or response. Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. 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. The response 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 (*InvoicesController) UpdateCustomerInformation ¶
func (i *InvoicesController) UpdateCustomerInformation( ctx context.Context, uid string) ( models.ApiResponse[models.Invoice], error)
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. Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side.
func (*InvoicesController) UpdateInvoice ¶ added in v0.10.0
func (i *InvoicesController) UpdateInvoice( ctx context.Context, subscriptionId int, uid string, body *models.UpdateInvoiceRequest) ( models.ApiResponse[models.InvoiceResponse], error)
UpdateInvoice takes context, subscriptionId, uid, 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. Updates an ad hoc invoice while it is in the `draft` state. **Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the request returns a `422` error. If the invoice does not belong to the provided subscription, a `404` error is returned. Only the attributes submitted in the request are changed — omitted attributes keep their current values. ### Line Items The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. #### Adding a line item A line item without a `uid` is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, `product_id`, `component_id`, price points, period date ranges, taxes). #### Updating a line item A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. #### Removing a line item A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. Referencing a `uid` which does not exist on the invoice returns a `422` error. ### Coupons When the `coupons` key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation. ### Invoice Options #### Issue Date and Net Terms The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change. #### Addresses The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after an address change. #### Memo and Payment Instructions A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter.
func (*InvoicesController) VoidInvoice ¶
func (i *InvoicesController) VoidInvoice( ctx context.Context, uid string, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.Invoice], error)
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. Voids any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice.
type ListAllComponentPricePointsInput ¶ added in v0.1.0
type ListAllComponentPricePointsInput struct {
// Allows including additional data in the response. Use in query: `include=currency_prices`.
Include *models.ListComponentsPricePointsInclude
// 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`.
Page *int
// 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`.
PerPage *int
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
// Filter to use for List PricePoints operations
Filter *models.ListPricePointsFilter
}
ListAllComponentPricePointsInput represents the input of the ListAllComponentPricePoints endpoint.
type ListAllProductPricePointsInput ¶ added in v0.1.0
type ListAllProductPricePointsInput struct {
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
// Filter to use for List PricePoints operations
Filter *models.ListPricePointsFilter
// Allows including additional data in the response. Use in query: `include=currency_prices`.
Include *models.ListProductsPricePointsInclude
// 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`.
Page *int
// 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`.
PerPage *int
}
ListAllProductPricePointsInput represents the input of the ListAllProductPricePoints endpoint.
type ListChargifyJsPublicKeysInput ¶ added in v0.1.0
type ListChargifyJsPublicKeysInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
}
ListChargifyJsPublicKeysInput represents the input of the ListChargifyJsPublicKeys endpoint.
type ListComponentPricePointsInput ¶ added in v0.1.0
type ListComponentPricePointsInput struct {
// The Advanced Billing id of the component
ComponentId int
// Include an array of currency price data.
CurrencyPrices *bool
// 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`.
Page *int
// 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`.
PerPage *int
// Use in query: `filter[type]=catalog,default`.
FilterType []models.PricePointType
}
ListComponentPricePointsInput represents the input of the ListComponentPricePoints endpoint.
type ListComponentsForProductFamilyInput ¶ added in v0.1.0
type ListComponentsForProductFamilyInput struct {
// The Advanced Billing id of the product family
ProductFamilyId int
// Include archived items.
IncludeArchived *bool
// 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Components operations
Filter *models.ListComponentsFilter
// The type of filter you would like to apply to your search. Use in query `date_field=created_at`.
DateField *models.BasicDateField
// 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.
EndDate *string
// 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.
EndDatetime *string
// 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.
StartDate *string
// 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.
StartDatetime *string
}
ListComponentsForProductFamilyInput represents the input of the ListComponentsForProductFamily endpoint.
type ListComponentsInput ¶ added in v0.1.0
type ListComponentsInput struct {
// The type of filter you would like to apply to your search.
DateField *models.BasicDateField
// 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.
StartDate *string
// 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.
EndDate *string
// 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.
StartDatetime *string
// 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.
EndDatetime *string
// Include archived items.
IncludeArchived *bool
// 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Components operations
Filter *models.ListComponentsFilter
}
ListComponentsInput represents the input of the ListComponents endpoint.
type ListConsolidatedInvoiceSegmentsInput ¶ added in v0.1.0
type ListConsolidatedInvoiceSegmentsInput struct {
// The unique identifier of the consolidated invoice
InvoiceUid string
// 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`.
Page *int
// 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`.
PerPage *int
// Sort direction of the returned segments.
Direction *models.Direction
}
ListConsolidatedInvoiceSegmentsInput represents the input of the ListConsolidatedInvoiceSegments endpoint.
type ListCouponSubcodesInput ¶ added in v0.1.0
type ListCouponSubcodesInput struct {
// The Advanced Billing id of the coupon
CouponId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
}
ListCouponSubcodesInput represents the input of the ListCouponSubcodes endpoint.
type ListCouponsForProductFamilyInput ¶ added in v0.1.0
type ListCouponsForProductFamilyInput struct {
// The Advanced Billing id of the product family to which the coupon belongs
ProductFamilyId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Coupons operations
Filter *models.ListCouponsFilter
// (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`.
CurrencyPrices *bool
}
ListCouponsForProductFamilyInput represents the input of the ListCouponsForProductFamily endpoint.
type ListCouponsInput ¶ added in v0.1.0
type ListCouponsInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Coupons operations
Filter *models.ListCouponsFilter
// (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`.
CurrencyPrices *bool
}
ListCouponsInput represents the input of the ListCoupons endpoint.
type ListCreditNotesInput ¶ added in v0.1.0
type ListCreditNotesInput struct {
// The subscription's Advanced Billing id
SubscriptionId *int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
// Include line items data.
LineItems *bool
// Include discounts data.
Discounts *bool
// Include taxes data.
Taxes *bool
// Include refunds data.
Refunds *bool
// Include applications data.
Applications *bool
}
ListCreditNotesInput represents the input of the ListCreditNotes endpoint.
type ListCustomersInput ¶ added in v0.1.0
type ListCustomersInput struct {
// Direction to sort customers by time of creation
Direction *models.SortingDirection
// 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`.
Page *int
// 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`.
PerPage *int
// The type of filter you would like to apply to your search.
// Use in query: `date_field=created_at`.
DateField *models.BasicDateField
// 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.
StartDate *string
// 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.
EndDate *string
// 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.
StartDatetime *string
// 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.
EndDatetime *string
// A search query by which to filter customers (can be an email, an ID, a reference, organization)
Q *string
}
ListCustomersInput represents the input of the ListCustomers endpoint.
type ListEventsInput ¶ added in v0.1.0
type ListEventsInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// Returns events with an id greater than or equal to the one specified.
SinceId *int64
// Returns events with an id less than or equal to the one specified.
MaxId *int64
// The sort direction of the returned events.
Direction *models.Direction
// You can pass multiple event keys after comma.
// Use in query `filter=signup_success,payment_success`.
Filter []models.EventKey
// The type of filter you would like to apply to your search.
DateField *models.ListEventsDateField
// 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.
StartDate *string
// 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.
EndDate *string
// 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.
StartDatetime *string
// 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.
EndDatetime *string
}
ListEventsInput represents the input of the ListEvents endpoint.
type ListExportedInvoicesInput ¶ added in v0.1.0
type ListExportedInvoicesInput struct {
// Id of a Batch Job.
BatchId string
// 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.
PerPage *int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
}
ListExportedInvoicesInput represents the input of the ListExportedInvoices endpoint.
type ListExportedProformaInvoicesInput ¶ added in v0.1.0
type ListExportedProformaInvoicesInput struct {
// Id of a Batch Job.
BatchId string
// 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.
PerPage *int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
}
ListExportedProformaInvoicesInput represents the input of the ListExportedProformaInvoices endpoint.
type ListExportedSubscriptionsInput ¶ added in v0.1.0
type ListExportedSubscriptionsInput struct {
// Id of a Batch Job.
BatchId string
// 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.
PerPage *int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
}
ListExportedSubscriptionsInput represents the input of the ListExportedSubscriptions endpoint.
type ListInvoiceEventsInput ¶ added in v0.1.0
type ListInvoiceEventsInput struct {
// 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.
SinceDate *string
// 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.
SinceId *int64
// 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`.
Page *int
// 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.
PerPage *int
// Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note.
InvoiceUid *string
// Use this parameter if you want to fetch also invoice events with change_invoice_status type.
WithChangeInvoiceStatus *string
// Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`.
EventTypes []models.InvoiceEventType
}
ListInvoiceEventsInput represents the input of the ListInvoiceEvents endpoint.
type ListInvoicesInput ¶ added in v0.1.0
type ListInvoicesInput struct {
// 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.
StartDate *string
// 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.
EndDate *string
// The current status of the invoice. Allowed Values: draft, open, paid, pending, voided
Status *models.InvoiceStatus
// The subscription's ID.
SubscriptionId *int
// 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.
SubscriptionGroupUid *string
// The consolidation level of the invoice. Allowed Values: none, parent, child or comma-separated lists of thereof, e.g. none,parent.
ConsolidationLevel *string
// 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`.
Page *int
// 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`.
PerPage *int
// The sort direction of the returned invoices.
Direction *models.Direction
// Include line items data.
LineItems *bool
// Include discounts data.
Discounts *bool
// Include taxes data.
Taxes *bool
// Include credits data.
Credits *bool
// Include payments data.
Payments *bool
// Include custom fields data.
CustomFields *bool
// Include refunds data.
Refunds *bool
// The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.
DateField *models.InvoiceDateField
// 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.
StartDatetime *string
// 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.
EndDatetime *string
// Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`.
CustomerIds []int
// Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`.
Number []string
// Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`.
ProductIds []int
// Allows specification of the order of the returned list. Use in query `sort=total_amount`.
Sort *models.InvoiceSortField
}
ListInvoicesInput represents the input of the ListInvoices endpoint.
type ListMetadataForResourceTypeInput ¶ added in v0.1.0
type ListMetadataForResourceTypeInput struct {
// The resource type to which the metafields belong.
ResourceType models.ResourceType
// 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`.
Page *int
// 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`.
PerPage *int
// The type of filter you would like to apply to your search.
DateField *models.BasicDateField
// 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.
StartDate *time.Time
// 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.
EndDate *time.Time
// 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.
StartDatetime *time.Time
// 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.
EndDatetime *time.Time
// Allow to fetch deleted metadata.
WithDeleted *bool
// Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.
ResourceIds []int
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
}
ListMetadataForResourceTypeInput represents the input of the ListMetadataForResourceType endpoint.
type ListMetadataInput ¶ added in v0.1.0
type ListMetadataInput struct {
// The resource type to which the metafields belong.
ResourceType models.ResourceType
// The Advanced Billing id of the customer or the subscription for which the metadata applies
ResourceId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
}
ListMetadataInput represents the input of the ListMetadata endpoint.
type ListMetafieldsInput ¶ added in v0.1.0
type ListMetafieldsInput struct {
// The resource type to which the metafields belong.
ResourceType models.ResourceType
// Filter by the name of the metafield.
Name *string
// 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`.
Page *int
// 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`.
PerPage *int
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
}
ListMetafieldsInput represents the input of the ListMetafields endpoint.
type ListMrrMovementsInput ¶ added in v0.1.0
type ListMrrMovementsInput struct {
// (Optional) Filter results by subscription.
SubscriptionId *int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
}
ListMrrMovementsInput represents the input of the ListMrrMovements endpoint.
type ListMrrPerSubscriptionInput ¶ added in v0.1.0
type ListMrrPerSubscriptionInput struct {
// Filter to use for List MRR per subscription operation
Filter *models.ListMrrFilter
// 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`.
AtTime *string
// 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`.
Page *int
// 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`.
PerPage *int
// Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`.
Direction *models.Direction
}
ListMrrPerSubscriptionInput represents the input of the ListMrrPerSubscription endpoint.
type ListOffersInput ¶ added in v0.1.0
type ListOffersInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// Include archived products. Use in query: `include_archived=true`.
IncludeArchived *bool
}
ListOffersInput represents the input of the ListOffers endpoint.
type ListPaymentProfilesInput ¶ added in v0.1.0
type ListPaymentProfilesInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// The ID of the customer for which you wish to list payment profiles
CustomerId *int
}
ListPaymentProfilesInput represents the input of the ListPaymentProfiles endpoint.
type ListPrepaymentsForSubscriptionGroupInput ¶ added in v0.1.0
type ListPrepaymentsForSubscriptionGroupInput struct {
// The uid of the subscription group
Uid string
// 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Prepayments operations
Filter *models.ListPrepaymentsFilter
}
ListPrepaymentsForSubscriptionGroupInput represents the input of the ListPrepaymentsForSubscriptionGroup endpoint.
type ListPrepaymentsInput ¶ added in v0.1.0
type ListPrepaymentsInput struct {
// The Chargify id of the subscription.
SubscriptionId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Prepayments operations
Filter *models.ListPrepaymentsFilter
}
ListPrepaymentsInput represents the input of the ListPrepayments endpoint.
type ListProductFamiliesInput ¶ added in v0.1.0
type ListProductFamiliesInput struct {
// The type of filter you would like to apply to your search.
// Use in query: `date_field=created_at`.
DateField *models.BasicDateField
// 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.
StartDate *time.Time
// 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.
EndDate *time.Time
// 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.
StartDatetime *time.Time
// 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.
EndDatetime *time.Time
}
ListProductFamiliesInput represents the input of the ListProductFamilies endpoint.
type ListProductPricePointsInput ¶ added in v0.1.0
type ListProductPricePointsInput struct {
// The id or handle of the product. When using the handle, it must be prefixed with `handle:`
ProductId models.ListProductPricePointsInputProductId
// 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`.
Page *int
// 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.
PerPage *int
// (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency.
CurrencyPrices *bool
// Use in query: `filter[type]=catalog,default`.
FilterType []models.PricePointType
// Set to include archived price points in the response.
Archived *bool
}
ListProductPricePointsInput represents the input of the ListProductPricePoints endpoint.
type ListProductsForProductFamilyInput ¶ added in v0.1.0
type ListProductsForProductFamilyInput struct {
// Either the product family's id or its handle prefixed with `handle:`
ProductFamilyId string
// 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`.
Page *int
// 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`.
PerPage *int
// The type of filter you would like to apply to your search.
// Use in query: `date_field=created_at`.
DateField *models.BasicDateField
// Filter to use for List Products operations
Filter *models.ListProductsFilter
// 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.
StartDate *time.Time
// 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.
EndDate *time.Time
// 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.
StartDatetime *time.Time
// 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.
EndDatetime *time.Time
// Include archived products.
IncludeArchived *bool
// Allows including additional data in the response. Use in query `include=prepaid_product_price_point`.
Include *models.ListProductsInclude
}
ListProductsForProductFamilyInput represents the input of the ListProductsForProductFamily endpoint.
type ListProductsInput ¶ added in v0.1.0
type ListProductsInput struct {
// The type of filter you would like to apply to your search.
// Use in query: `date_field=created_at`.
DateField *models.BasicDateField
// Filter to use for List Products operations
Filter *models.ListProductsFilter
// 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.
EndDate *time.Time
// 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.
EndDatetime *time.Time
// 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.
StartDate *time.Time
// 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.
StartDatetime *time.Time
// 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`.
Page *int
// 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`.
PerPage *int
// Include archived products. Use in query: `include_archived=true`.
IncludeArchived *bool
// Allows including additional data in the response. Use in query `include=prepaid_product_price_point`.
Include *models.ListProductsInclude
}
ListProductsInput represents the input of the ListProducts endpoint.
type ListProformaInvoicesInput ¶ added in v0.1.0
type ListProformaInvoicesInput struct {
// The Chargify id of the subscription.
SubscriptionId int
// The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format.
StartDate *string
// The ending date range for the invoice's Due Date, in the YYYY-MM-DD format.
EndDate *string
// The current status of the invoice. Allowed Values: draft, open, paid, pending, voided
Status *models.ProformaInvoiceStatus
// 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`.
Page *int
// 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`.
PerPage *int
// The sort direction of the returned invoices.
Direction *models.Direction
// Include line items data.
LineItems *bool
// Include discounts data.
Discounts *bool
// Include taxes data.
Taxes *bool
// Include credits data.
Credits *bool
// Include payments data.
Payments *bool
// Include custom fields data.
CustomFields *bool
}
ListProformaInvoicesInput represents the input of the ListProformaInvoices endpoint.
type ListReasonCodesInput ¶ added in v0.1.0
type ListReasonCodesInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
}
ListReasonCodesInput represents the input of the ListReasonCodes endpoint.
type ListSalesCommissionSettingsInput ¶ added in v0.1.0
type ListSalesCommissionSettingsInput struct {
// The Chargify id of your seller account
SellerId string
// For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
Authorization *string
// This parameter indicates if records should be fetched from live mode sites. Default value is true.
LiveMode *bool
// 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`.
Page *int
// This parameter indicates how many records to fetch in each request. Default value is 100.
PerPage *int
}
ListSalesCommissionSettingsInput represents the input of the ListSalesCommissionSettings endpoint.
type ListSalesRepsInput ¶ added in v0.1.0
type ListSalesRepsInput struct {
// The Chargify id of your seller account
SellerId string
// For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
Authorization *string
// This parameter indicates if records should be fetched from live mode sites. Default value is true.
LiveMode *bool
// 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`.
Page *int
// This parameter indicates how many records to fetch in each request. Default value is 100.
PerPage *int
}
ListSalesRepsInput represents the input of the ListSalesReps endpoint.
type ListSegmentsForPricePointInput ¶ added in v0.1.0
type ListSegmentsForPricePointInput struct {
// ID or Handle for the Component
ComponentId string
// ID or Handle for the Price Point belonging to the Component
PricePointId string
// 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`.
Page *int
// 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`.
PerPage *int
// Filter to use for List Segments for a Price Point operation
Filter *models.ListSegmentsFilter
}
ListSegmentsForPricePointInput represents the input of the ListSegmentsForPricePoint endpoint.
type ListSubscriptionComponentsForSiteInput ¶ added in v0.1.0
type ListSubscriptionComponentsForSiteInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// The attribute by which to sort. Use in query: `sort=updated_at`.
Sort *models.ListSubscriptionComponentsSort
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
// Filter to use for List Subscription Components For Site operation
Filter *models.ListSubscriptionComponentsForSiteFilter
// The type of filter you'd like to apply to your search. Use in query: `date_field=updated_at`.
DateField *models.SubscriptionListDateField
// 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`.
StartDate *string
// 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`.
StartDatetime *string
// 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`.
EndDate *string
// 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`.
EndDatetime *string
// Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.
SubscriptionIds []int
// Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`.
PricePointIds *models.IncludeNotNull
// Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`.
ProductFamilyIds []int
// Allows including additional data in the response. Use in query `include=subscription,historic_usages`.
Include *models.ListSubscriptionComponentsInclude
}
ListSubscriptionComponentsForSiteInput represents the input of the ListSubscriptionComponentsForSite endpoint.
type ListSubscriptionComponentsInput ¶ added in v0.1.0
type ListSubscriptionComponentsInput struct {
// The Chargify id of the subscription.
SubscriptionId int
// The type of filter you'd like to apply to your search. Use in query `date_field=updated_at`.
DateField *models.SubscriptionListDateField
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
// Filter to use for List Subscription Components operation
Filter *models.ListSubscriptionComponentsFilter
// 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.
EndDate *string
// 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.
EndDatetime *string
// Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`.
PricePointIds *models.IncludeNotNull
// Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`.
ProductFamilyIds []int
// The attribute by which to sort. Use in query `sort=updated_at`.
Sort *models.ListSubscriptionComponentsSort
// 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.
StartDate *string
// 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.
StartDatetime *string
// Allows including additional data in the response. Use in query `include=subscription,historic_usages`.
Include []models.ListSubscriptionComponentsInclude
// If in_use is set to true, it returns only components that are currently in use. However, if it's set to false or not provided, it returns all components connected with the subscription.
InUse *bool
}
ListSubscriptionComponentsInput represents the input of the ListSubscriptionComponents endpoint.
type ListSubscriptionEventsInput ¶ added in v0.1.0
type ListSubscriptionEventsInput struct {
// The Chargify id of the subscription.
SubscriptionId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
// Returns events with an id greater than or equal to the one specified.
SinceId *int64
// Returns events with an id less than or equal to the one specified.
MaxId *int64
// The sort direction of the returned events.
Direction *models.Direction
// You can pass multiple event keys after comma.
// Use in query `filter=signup_success,payment_success`.
Filter []models.EventKey
}
ListSubscriptionEventsInput represents the input of the ListSubscriptionEvents endpoint.
type ListSubscriptionGroupProformaInvoicesInput ¶ added in v0.1.0
type ListSubscriptionGroupProformaInvoicesInput struct {
// The uid of the subscription group
Uid string
// Include line items data.
LineItems *bool
// Include discounts data.
Discounts *bool
// Include taxes data.
Taxes *bool
// Include credits data.
Credits *bool
// Include payments data.
Payments *bool
// Include custom fields data.
CustomFields *bool
}
ListSubscriptionGroupProformaInvoicesInput represents the input of the ListSubscriptionGroupProformaInvoices endpoint.
type ListSubscriptionGroupsInput ¶ added in v0.1.0
type ListSubscriptionGroupsInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// 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`
Include []models.SubscriptionGroupsListInclude
}
ListSubscriptionGroupsInput represents the input of the ListSubscriptionGroups endpoint.
type ListSubscriptionNotesInput ¶ added in v0.1.0
type ListSubscriptionNotesInput struct {
// The Chargify id of the subscription.
SubscriptionId int
// Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start 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`.
Page *int
// 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`.
PerPage *int
}
ListSubscriptionNotesInput represents the input of the ListSubscriptionNotes endpoint.
type ListSubscriptionsInput ¶ added in v0.1.0
type ListSubscriptionsInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// The attribute by which to sort
Sort *models.SubscriptionSort
// Controls the order in which results are returned.
// Use in query `direction=asc`.
Direction *models.SortingDirection
// The current state of the subscription
State *models.SubscriptionStateFilter
// Filter subscriptions by product. Accepts product ID or exact product name. Product handle is not supported.
Product *models.ListSubscriptionsInputProduct
// Search string.
Q *string
// Scope of fields used by the q search.
QScope *models.QScope
// The Advanced Billing id of the customer.
CustomerId *int
// The ID of the product price point. If supplied, product is required.
ProductPricePointId *int
// The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.)
Coupon *int
// The coupon code currently applied to the subscription
CouponCode *string
// The collection method for the subscription.
CollectionMethod *models.CollectionMethod1
// Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta feature. See [Understand Branding Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) for more information.
BrandingThemeId *int
// 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
DateField *models.SubscriptionDateField
// 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`.
StartDate *time.Time
// 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`.
EndDate *time.Time
// 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`.
StartDatetime *time.Time
// 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`.
EndDatetime *time.Time
// The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`.
Metadata map[string]string
// Filter by whether a subscription is in a group.
GroupStatus *models.GroupStatus
// Filter by dunning exemption status.
DunningExemption *bool
// Comma-separated payment gateway identifiers.
PaymentGateways *string
// Comma-separated currency codes.
Currencies *string
// Allows including additional data in the response. Use in query: `include[]=self_service_page_token`.
Include []models.SubscriptionListInclude
}
ListSubscriptionsInput represents the input of the ListSubscriptions endpoint.
type ListUsagesInput ¶ added in v0.1.0
type ListUsagesInput struct {
// Either the Advanced Billing subscription ID (integer) or the subscription reference (string). Important: In cases where a numeric string value matches both an existing subscription ID and an existing subscription reference, the system will prioritize the subscription ID lookup. For example, if both subscription ID 123 and subscription reference "123" exist, passing "123" will return the subscription with ID 123.
SubscriptionIdOrReference models.ListUsagesInputSubscriptionIdOrReference
// Either the Advanced Billing id for the component or the component's handle prefixed by `handle:`
ComponentId models.ListUsagesInputComponentId
// Returns usages with an id greater than or equal to the one specified.
SinceId *int64
// Returns usages with an id less than or equal to the one specified.
MaxId *int64
// Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified.
SinceDate *time.Time
// Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified.
UntilDate *time.Time
// 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`.
Page *int
// 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`.
PerPage *int
}
ListUsagesInput represents the input of the ListUsages endpoint.
type ListWebhooksInput ¶ added in v0.1.0
type ListWebhooksInput struct {
// Webhooks with matching status would be returned.
Status *models.WebhookStatus
// Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified.
SinceDate *string
// Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one specified.
UntilDate *string
// 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`.
Page *int
// 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`.
PerPage *int
// The order in which the Webhooks are returned.
Order *models.WebhookOrder
// The Advanced Billing id of a subscription you'd like to filter for
Subscription *int
}
ListWebhooksInput represents the input of the ListWebhooks endpoint.
type OffersController ¶
type OffersController struct {
// contains filtered or unexported fields
}
OffersController represents a controller struct.
func NewOffersController ¶
func NewOffersController(baseController baseController) *OffersController
NewOffersController creates a new instance of OffersController. It takes a baseController as a parameter and returns a pointer to the OffersController.
func (*OffersController) ArchiveOffer ¶
ArchiveOffer takes context, offerId as parameters and returns an *Response and an error if there was an issue with the request or response. Archives an existing offer. Please provide an `offer_id` in order to archive the correct item.
func (*OffersController) CreateOffer ¶
func (o *OffersController) CreateOffer( ctx context.Context, body *models.CreateOfferRequest) ( models.ApiResponse[models.OfferResponse], error)
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. Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point You can optionally pass in a `product_price_point_id` that corresponds with the `product_id` and the offer will use that price point. If a `product_price_point_id` is not passed in, the product's default price point will be used.
func (*OffersController) ListOffers ¶
func (o *OffersController) ListOffers( ctx context.Context, input ListOffersInput) ( models.ApiResponse[models.ListOffersResponse], error)
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. Lists offers for a site.
func (*OffersController) ReadOffer ¶ added in v0.1.0
func (o *OffersController) ReadOffer( ctx context.Context, offerId int) ( models.ApiResponse[models.OfferResponse], error)
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. Returns a specific offer's attributes. This is different from listing all offers for a site, as it requires an `offer_id`.
func (*OffersController) UnarchiveOffer ¶
func (o *OffersController) UnarchiveOffer( ctx context.Context, offerId int) ( *http.Response, error)
UnarchiveOffer takes context, offerId as parameters and returns an *Response and an error if there was an issue with the request or response. Unarchives a previously archived offer. Please provide an `offer_id` in order to unarchive the correct item.
type PaymentProfilesController ¶
type PaymentProfilesController struct {
// contains filtered or unexported fields
}
PaymentProfilesController represents a controller struct.
func NewPaymentProfilesController ¶
func NewPaymentProfilesController(baseController baseController) *PaymentProfilesController
NewPaymentProfilesController creates a new instance of PaymentProfilesController. It takes a baseController as a parameter and returns a pointer to the PaymentProfilesController.
func (*PaymentProfilesController) ChangeSubscriptionDefaultPaymentProfile ¶ added in v0.1.0
func (p *PaymentProfilesController) ChangeSubscriptionDefaultPaymentProfile( ctx context.Context, subscriptionId int, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], error)
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. Changes the default payment profile on the subscription to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint.
func (*PaymentProfilesController) ChangeSubscriptionGroupDefaultPaymentProfile ¶ added in v0.1.0
func (p *PaymentProfilesController) ChangeSubscriptionGroupDefaultPaymentProfile( ctx context.Context, uid string, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], error)
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. Changes the default payment profile on the subscription group to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. The new payment profile must belong to the subscription group's customer, otherwise you will receive an error.
func (*PaymentProfilesController) CreatePaymentProfile ¶
func (p *PaymentProfilesController) CreatePaymentProfile( ctx context.Context, body *models.CreatePaymentProfileRequest) ( models.ApiResponse[models.PaymentProfileResponse], error)
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. Creates a payment profile for a customer. When you create a new payment profile for a customer via the API, it does not automatically make the profile current for any of the customer’s subscriptions. To use the payment profile as the default, you must set it explicitly for the subscription or subscription group. Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating payment profiles. Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. See the following articles to learn more about subscriptions and payments: + [Subscriber Payment Details](https://maxio.zendesk.com/hc/en-us/articles/24251599929613-Subscription-Summary-Payment-Details-Tab) + [Self Service Pages](https://maxio.zendesk.com/hc/en-us/articles/24261425318541-Self-Service-Pages) (Allows credit card updates by Subscriber) + [Public Signup Pages payment settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557-Individual-Page-Settings) + [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) + [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview) + [Maxio.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) + [Maxio.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) + [Maxio.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Maxio.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) + [Maxio.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) + [Maxio.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) + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) + [Full documentation on Stripe BECS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) + [Full documentation on Stripe BACS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*PaymentProfilesController) DeleteSubscriptionGroupPaymentProfile ¶
func (p *PaymentProfilesController) DeleteSubscriptionGroupPaymentProfile( ctx context.Context, uid string, paymentProfileId int) ( *http.Response, error)
DeleteSubscriptionGroupPaymentProfile takes context, uid, paymentProfileId as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes 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 (*PaymentProfilesController) DeleteSubscriptionsPaymentProfile ¶
func (p *PaymentProfilesController) DeleteSubscriptionsPaymentProfile( ctx context.Context, subscriptionId int, paymentProfileId int) ( *http.Response, error)
DeleteSubscriptionsPaymentProfile takes context, subscriptionId, paymentProfileId as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a payment profile belonging to the customer on the subscription. If the customer has multiple subscriptions, the payment profile is removed from all of them. If you delete the default payment profile for a subscription, you need to specify another payment profile to be the default through the API, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present).
func (*PaymentProfilesController) DeleteUnusedPaymentProfile ¶
func (p *PaymentProfilesController) DeleteUnusedPaymentProfile( ctx context.Context, paymentProfileId int) ( *http.Response, error)
DeleteUnusedPaymentProfile takes context, paymentProfileId as parameters and returns an *Response 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, an error message is returned.
func (*PaymentProfilesController) ListPaymentProfiles ¶
func (p *PaymentProfilesController) ListPaymentProfiles( ctx context.Context, input ListPaymentProfilesInput) ( models.ApiResponse[[]models.PaymentProfileResponse], error)
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. Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array.
func (*PaymentProfilesController) ReadOneTimeToken ¶
func (p *PaymentProfilesController) ReadOneTimeToken( ctx context.Context, chargifyToken string) ( models.ApiResponse[models.GetOneTimeTokenRequest], error)
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. Returns the one-time token data, including credit card or ACH details, associated with the provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. To obtain a One Time Token you have to use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0).
func (*PaymentProfilesController) ReadPaymentProfile ¶
func (p *PaymentProfilesController) ReadPaymentProfile( ctx context.Context, paymentProfileId int) ( models.ApiResponse[models.PaymentProfileResponse], error)
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. Returns a payment profile identified by its unique ID. 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", "created_at": "2025-01-01T00:00:00-05:00", "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", "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 (*PaymentProfilesController) SendRequestUpdatePaymentEmail ¶
func (p *PaymentProfilesController) SendRequestUpdatePaymentEmail( ctx context.Context, subscriptionId int) ( *http.Response, error)
SendRequestUpdatePaymentEmail takes context, subscriptionId as parameters and returns an *Response and an error if there was an issue with the request or response. Sends a "request payment update" email to the customer associated with the subscription. If you attempt to send a "request payment update" email more than five times within a 30-minute period, you will receive a `422` response with an error message in the body. This error message will indicate that the request has been rejected due to excessive attempts, and will provide instructions on how to resubmit the request. 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 (*PaymentProfilesController) UpdatePaymentProfile ¶
func (p *PaymentProfilesController) UpdatePaymentProfile( ctx context.Context, paymentProfileId int, body *models.UpdatePaymentProfileRequest) ( models.ApiResponse[models.PaymentProfileResponse], error)
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. Updates a 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. 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**, Advanced Billing 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 (*PaymentProfilesController) VerifyBankAccount ¶
func (p *PaymentProfilesController) VerifyBankAccount( ctx context.Context, bankAccountId int, body *models.BankAccountVerificationRequest) ( models.ApiResponse[models.BankAccountResponse], error)
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. Verifies a bank account. Submit the two small deposit amounts the customer received in their bank account to verify the bank account. (Stripe only)
type ProductFamiliesController ¶
type ProductFamiliesController struct {
// contains filtered or unexported fields
}
ProductFamiliesController represents a controller struct.
func NewProductFamiliesController ¶
func NewProductFamiliesController(baseController baseController) *ProductFamiliesController
NewProductFamiliesController creates a new instance of ProductFamiliesController. It takes a baseController as a parameter and returns a pointer to the ProductFamiliesController.
func (*ProductFamiliesController) CreateProductFamily ¶
func (p *ProductFamiliesController) CreateProductFamily( ctx context.Context, body *models.CreateProductFamilyRequest) ( models.ApiResponse[models.ProductFamilyResponse], error)
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. Creates a Product Family within your site. Create a Product Family to act as a container for your products, components, and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families).
func (*ProductFamiliesController) ListProductFamilies ¶
func (p *ProductFamiliesController) ListProductFamilies( ctx context.Context, input ListProductFamiliesInput) ( models.ApiResponse[[]models.ProductFamilyResponse], error)
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. Lists Product Families for a site.
func (*ProductFamiliesController) ListProductsForProductFamily ¶
func (p *ProductFamiliesController) ListProductsForProductFamily( ctx context.Context, input ListProductsForProductFamilyInput) ( models.ApiResponse[[]models.ProductResponse], error)
ListProductsForProductFamily takes context, productFamilyId, page, perPage, dateField, filter, startDate, endDate, startDatetime, endDatetime, includeArchived, include as parameters and returns an models.ApiResponse with []models.ProductResponse data and an error if there was an issue with the request or response. Retrieves a list of Products belonging to a Product Family.
func (*ProductFamiliesController) ReadProductFamily ¶
func (p *ProductFamiliesController) ReadProductFamily( ctx context.Context, id int) ( models.ApiResponse[models.ProductFamilyResponse], error)
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. Retrieves 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.
type ProductPricePointsController ¶
type ProductPricePointsController struct {
// contains filtered or unexported fields
}
ProductPricePointsController represents a controller struct.
func NewProductPricePointsController ¶
func NewProductPricePointsController(baseController baseController) *ProductPricePointsController
NewProductPricePointsController creates a new instance of ProductPricePointsController. It takes a baseController as a parameter and returns a pointer to the ProductPricePointsController.
func (*ProductPricePointsController) ArchiveProductPricePoint ¶
func (p *ProductPricePointsController) ArchiveProductPricePoint( ctx context.Context, productId models.ArchiveProductPricePointProductId, pricePointId models.ArchiveProductPricePointPricePointId) ( models.ApiResponse[models.ProductPricePointResponse], error)
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. Archives a product price point.
func (*ProductPricePointsController) BulkCreateProductPricePoints ¶ added in v0.1.0
func (p *ProductPricePointsController) BulkCreateProductPricePoints( ctx context.Context, productId int, body *models.BulkCreateProductPricePointsRequest) ( models.ApiResponse[models.BulkCreateProductPricePointsResponse], error)
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. Creates multiple product price points in one request.
func (*ProductPricePointsController) CreateProductCurrencyPrices ¶
func (p *ProductPricePointsController) CreateProductCurrencyPrices( ctx context.Context, productPricePointId int, body *models.CreateProductCurrencyPricesRequest) ( models.ApiResponse[models.CurrencyPricesResponse], error)
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. Creates 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 (*ProductPricePointsController) CreateProductPricePoint ¶
func (p *ProductPricePointsController) CreateProductPricePoint( ctx context.Context, productId models.CreateProductPricePointProductId, body *models.CreateProductPricePointRequest) ( models.ApiResponse[models.ProductPricePointResponse], error)
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. Creates a Product Price Point. See the [Product Price Point](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Product-Price-Points) documentation for details.
func (*ProductPricePointsController) ListAllProductPricePoints ¶
func (p *ProductPricePointsController) ListAllProductPricePoints( ctx context.Context, input ListAllProductPricePointsInput) ( models.ApiResponse[models.ListProductPricePointsResponse], error)
ListAllProductPricePoints takes context, direction, filter, 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. Lists Product Price Points belonging to a site.
func (*ProductPricePointsController) ListProductPricePoints ¶
func (p *ProductPricePointsController) ListProductPricePoints( ctx context.Context, input ListProductPricePointsInput) ( models.ApiResponse[models.ListProductPricePointsResponse], error)
ListProductPricePoints takes context, productId, page, perPage, currencyPrices, filterType, archived as parameters and returns an models.ApiResponse with models.ListProductPricePointsResponse data and an error if there was an issue with the request or response. Retrieves a list of product price points.
func (*ProductPricePointsController) PromoteProductPricePointToDefault ¶
func (p *ProductPricePointsController) PromoteProductPricePointToDefault( ctx context.Context, productId int, pricePointId int) ( models.ApiResponse[models.ProductResponse], error)
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. Sets a product price point as the default for the product. Note: Custom product price points cannot be set as the default for a product.
func (*ProductPricePointsController) ReadProductPricePoint ¶
func (p *ProductPricePointsController) ReadProductPricePoint( ctx context.Context, productId models.ReadProductPricePointProductId, pricePointId models.ReadProductPricePointPricePointId, currencyPrices *bool) ( models.ApiResponse[models.ProductPricePointResponse], error)
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. Returns details for a specific product price point. You can achieve this by using either the product price point ID or handle.
func (*ProductPricePointsController) UnarchiveProductPricePoint ¶
func (p *ProductPricePointsController) UnarchiveProductPricePoint( ctx context.Context, productId int, pricePointId int) ( models.ApiResponse[models.ProductPricePointResponse], error)
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. Unarchives an archived product price point.
func (*ProductPricePointsController) UpdateProductCurrencyPrices ¶
func (p *ProductPricePointsController) UpdateProductCurrencyPrices( ctx context.Context, productPricePointId int, body *models.UpdateCurrencyPricesRequest) ( models.ApiResponse[models.CurrencyPricesResponse], error)
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. Updates 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 cannot be updated for custom product price points.
func (*ProductPricePointsController) UpdateProductPricePoint ¶
func (p *ProductPricePointsController) UpdateProductPricePoint( ctx context.Context, productId models.UpdateProductPricePointProductId, pricePointId models.UpdateProductPricePointPricePointId, body *models.UpdateProductPricePointRequest) ( models.ApiResponse[models.ProductPricePointResponse], error)
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. Updates a product price point. Note: Custom product price points cannot be updated.
type ProductsController ¶
type ProductsController struct {
// contains filtered or unexported fields
}
ProductsController represents a controller struct.
func NewProductsController ¶
func NewProductsController(baseController baseController) *ProductsController
NewProductsController creates a new instance of ProductsController. It takes a baseController as a parameter and returns a pointer to the ProductsController.
func (*ProductsController) ArchiveProduct ¶
func (p *ProductsController) ArchiveProduct( ctx context.Context, productId int) ( models.ApiResponse[models.ProductResponse], error)
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. Archives the product. All current subscribers will be unaffected; 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 (*ProductsController) CreateProduct ¶
func (p *ProductsController) CreateProduct( ctx context.Context, productFamilyId string, body *models.CreateOrUpdateProductRequest) ( models.ApiResponse[models.ProductResponse], error)
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. Creates a product in your site. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. For more information, see: + [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations)
func (*ProductsController) ListProducts ¶
func (p *ProductsController) ListProducts( ctx context.Context, input ListProductsInput) ( models.ApiResponse[[]models.ProductResponse], error)
ListProducts takes context, dateField, filter, endDate, endDatetime, startDate, startDatetime, page, perPage, includeArchived, include as parameters and returns an models.ApiResponse with []models.ProductResponse data and an error if there was an issue with the request or response. Lists products belonging to a site.
func (*ProductsController) ReadProduct ¶
func (p *ProductsController) ReadProduct( ctx context.Context, productId int) ( models.ApiResponse[models.ProductResponse], error)
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. Reads the current details of a product.
func (*ProductsController) ReadProductByHandle ¶
func (p *ProductsController) ReadProductByHandle( ctx context.Context, apiHandle string) ( models.ApiResponse[models.ProductResponse], error)
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. Retrieves a Product object by its `api_handle`.
func (*ProductsController) UpdateProduct ¶
func (p *ProductsController) UpdateProduct( ctx context.Context, productId int, body *models.CreateOrUpdateProductRequest) ( models.ApiResponse[models.ProductResponse], error)
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. Updates 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.
type ProformaInvoicesController ¶
type ProformaInvoicesController struct {
// contains filtered or unexported fields
}
ProformaInvoicesController represents a controller struct.
func NewProformaInvoicesController ¶
func NewProformaInvoicesController(baseController baseController) *ProformaInvoicesController
NewProformaInvoicesController creates a new instance of ProformaInvoicesController. It takes a baseController as a parameter and returns a pointer to the ProformaInvoicesController.
func (*ProformaInvoicesController) CreateConsolidatedProformaInvoice ¶
func (p *ProformaInvoicesController) CreateConsolidatedProformaInvoice( ctx context.Context, uid string) ( *http.Response, error)
CreateConsolidatedProformaInvoice takes context, uid as parameters and returns an *Response and an error if there was an issue with the request or response. Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated proforma invoice, you can poll the subscription group listing for proforma invoices; only one consolidated proforma invoice can be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. ## Restrictions 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 (*ProformaInvoicesController) CreateProformaInvoice ¶
func (p *ProformaInvoicesController) CreateProformaInvoice( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.ProformaInvoice], error)
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. Creates a proforma invoice and returns 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, 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 (*ProformaInvoicesController) CreateSignupProformaInvoice ¶
func (p *ProformaInvoicesController) CreateSignupProformaInvoice( ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.ProformaInvoice], error)
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. Creates a proforma invoice to preview costs before a subscription's signup. This endpoint is only available for Relationship Invoicing sites and cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. 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 (*ProformaInvoicesController) DeliverProformaInvoice ¶ added in v0.9.0
func (p *ProformaInvoicesController) DeliverProformaInvoice( ctx context.Context, proformaInvoiceUid string, body *models.DeliverProformaInvoiceRequest) ( models.ApiResponse[models.ProformaInvoice], error)
DeliverProformaInvoice 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. Delivers a proforma invoice programmatically via email. Supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. If `recipient_emails` is omitted, the system will fall back to the primary recipient derived from the invoice or subscription. At least one recipient must be present, either via the request body or via this default behavior, so an empty body may still succeed when defaults are available.
func (*ProformaInvoicesController) ListProformaInvoices ¶
func (p *ProformaInvoicesController) ListProformaInvoices( ctx context.Context, input ListProformaInvoicesInput) ( models.ApiResponse[models.ListProformaInvoicesResponse], error)
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.ListProformaInvoicesResponse data and an error if there was an issue with the request or response. Lists proforma invoices for a subscription. By default, results 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 (*ProformaInvoicesController) ListSubscriptionGroupProformaInvoices ¶
func (p *ProformaInvoicesController) ListSubscriptionGroupProformaInvoices( ctx context.Context, input ListSubscriptionGroupProformaInvoicesInput) ( models.ApiResponse[models.ListProformaInvoicesResponse], error)
ListSubscriptionGroupProformaInvoices takes context, uid, lineItems, discounts, taxes, credits, payments, customFields as parameters and returns an models.ApiResponse with models.ListProformaInvoicesResponse data and an error if there was an issue with the request or response. Lists proforma invoices with a `consolidation_level` of parent for the subscription group. 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 (*ProformaInvoicesController) PreviewProformaInvoice ¶
func (p *ProformaInvoicesController) PreviewProformaInvoice( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.ProformaInvoice], error)
PreviewProformaInvoice 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. Previews the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. 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 (*ProformaInvoicesController) PreviewSignupProformaInvoice ¶
func (p *ProformaInvoicesController) PreviewSignupProformaInvoice( ctx context.Context, include *models.CreateSignupProformaPreviewInclude, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SignupProformaPreviewResponse], error)
PreviewSignupProformaInvoice takes context, include, 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. Creates a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. This endpoint is only available for Relationship Invoicing sites and cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. You have the option of 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 (*ProformaInvoicesController) ReadProformaInvoice ¶
func (p *ProformaInvoicesController) ReadProformaInvoice( ctx context.Context, proformaInvoiceUid string) ( models.ApiResponse[models.ProformaInvoice], error)
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. Returns the details of an existing proforma invoice. ## Restrictions Proforma invoices are only available on Relationship Invoicing sites.
func (*ProformaInvoicesController) VoidProformaInvoice ¶
func (p *ProformaInvoicesController) VoidProformaInvoice( ctx context.Context, proformaInvoiceUid string, body *models.VoidInvoiceRequest) ( models.ApiResponse[models.ProformaInvoice], error)
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. Voids 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.
type ReadEventsCountInput ¶ added in v0.1.0
type ReadEventsCountInput struct {
// 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`.
Page *int
// 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`.
PerPage *int
// Returns events with an id greater than or equal to the one specified.
SinceId *int64
// Returns events with an id less than or equal to the one specified.
MaxId *int64
// The sort direction of the returned events.
Direction *models.Direction
// You can pass multiple event keys after comma.
// Use in query `filter=signup_success,payment_success`.
Filter []models.EventKey
}
ReadEventsCountInput represents the input of the ReadEventsCount endpoint.
type ReasonCodesController ¶
type ReasonCodesController struct {
// contains filtered or unexported fields
}
ReasonCodesController represents a controller struct.
func NewReasonCodesController ¶
func NewReasonCodesController(baseController baseController) *ReasonCodesController
NewReasonCodesController creates a new instance of ReasonCodesController. It takes a baseController as a parameter and returns a pointer to the ReasonCodesController.
func (*ReasonCodesController) CreateReasonCode ¶
func (r *ReasonCodesController) CreateReasonCode( ctx context.Context, body *models.CreateReasonCodeRequest) ( models.ApiResponse[models.ReasonCodeResponse], error)
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. Creates a reason code for a given site. Reason Codes are a way to gain a high-level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes).
func (*ReasonCodesController) DeleteReasonCode ¶
func (r *ReasonCodesController) DeleteReasonCode( ctx context.Context, reasonCodeId int) ( models.ApiResponse[models.OkResponse], error)
DeleteReasonCode takes context, reasonCodeId as parameters and returns an models.ApiResponse with models.OkResponse data and an error if there was an issue with the request or response. Deletes a reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversible.
func (*ReasonCodesController) ListReasonCodes ¶
func (r *ReasonCodesController) ListReasonCodes( ctx context.Context, input ListReasonCodesInput) ( models.ApiResponse[[]models.ReasonCodeResponse], error)
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. Lists all current churn codes for a given site.
func (*ReasonCodesController) ReadReasonCode ¶
func (r *ReasonCodesController) ReadReasonCode( ctx context.Context, reasonCodeId int) ( models.ApiResponse[models.ReasonCodeResponse], error)
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. Returns a particular churn reason code for a given site by its unique ID.
func (*ReasonCodesController) UpdateReasonCode ¶
func (r *ReasonCodesController) UpdateReasonCode( ctx context.Context, reasonCodeId int, body *models.UpdateReasonCodeRequest) ( models.ApiResponse[models.ReasonCodeResponse], error)
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. Updates an existing reason code for a given site.
type ReferralCodesController ¶
type ReferralCodesController struct {
// contains filtered or unexported fields
}
ReferralCodesController represents a controller struct.
func NewReferralCodesController ¶
func NewReferralCodesController(baseController baseController) *ReferralCodesController
NewReferralCodesController creates a new instance of ReferralCodesController. It takes a baseController as a parameter and returns a pointer to the ReferralCodesController.
func (*ReferralCodesController) ValidateReferralCode ¶
func (r *ReferralCodesController) ValidateReferralCode( ctx context.Context, code string) ( models.ApiResponse[models.ReferralValidationResponse], error)
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. Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) in the product documentation.
type RetryConfiguration ¶
type RetryConfiguration = https.RetryConfiguration
RetryConfiguration holds the configuration options for the client.
func CreateRetryConfiguration ¶
func CreateRetryConfiguration(options ...RetryConfigurationOptions) RetryConfiguration
CreateRetryConfiguration creates a new RetryConfiguration with the provided options.
func DefaultRetryConfiguration ¶
func DefaultRetryConfiguration() RetryConfiguration
DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests. It also configures various retry options.
type RetryConfigurationOptions ¶
type RetryConfigurationOptions = https.RetryConfigurationOptions
RetryConfigurationOptions is a function type that modifies the RetryConfiguration.
type SalesCommissionsController ¶
type SalesCommissionsController struct {
// contains filtered or unexported fields
}
SalesCommissionsController represents a controller struct.
func NewSalesCommissionsController ¶
func NewSalesCommissionsController(baseController baseController) *SalesCommissionsController
NewSalesCommissionsController creates a new instance of SalesCommissionsController. It takes a baseController as a parameter and returns a pointer to the SalesCommissionsController.
func (*SalesCommissionsController) ListSalesCommissionSettings ¶
func (s *SalesCommissionsController) ListSalesCommissionSettings( ctx context.Context, input ListSalesCommissionSettingsInput) ( models.ApiResponse[[]models.SaleRepSettings], error)
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. Lists 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 contact Maxio support. > Note: The request is at seller level, it means `<<subdomain>>` variable will be replaced by `app`.
func (*SalesCommissionsController) ListSalesReps ¶
func (s *SalesCommissionsController) ListSalesReps( ctx context.Context, input ListSalesRepsInput) ( models.ApiResponse[[]models.ListSaleRepItem], error)
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. Lists sales reps with details. ## Modified Authentication Process The Sales Commission API differs from other Chargify API endpoints. This resource is associated with the seller itself. Up to now all available 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 contact Maxio support. > Note: The request is at seller level, it means `<<subdomain>>` variable will be replaced by `app`.
func (*SalesCommissionsController) ReadSalesRep ¶
func (s *SalesCommissionsController) ReadSalesRep( ctx context.Context, sellerId string, salesRepId string, authorization *string, liveMode *bool, page *int, perPage *int) ( models.ApiResponse[models.SaleRep], error)
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. Returns a sales rep and attached subscription 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 contact Maxio support. > Note: The request is at seller level, it means `<<subdomain>>` variable will be replaced by `app`.
type SitesController ¶
type SitesController struct {
// contains filtered or unexported fields
}
SitesController represents a controller struct.
func NewSitesController ¶
func NewSitesController(baseController baseController) *SitesController
NewSitesController creates a new instance of SitesController. It takes a baseController as a parameter and returns a pointer to the SitesController.
func (*SitesController) ClearSite ¶
func (s *SitesController) ClearSite( ctx context.Context, cleanupScope *models.CleanupScope) ( *http.Response, error)
ClearSite takes context, cleanupScope as parameters and returns an *Response and an error if there was an issue with the request or response. Clears all data from a test site asynchronously. 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 (*SitesController) ListChargifyJsPublicKeys ¶
func (s *SitesController) ListChargifyJsPublicKeys( ctx context.Context, input ListChargifyJsPublicKeysInput) ( models.ApiResponse[models.ListPublicKeysResponse], error)
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. Lists public keys used for Maxio.js (formerly Chargify.js).
func (*SitesController) ReadSite ¶
func (s *SitesController) ReadSite(ctx context.Context) ( models.ApiResponse[models.SiteResponse], error)
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. Retrieves site data. For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. #### Relationship invoicing enabled If the site has Relationship invoicing enabled, additional properties are returned in the response: ``` "customer_hierarchy_enabled": true, "whopays_enabled": true, "whopays_default_payer": "self" ``` For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays).
type SubscriptionComponentsController ¶
type SubscriptionComponentsController struct {
// contains filtered or unexported fields
}
SubscriptionComponentsController represents a controller struct.
func NewSubscriptionComponentsController ¶
func NewSubscriptionComponentsController(baseController baseController) *SubscriptionComponentsController
NewSubscriptionComponentsController creates a new instance of SubscriptionComponentsController. It takes a baseController as a parameter and returns a pointer to the SubscriptionComponentsController.
func (*SubscriptionComponentsController) ActivateEventBasedComponent ¶
func (s *SubscriptionComponentsController) ActivateEventBasedComponent( ctx context.Context, subscriptionId int, componentId int, body *models.ActivateEventBasedComponent) ( *http.Response, error)
ActivateEventBasedComponent takes context, subscriptionId, componentId, body as parameters and returns an *Response and an error if there was an issue with the request or response. Activates an event-based component for a single subscription. To bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes billing for events when the subscription is renewed. Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal.
func (*SubscriptionComponentsController) AllocateComponent ¶
func (s *SubscriptionComponentsController) AllocateComponent( ctx context.Context, subscriptionId int, componentId int, body *models.CreateAllocationRequest) ( models.ApiResponse[models.AllocationResponse], error)
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. Creates an allocation, sets the current allocated quantity for the component, and records a memo. Allocations can only be updated for Quantity, On/Off, and Prepaid Components. When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. > **Note:** These proration and accrual fields are ignored for Prepaid Components since this component type always generates charges immediately without proration. For information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration) ### 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.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) 3. Allocation API call top level (outside of the `allocations` array) 4. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#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.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#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. For more information, see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation.
func (*SubscriptionComponentsController) AllocateComponents ¶
func (s *SubscriptionComponentsController) AllocateComponents( ctx context.Context, subscriptionId int, body *models.AllocateComponents) ( models.ApiResponse[[]models.AllocationResponse], error)
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, sets the current allocated quantity for each of the components, and records a memo. A `component_id` is required for each allocation. 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. ### 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.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) 3. Allocation API call top level (outside of the `allocations` array) 4. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#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.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#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. For more information, see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product documentation.
func (*SubscriptionComponentsController) BulkRecordEvents ¶ added in v0.1.0
func (s *SubscriptionComponentsController) BulkRecordEvents( ctx context.Context, apiHandle string, storeUid *string, body []models.EBBEvent) ( *http.Response, error)
BulkRecordEvents takes context, apiHandle, storeUid, body as parameters and returns an *Response and an error if there was an issue with the request or response. Records a collection of events. Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded.
func (*SubscriptionComponentsController) BulkResetSubscriptionComponentsPricePoints ¶ added in v0.1.0
func (s *SubscriptionComponentsController) BulkResetSubscriptionComponentsPricePoints( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], error)
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 (*SubscriptionComponentsController) BulkUpdateSubscriptionComponentsPricePoints ¶ added in v0.1.0
func (s *SubscriptionComponentsController) BulkUpdateSubscriptionComponentsPricePoints( ctx context.Context, subscriptionId int, body *models.BulkComponentsPricePointAssignment) ( models.ApiResponse[models.BulkComponentsPricePointAssignment], error)
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 (*SubscriptionComponentsController) CreateUsage ¶
func (s *SubscriptionComponentsController) CreateUsage( ctx context.Context, subscriptionIdOrReference models.CreateUsageSubscriptionIdOrReference, componentId models.CreateUsageComponentId, body *models.CreateUsageRequest) ( models.ApiResponse[models.UsageResponse], error)
CreateUsage takes context, subscriptionIdOrReference, 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. Records an instance of metered or prepaid usage for a subscription. You can report metered or prepaid usage to Advanced Billing as often as you wish. You can report usage as it happens or periodically, such as each night or once per billing period. Full documentation on how to create Components in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). Additionally, for information on how to record component usage against a subscription, see the following resources: It is not possible to record metered usage for more than one component at a time. 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. See the following product documentation articles for more information: - [Create and Manage Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components) - [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-metered-component-usage) - [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-prepaid-component-status) The `quantity` from usage for each component is accumulated to the `unit_balance` on the [Component Line Item]($e/Subscription%20Components/readSubscriptionComponent) for the subscription. ## Price Point ID usage If you are using price points, for metered and prepaid usage components Advanced Billing 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. ## Deducting Usage If you need to reverse a previous usage report or otherwise deduct from the current usage balance, you can provide a negative quantity. Example: Previously recorded quantity was 5000: ```json { "usage": { "quantity": 5000, "memo": "Recording 5000 units" } } ``` To reduce the quantity 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`.
func (*SubscriptionComponentsController) DeactivateEventBasedComponent ¶
func (s *SubscriptionComponentsController) DeactivateEventBasedComponent( ctx context.Context, subscriptionId int, componentId int) ( *http.Response, error)
DeactivateEventBasedComponent takes context, subscriptionId, componentId as parameters and returns an *Response and an error if there was an issue with the request or response. Deactivates an event-based component for a single subscription. Deactivating the event-based component causes Advanced Billing to ignore related events at subscription renewal.
func (*SubscriptionComponentsController) DeletePrepaidUsageAllocation ¶
func (s *SubscriptionComponentsController) DeletePrepaidUsageAllocation( ctx context.Context, subscriptionId int, componentId int, allocationId int, body *models.CreditSchemeRequest) ( *http.Response, error)
DeletePrepaidUsageAllocation takes context, subscriptionId, componentId, allocationId, body as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a 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 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 (*SubscriptionComponentsController) ListAllocations ¶
func (s *SubscriptionComponentsController) ListAllocations( ctx context.Context, subscriptionId int, componentId int, page *int) ( models.ApiResponse[[]models.AllocationResponse], error)
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. Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components When a subscription's on/off component has been toggled to on (`1`) or off (`0`), usage will be logged in this response.
func (*SubscriptionComponentsController) ListSubscriptionComponents ¶
func (s *SubscriptionComponentsController) ListSubscriptionComponents( ctx context.Context, input ListSubscriptionComponentsInput) ( models.ApiResponse[[]models.SubscriptionComponentResponse], error)
ListSubscriptionComponents takes context, subscriptionId, dateField, direction, filter, endDate, endDatetime, pricePointIds, productFamilyIds, sort, startDate, startDatetime, include, inUse as parameters and returns an models.ApiResponse with []models.SubscriptionComponentResponse data and an error if there was an issue with the request or response. Lists 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 (*SubscriptionComponentsController) ListSubscriptionComponentsForSite ¶
func (s *SubscriptionComponentsController) ListSubscriptionComponentsForSite( ctx context.Context, input ListSubscriptionComponentsForSiteInput) ( models.ApiResponse[models.ListSubscriptionComponentsResponse], error)
ListSubscriptionComponentsForSite takes context, page, perPage, sort, direction, filter, dateField, startDate, startDatetime, endDate, endDatetime, subscriptionIds, pricePointIds, productFamilyIds, include as parameters and returns an models.ApiResponse with models.ListSubscriptionComponentsResponse data and an error if there was an issue with the request or response. Lists components applied to each subscription.
func (*SubscriptionComponentsController) ListUsages ¶
func (s *SubscriptionComponentsController) ListUsages( ctx context.Context, input ListUsagesInput) ( models.ApiResponse[[]models.UsageResponse], error)
ListUsages takes context, subscriptionIdOrReference, 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. Lists usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. ## Since Date and Until Date Usage Note: The `since_date` and `until_date` attributes each default to 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 (*SubscriptionComponentsController) PreviewAllocations ¶
func (s *SubscriptionComponentsController) PreviewAllocations( ctx context.Context, subscriptionId int, body *models.PreviewAllocationsRequest) ( models.ApiResponse[models.AllocationPreviewResponse], error)
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. Previews 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 (*SubscriptionComponentsController) ReadSubscriptionComponent ¶
func (s *SubscriptionComponentsController) ReadSubscriptionComponent( ctx context.Context, subscriptionId int, componentId int) ( models.ApiResponse[models.SubscriptionComponentResponse], error)
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. Returns information for a specific component on a subscription.
func (*SubscriptionComponentsController) RecordEvent ¶
func (s *SubscriptionComponentsController) RecordEvent( ctx context.Context, apiHandle string, storeUid *string, body *models.EBBEvent) ( *http.Response, error)
RecordEvent takes context, apiHandle, storeUid, body as parameters and returns an *Response and an error if there was an issue with the request or response. Records a single event for Events-Based Billing. Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. These events can then be transformed, enriched, or analyzed to form the computed totals of usage charges billed to your customers. This API allows you to stream events into the Advanced Billing data ingestion engine. For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. For example: ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle ```
func (*SubscriptionComponentsController) UpdatePrepaidUsageAllocationExpirationDate ¶ added in v0.1.0
func (s *SubscriptionComponentsController) UpdatePrepaidUsageAllocationExpirationDate( ctx context.Context, subscriptionId int, componentId int, allocationId int, body *models.UpdateAllocationExpirationDate) ( *http.Response, error)
UpdatePrepaidUsageAllocationExpirationDate takes context, subscriptionId, componentId, allocationId, body as parameters and returns an *Response and an error if there was an issue with the request or response. Updates the expiration date for a prepaid usage allocation. 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.
type SubscriptionGroupInvoiceAccountController ¶
type SubscriptionGroupInvoiceAccountController struct {
// contains filtered or unexported fields
}
SubscriptionGroupInvoiceAccountController represents a controller struct.
func NewSubscriptionGroupInvoiceAccountController ¶
func NewSubscriptionGroupInvoiceAccountController(baseController baseController) *SubscriptionGroupInvoiceAccountController
NewSubscriptionGroupInvoiceAccountController creates a new instance of SubscriptionGroupInvoiceAccountController. It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupInvoiceAccountController.
func (*SubscriptionGroupInvoiceAccountController) CreateSubscriptionGroupPrepayment ¶
func (s *SubscriptionGroupInvoiceAccountController) CreateSubscriptionGroupPrepayment( ctx context.Context, uid string, body *models.SubscriptionGroupPrepaymentRequest) ( models.ApiResponse[models.SubscriptionGroupPrepaymentResponse], error)
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. Adds a prepayment for a subscription group. This endpoint requires an `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance.
func (*SubscriptionGroupInvoiceAccountController) DeductSubscriptionGroupServiceCredit ¶ added in v0.1.0
func (s *SubscriptionGroupInvoiceAccountController) DeductSubscriptionGroupServiceCredit( ctx context.Context, uid string, body *models.DeductServiceCreditRequest) ( models.ApiResponse[models.ServiceCredit], error)
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. Deducts service credit for a subscription group. Credit will be deducted from the group in the amount specified in the request body.
func (*SubscriptionGroupInvoiceAccountController) IssueSubscriptionGroupServiceCredit ¶ added in v0.1.0
func (s *SubscriptionGroupInvoiceAccountController) IssueSubscriptionGroupServiceCredit( ctx context.Context, uid string, body *models.IssueServiceCreditRequest) ( models.ApiResponse[models.ServiceCreditResponse], error)
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. Issues service credit for a subscription group. 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 (*SubscriptionGroupInvoiceAccountController) ListPrepaymentsForSubscriptionGroup ¶
func (s *SubscriptionGroupInvoiceAccountController) ListPrepaymentsForSubscriptionGroup( ctx context.Context, input ListPrepaymentsForSubscriptionGroupInput) ( models.ApiResponse[models.ListSubscriptionGroupPrepaymentResponse], error)
ListPrepaymentsForSubscriptionGroup takes context, uid, page, perPage, filter as parameters and returns an models.ApiResponse with models.ListSubscriptionGroupPrepaymentResponse data and an error if there was an issue with the request or response. Lists a subscription group's prepayments.
type SubscriptionGroupStatusController ¶
type SubscriptionGroupStatusController struct {
// contains filtered or unexported fields
}
SubscriptionGroupStatusController represents a controller struct.
func NewSubscriptionGroupStatusController ¶
func NewSubscriptionGroupStatusController(baseController baseController) *SubscriptionGroupStatusController
NewSubscriptionGroupStatusController creates a new instance of SubscriptionGroupStatusController. It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupStatusController.
func (*SubscriptionGroupStatusController) CancelDelayedCancellationForGroup ¶ added in v0.1.0
func (s *SubscriptionGroupStatusController) CancelDelayedCancellationForGroup( ctx context.Context, uid string) ( *http.Response, error)
CancelDelayedCancellationForGroup takes context, uid as parameters and returns an *Response and an error if there was an issue with the request or response. Removes the delayed cancellation on a subscription 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.
func (*SubscriptionGroupStatusController) CancelSubscriptionsInGroup ¶
func (s *SubscriptionGroupStatusController) CancelSubscriptionsInGroup( ctx context.Context, uid string, body *models.CancelGroupedSubscriptionsRequest) ( *http.Response, error)
CancelSubscriptionsInGroup takes context, uid, body as parameters and returns an *Response and an error if there was an issue with the request or response. Cancels all subscriptions within the specified group immediately. The group is identified by the `uid` that is passed in the URL. To successfully cancel the group, the primary subscription must be on automatic billing. The group members must be on automatic billing or prepaid. 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 (*SubscriptionGroupStatusController) InitiateDelayedCancellationForGroup ¶
func (s *SubscriptionGroupStatusController) InitiateDelayedCancellationForGroup( ctx context.Context, uid string) ( *http.Response, error)
InitiateDelayedCancellationForGroup takes context, uid as parameters and returns an *Response and an error if there was an issue with the request or response. Schedules all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by its 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 (*SubscriptionGroupStatusController) ReactivateSubscriptionGroup ¶
func (s *SubscriptionGroupStatusController) ReactivateSubscriptionGroup( ctx context.Context, uid string, body *models.ReactivateSubscriptionGroupRequest) ( models.ApiResponse[models.ReactivateSubscriptionGroupResponse], error)
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. Reactivates or resumes 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. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
type SubscriptionGroupsController ¶
type SubscriptionGroupsController struct {
// contains filtered or unexported fields
}
SubscriptionGroupsController represents a controller struct.
func NewSubscriptionGroupsController ¶
func NewSubscriptionGroupsController(baseController baseController) *SubscriptionGroupsController
NewSubscriptionGroupsController creates a new instance of SubscriptionGroupsController. It takes a baseController as a parameter and returns a pointer to the SubscriptionGroupsController.
func (*SubscriptionGroupsController) AddSubscriptionToGroup ¶ added in v0.1.0
func (s *SubscriptionGroupsController) AddSubscriptionToGroup( ctx context.Context, subscriptionId int, body *models.AddSubscriptionToAGroup) ( models.ApiResponse[models.SubscriptionGroupResponse], error)
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. Adds an existing subscription to a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. **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, 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 (*SubscriptionGroupsController) CreateSubscriptionGroup ¶
func (s *SubscriptionGroupsController) CreateSubscriptionGroup( ctx context.Context, body *models.CreateSubscriptionGroupRequest) ( models.ApiResponse[models.SubscriptionGroupResponse], error)
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 (*SubscriptionGroupsController) DeleteSubscriptionGroup ¶
func (s *SubscriptionGroupsController) DeleteSubscriptionGroup( ctx context.Context, uid string) ( models.ApiResponse[models.DeleteSubscriptionGroupResponse], error)
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. Deletes a subscription group. Only groups without members can be deleted.
func (*SubscriptionGroupsController) FindSubscriptionGroup ¶ added in v0.1.0
func (s *SubscriptionGroupsController) FindSubscriptionGroup( ctx context.Context, subscriptionId string) ( models.ApiResponse[models.FullSubscriptionGroupResponse], error)
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. Finds the subscription group associated with a subscription. If the subscription is not in a group, this endpoint returns an error.
func (*SubscriptionGroupsController) ListSubscriptionGroups ¶
func (s *SubscriptionGroupsController) ListSubscriptionGroups( ctx context.Context, input ListSubscriptionGroupsInput) ( models.ApiResponse[models.ListSubscriptionGroupsResponse], error)
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. Lists subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information Account balance information for the subscription groups is not returned by default. If this information is desired, the `include[]=account_balances` parameter must be provided with the request.
func (*SubscriptionGroupsController) ReadSubscriptionGroup ¶
func (s *SubscriptionGroupsController) ReadSubscriptionGroup( ctx context.Context, uid string, include []models.SubscriptionGroupInclude) ( models.ApiResponse[models.FullSubscriptionGroupResponse], error)
ReadSubscriptionGroup takes context, uid, include as parameters and returns an models.ApiResponse with models.FullSubscriptionGroupResponse data and an error if there was an issue with the request or response. Returns 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 (*SubscriptionGroupsController) RemoveSubscriptionFromGroup ¶
func (s *SubscriptionGroupsController) RemoveSubscriptionFromGroup( ctx context.Context, subscriptionId int) ( *http.Response, error)
RemoveSubscriptionFromGroup takes context, subscriptionId as parameters and returns an *Response and an error if there was an issue with the request or response. Removes an existing subscription from a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group.
func (*SubscriptionGroupsController) SignupWithSubscriptionGroup ¶
func (s *SubscriptionGroupsController) SignupWithSubscriptionGroup( ctx context.Context, body *models.SubscriptionGroupSignupRequest) ( models.ApiResponse[models.SubscriptionGroupSignupResponse], error)
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. Creates multiple subscriptions at once under the same customer and consolidates 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 a product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. The subscription request 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 Maxio.js (formerly Chargify.js).
func (*SubscriptionGroupsController) UpdateSubscriptionGroupMembers ¶
func (s *SubscriptionGroupsController) UpdateSubscriptionGroupMembers( ctx context.Context, uid string, body *models.UpdateSubscriptionGroupRequest) ( models.ApiResponse[models.SubscriptionGroupResponse], error)
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. Updates 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 the subscription group. To clean up members, just leave the array empty.
type SubscriptionInvoiceAccountController ¶
type SubscriptionInvoiceAccountController struct {
// contains filtered or unexported fields
}
SubscriptionInvoiceAccountController represents a controller struct.
func NewSubscriptionInvoiceAccountController ¶
func NewSubscriptionInvoiceAccountController(baseController baseController) *SubscriptionInvoiceAccountController
NewSubscriptionInvoiceAccountController creates a new instance of SubscriptionInvoiceAccountController. It takes a baseController as a parameter and returns a pointer to the SubscriptionInvoiceAccountController.
func (*SubscriptionInvoiceAccountController) CreatePrepayment ¶
func (s *SubscriptionInvoiceAccountController) CreatePrepayment( ctx context.Context, subscriptionId int, body *models.CreatePrepaymentRequest) ( models.ApiResponse[models.CreatePrepaymentResponse], error)
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. Creates a prepayment for a subscription. 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. Note that passing `amount_in_cents` is now allowed. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*SubscriptionInvoiceAccountController) DeductServiceCredit ¶
func (s *SubscriptionInvoiceAccountController) DeductServiceCredit( ctx context.Context, subscriptionId int, body *models.DeductServiceCreditRequest) ( *http.Response, error)
DeductServiceCredit takes context, subscriptionId, body as parameters and returns an *Response and an error if there was an issue with the request or response. Deducts a service credit from the subscription in the specified amount. The credit amount being deducted must be equal to or less than the current credit balance.
func (*SubscriptionInvoiceAccountController) IssueServiceCredit ¶
func (s *SubscriptionInvoiceAccountController) IssueServiceCredit( ctx context.Context, subscriptionId int, body *models.IssueServiceCreditRequest) ( models.ApiResponse[models.ServiceCredit], error)
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. Adds a service credit to the subscription in the specified amount. The credit is subsequently applied to the next generated invoice.
func (*SubscriptionInvoiceAccountController) ListPrepayments ¶
func (s *SubscriptionInvoiceAccountController) ListPrepayments( ctx context.Context, input ListPrepaymentsInput) ( models.ApiResponse[models.PrepaymentsResponse], error)
ListPrepayments takes context, subscriptionId, page, perPage, filter as parameters and returns an models.ApiResponse with models.PrepaymentsResponse data and an error if there was an issue with the request or response. Lists a subscription's prepayments.
func (*SubscriptionInvoiceAccountController) ListServiceCredits ¶ added in v0.7.0
func (s *SubscriptionInvoiceAccountController) ListServiceCredits( ctx context.Context, subscriptionId int, page *int, perPage *int, direction *models.SortingDirection) ( models.ApiResponse[models.ListServiceCreditsResponse], error)
ListServiceCredits takes context, subscriptionId, page, perPage, direction as parameters and returns an models.ApiResponse with models.ListServiceCreditsResponse data and an error if there was an issue with the request or response. Lists a subscription's service credits.
func (*SubscriptionInvoiceAccountController) ReadAccountBalances ¶
func (s *SubscriptionInvoiceAccountController) ReadAccountBalances( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.AccountBalances], error)
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 (*SubscriptionInvoiceAccountController) RefundPrepayment ¶
func (s *SubscriptionInvoiceAccountController) RefundPrepayment( ctx context.Context, subscriptionId int, prepaymentId int64, body *models.RefundPrepaymentRequest) ( models.ApiResponse[models.PrepaymentResponse], error)
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. Refunds a prepayment applied to a subscription, either fully or partially. 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`.
type SubscriptionNotesController ¶
type SubscriptionNotesController struct {
// contains filtered or unexported fields
}
SubscriptionNotesController represents a controller struct.
func NewSubscriptionNotesController ¶
func NewSubscriptionNotesController(baseController baseController) *SubscriptionNotesController
NewSubscriptionNotesController creates a new instance of SubscriptionNotesController. It takes a baseController as a parameter and returns a pointer to the SubscriptionNotesController.
func (*SubscriptionNotesController) CreateSubscriptionNote ¶
func (s *SubscriptionNotesController) CreateSubscriptionNote( ctx context.Context, subscriptionId int, body *models.UpdateSubscriptionNoteRequest) ( models.ApiResponse[models.SubscriptionNoteResponse], error)
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. Creates a note for a subscription. 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]($e/Custom%20Fields/createMetadata) instead. For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation.
func (*SubscriptionNotesController) DeleteSubscriptionNote ¶
func (s *SubscriptionNotesController) DeleteSubscriptionNote( ctx context.Context, subscriptionId int, noteId int) ( *http.Response, error)
DeleteSubscriptionNote takes context, subscriptionId, noteId as parameters and returns an *Response and an error if there was an issue with the request or response. Deletes a note for a Subscription.
func (*SubscriptionNotesController) ListSubscriptionNotes ¶
func (s *SubscriptionNotesController) ListSubscriptionNotes( ctx context.Context, input ListSubscriptionNotesInput) ( models.ApiResponse[[]models.SubscriptionNoteResponse], error)
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. Retrieves a list of notes associated with a subscription. The response will be an array of Notes.
func (*SubscriptionNotesController) ReadSubscriptionNote ¶
func (s *SubscriptionNotesController) ReadSubscriptionNote( ctx context.Context, subscriptionId int, noteId int) ( models.ApiResponse[models.SubscriptionNoteResponse], error)
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. Retrieves a specific note attached to a subscription.
func (*SubscriptionNotesController) UpdateSubscriptionNote ¶
func (s *SubscriptionNotesController) UpdateSubscriptionNote( ctx context.Context, subscriptionId int, noteId int, body *models.UpdateSubscriptionNoteRequest) ( models.ApiResponse[models.SubscriptionNoteResponse], error)
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. Updates a note for a subscription.
type SubscriptionProductsController ¶
type SubscriptionProductsController struct {
// contains filtered or unexported fields
}
SubscriptionProductsController represents a controller struct.
func NewSubscriptionProductsController ¶
func NewSubscriptionProductsController(baseController baseController) *SubscriptionProductsController
NewSubscriptionProductsController creates a new instance of SubscriptionProductsController. It takes a baseController as a parameter and returns a pointer to the SubscriptionProductsController.
func (*SubscriptionProductsController) MigrateSubscriptionProduct ¶
func (s *SubscriptionProductsController) MigrateSubscriptionProduct( ctx context.Context, subscriptionId int, body *models.SubscriptionProductMigrationRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Migrates a subscription to a different product. To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions Subscriptions should be in the `active` or `trialing` state 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.) For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations Important note: One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to its current product. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*SubscriptionProductsController) PreviewSubscriptionProductMigration ¶
func (s *SubscriptionProductsController) PreviewSubscriptionProductMigration( ctx context.Context, subscriptionId int, body *models.SubscriptionMigrationPreviewRequest) ( models.ApiResponse[models.SubscriptionMigrationPreviewResponse], error)
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. Previews the charges resulting from migrating a subscription to a different product. ## 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 (e.g., `"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.
type SubscriptionRenewalsController ¶ added in v0.9.0
type SubscriptionRenewalsController struct {
// contains filtered or unexported fields
}
SubscriptionRenewalsController represents a controller struct.
func NewSubscriptionRenewalsController ¶ added in v0.9.0
func NewSubscriptionRenewalsController(baseController baseController) *SubscriptionRenewalsController
NewSubscriptionRenewalsController creates a new instance of SubscriptionRenewalsController. It takes a baseController as a parameter and returns a pointer to the SubscriptionRenewalsController.
func (*SubscriptionRenewalsController) CancelScheduledRenewalConfiguration ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) CancelScheduledRenewalConfiguration( ctx context.Context, subscriptionId int, id int) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
CancelScheduledRenewalConfiguration takes context, subscriptionId, id as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Cancels a scheduled renewal configuration.
func (*SubscriptionRenewalsController) CreateScheduledRenewalConfiguration ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) CreateScheduledRenewalConfiguration( ctx context.Context, subscriptionId int, body *models.ScheduledRenewalConfigurationRequest) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
CreateScheduledRenewalConfiguration takes context, subscriptionId, body as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Creates a scheduled renewal configuration for a subscription. The scheduled renewal is based on the subscription’s current product and component setup.
func (*SubscriptionRenewalsController) CreateScheduledRenewalConfigurationItem ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) CreateScheduledRenewalConfigurationItem( ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, body *models.ScheduledRenewalConfigurationItemRequest) ( models.ApiResponse[models.ScheduledRenewalConfigurationItemResponse], error)
CreateScheduledRenewalConfigurationItem takes context, subscriptionId, scheduledRenewalsConfigurationId, body as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationItemResponse data and an error if there was an issue with the request or response. Adds product and component line items to the scheduled renewal. If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs.
func (*SubscriptionRenewalsController) DeleteScheduledRenewalConfigurationItem ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) DeleteScheduledRenewalConfigurationItem( ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, id int) ( *http.Response, error)
DeleteScheduledRenewalConfigurationItem takes context, subscriptionId, scheduledRenewalsConfigurationId, id as parameters and returns an *Response and an error if there was an issue with the request or response. Removes an item from the pending renewal configuration.
func (*SubscriptionRenewalsController) ListScheduledRenewalConfigurations ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) ListScheduledRenewalConfigurations( ctx context.Context, subscriptionId int, status *models.Status) ( models.ApiResponse[models.ScheduledRenewalConfigurationsResponse], error)
ListScheduledRenewalConfigurations takes context, subscriptionId, status as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationsResponse data and an error if there was an issue with the request or response. Lists scheduled renewal configurations for the subscription and permits an optional status query filter.
func (*SubscriptionRenewalsController) LockInScheduledRenewalImmediately ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) LockInScheduledRenewalImmediately( ctx context.Context, subscriptionId int, id int) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
LockInScheduledRenewalImmediately takes context, subscriptionId, id as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Locks in the renewal immediately.
func (*SubscriptionRenewalsController) ReadScheduledRenewalConfiguration ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) ReadScheduledRenewalConfiguration( ctx context.Context, subscriptionId int, id int) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
ReadScheduledRenewalConfiguration takes context, subscriptionId, id as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Retrieves the configuration settings for the scheduled renewal.
func (*SubscriptionRenewalsController) ScheduleScheduledRenewalLockIn ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) ScheduleScheduledRenewalLockIn( ctx context.Context, subscriptionId int, id int, body *models.ScheduledRenewalLockInRequest) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
ScheduleScheduledRenewalLockIn takes context, subscriptionId, id, body as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Schedules a future lock-in date for the renewal.
func (*SubscriptionRenewalsController) UnpublishScheduledRenewalConfiguration ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) UnpublishScheduledRenewalConfiguration( ctx context.Context, subscriptionId int, id int) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
UnpublishScheduledRenewalConfiguration takes context, subscriptionId, id as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Restores a scheduled renewal configuration to an editable state.
func (*SubscriptionRenewalsController) UpdateScheduledRenewalConfiguration ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) UpdateScheduledRenewalConfiguration( ctx context.Context, subscriptionId int, id int, body *models.ScheduledRenewalConfigurationRequest) ( models.ApiResponse[models.ScheduledRenewalConfigurationResponse], error)
UpdateScheduledRenewalConfiguration takes context, subscriptionId, id, body as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationResponse data and an error if there was an issue with the request or response. Updates an existing configuration.
func (*SubscriptionRenewalsController) UpdateScheduledRenewalConfigurationItem ¶ added in v0.9.0
func (s *SubscriptionRenewalsController) UpdateScheduledRenewalConfigurationItem( ctx context.Context, subscriptionId int, scheduledRenewalsConfigurationId int, id int, body *models.ScheduledRenewalUpdateRequest) ( models.ApiResponse[models.ScheduledRenewalConfigurationItemResponse], error)
UpdateScheduledRenewalConfigurationItem takes context, subscriptionId, scheduledRenewalsConfigurationId, id, body as parameters and returns an models.ApiResponse with models.ScheduledRenewalConfigurationItemResponse data and an error if there was an issue with the request or response. Updates an existing configuration item’s pricing and quantity. If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs.
type SubscriptionStatusController ¶
type SubscriptionStatusController struct {
// contains filtered or unexported fields
}
SubscriptionStatusController represents a controller struct.
func NewSubscriptionStatusController ¶
func NewSubscriptionStatusController(baseController baseController) *SubscriptionStatusController
NewSubscriptionStatusController creates a new instance of SubscriptionStatusController. It takes a baseController as a parameter and returns a pointer to the SubscriptionStatusController.
func (*SubscriptionStatusController) CancelDelayedCancellation ¶ added in v0.1.0
func (s *SubscriptionStatusController) CancelDelayedCancellation( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.DelayedCancellationResponse], error)
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. Removes the delayed cancellation from a subscription, ensuring it is not canceled at the end of the current period. 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 (*SubscriptionStatusController) CancelDunning ¶
func (s *SubscriptionStatusController) CancelDunning( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Cancels the active dunning process for a subscription and sets it to active.
func (*SubscriptionStatusController) CancelSubscription ¶
func (s *SubscriptionStatusController) CancelSubscription( ctx context.Context, subscriptionId int, body *models.CancellationRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Cancels the Subscription. The Delete method sets the Subscription state to `canceled`. To cancel the subscription immediately, omit any schedule parameters from the request. To use the schedule options, the Schedule Subscription Cancellation feature must be enabled on your site.
func (*SubscriptionStatusController) InitiateDelayedCancellation ¶
func (s *SubscriptionStatusController) InitiateDelayedCancellation( ctx context.Context, subscriptionId int, body *models.CancellationRequest) ( models.ApiResponse[models.DelayedCancellationResponse], error)
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. Cancels a subscription at the end of the current billing period based on the subscription's current product. You cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due.
func (*SubscriptionStatusController) PauseSubscription ¶
func (s *SubscriptionStatusController) PauseSubscription( ctx context.Context, subscriptionId int, body *models.PauseRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Places the subscription on hold, preventing it from renewing. ## Limitations You may not place a subscription on hold if the `next_billing_at` date is within 24 hours.
func (*SubscriptionStatusController) PreviewRenewal ¶
func (s *SubscriptionStatusController) PreviewRenewal( ctx context.Context, subscriptionId int, body *models.RenewalPreviewRequest) ( models.ApiResponse[models.RenewalPreviewResponse], error)
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. Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. ## Preview Behavior Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription.
func (*SubscriptionStatusController) ReactivateSubscription ¶
func (s *SubscriptionStatusController) ReactivateSubscription( ctx context.Context, subscriptionId int, body *models.ReactivateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Reactivates a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). **Note: The term "resume" is used also during another process in Advanced Billing. 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 Advanced Billing 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 Advanced Billing would not resume the subscription, and instead it would be reactivated with a new billing period. If a reactivation with `resume: false`, or where 'resume' is omitted were attempted, then Advanced Billing would reactivate the subscription with a new billing period regardless of whether or not resuming the previous billing period was possible. | 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 ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*SubscriptionStatusController) ResumeSubscription ¶
func (s *SubscriptionStatusController) ResumeSubscription( ctx context.Context, subscriptionId int, calendarBillingResumptionCharge *models.ResumptionCharge) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Resumes 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 (*SubscriptionStatusController) RetrySubscription ¶
func (s *SubscriptionStatusController) RetrySubscription( ctx context.Context, subscriptionId int) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Retries collecting the balance due on a past-due subscription without waiting for the next scheduled attempt. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*SubscriptionStatusController) UpdateAutomaticSubscriptionResumption ¶
func (s *SubscriptionStatusController) UpdateAutomaticSubscriptionResumption( ctx context.Context, subscriptionId int, body *models.PauseRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Updates the date on which a paused subscription will automatically resume. To update a subscription's resume date, use this method to change or update the `automatically_resume_at` date. ### Remove the resume date Alternatively, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date.
type SubscriptionsController ¶
type SubscriptionsController struct {
// contains filtered or unexported fields
}
SubscriptionsController represents a controller struct.
func NewSubscriptionsController ¶
func NewSubscriptionsController(baseController baseController) *SubscriptionsController
NewSubscriptionsController creates a new instance of SubscriptionsController. It takes a baseController as a parameter and returns a pointer to the SubscriptionsController.
func (*SubscriptionsController) ActivateSubscription ¶
func (s *SubscriptionsController) ActivateSubscription( ctx context.Context, subscriptionId int, body *models.ActivateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. - If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. - If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. The default activation failure behavior can be configured per activation attempt, or you can 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 For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription.
func (*SubscriptionsController) ApplyCouponsToSubscription ¶ added in v0.1.0
func (s *SubscriptionsController) ApplyCouponsToSubscription( ctx context.Context, subscriptionId int, code *string, body *models.AddCouponsRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Applies one or more coupon codes to an existing 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://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#stackability-rules) ## 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 (*SubscriptionsController) CreateSubscription ¶
func (s *SubscriptionsController) CreateSubscription( ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Creates a Subscription for a customer and product. Specify the product with `product_id` or `product_handle`. To set a specific product price point, use `product_price_point_handle` or `product_price_point_id`. Identify an existing customer with `customer_id` or `customer_reference`. Optionally, include an existing payment profile using `payment_profile_id`. To create a new customer, pass customer_attributes. Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. ## List vs Sales Pricing When a subscription uses custom pricing as the sales price, you can optionally provide a list price for any item. If omitted, the list price defaults to the sales price. The difference between the list price and sales price is used to calculate implicit discounts, which appear on Invoices and in reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom pricing, validates and persists it, and returns list price metadata in subscription responses. If list pricing is disabled, this input is ignored and related response fields are omitted. When list pricing is enabled: - Subscription → Product `product_price_point_list_price_point_id` (integer) - `product_price_point_list_price_point_handle` (string) - Subscription Components (when components are included in the response, such as with subscriptions built from components or component serialization paths) `component_id` (integer) - `price_point_id` (integer) - `list_price_point_id` (integer) When list pricing is disabled: - Subscription → Product `product_price_point_list_price_point_id`: omitted - `product_price_point_list_price_point_handle`: omitted - Subscription Components `list_price_point_id`: omitted This functionality is supported in the API, but is not currently supported in SDKs. ## Subscriptions can now work independently from the catalog If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. A valid subscription must include at least one active component with: - a positive `allocated_quantity`, - a positive `unit_balance`, or - 'enabled: true' (for on/off components) - a configured metered component `component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. In the response, product and product price point fields are null, and component details are returned instead. This functionality is supported in the API, but is not currently supported in SDKs. ## Payment information Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details on payment parameters. See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ## Payment information Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details on payment parameters. Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. ## 3D Secure (3DS) Authentication post-authentication flow When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow.
func (*SubscriptionsController) FindSubscription ¶ added in v0.1.0
func (s *SubscriptionsController) FindSubscription( ctx context.Context, reference *string) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Finds a subscription by its reference.
func (*SubscriptionsController) ListSubscriptions ¶
func (s *SubscriptionsController) ListSubscriptions( ctx context.Context, input ListSubscriptionsInput) ( models.ApiResponse[[]models.SubscriptionResponse], error)
ListSubscriptions takes context, page, perPage, sort, direction, state, product, q, qScope, customerId, productPricePointId, coupon, couponCode, collectionMethod, brandingThemeId, dateField, startDate, endDate, startDatetime, endDatetime, metadata, groupStatus, dunningExemption, paymentGateways, currencies, 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. Lists subscriptions for a site. Use the query string filters and pagination to control responses from the server. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Search for a subscription Use the query strings below to search for a subscription using the criteria available. The return value will be an array. ## 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 (*SubscriptionsController) OverrideSubscription ¶
func (s *SubscriptionsController) OverrideSubscription( ctx context.Context, subscriptionId int, body *models.OverrideSubscriptionRequest) ( *http.Response, error)
OverrideSubscription takes context, subscriptionId, body as parameters and returns an *Response and an error if there was an issue with the request or response. Sets certain subscription fields that are usually managed 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” Advanced Billing data with data that happened in your system, perhaps before you started using Advanced Billing. For example, you may choose to import your historical subscription data, and would like the activation and cancellation dates in Advanced Billing to match your existing historical dates. Advanced Billing 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 Advanced Billing, 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 (*SubscriptionsController) PreviewSubscription ¶
func (s *SubscriptionsController) PreviewSubscription( ctx context.Context, body *models.CreateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionPreviewResponse], error)
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. Previews 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. This endpoint does not create a subscription; it is meant to serve as a prediction. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Subscriptions can now work independently from the catalog If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. A valid subscription must include at least one active component with: - a positive `allocated_quantity`, - a positive `unit_balance`, or - 'enabled: true' (for on/off components) `component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. In the response, product and product price point fields are null, and component details are returned instead. This functionality is supported in the API, but is not currently supported in SDKs. ## Taxable Subscriptions This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following conditions must be met: + Taxes must be configured on the subscription + The preview must be for the purchase of a taxable product or component, or combination of the two. + The subscription payload must contain a full billing or shipping address to calculate tax For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored. The billing address and the credit card information are stored together within the payment profile object. Also, you cannot send a billing address without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions If you'd like to calculate subscriptions that do not include tax, you can leave off the billing information.
func (*SubscriptionsController) PurgeSubscription ¶
func (s *SubscriptionsController) PurgeSubscription( ctx context.Context, subscriptionId int, ack int, cascade []models.SubscriptionPurgeType) ( models.ApiResponse[models.SubscriptionResponse], error)
PurgeSubscription takes context, subscriptionId, ack, cascade as parameters and returns an models.ApiResponse with models.SubscriptionResponse data and an error if there was an issue with the request or response. Purges an individual subscription for sites in test mode. Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, 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 (*SubscriptionsController) ReadSubscription ¶
func (s *SubscriptionsController) ReadSubscription( ctx context.Context, subscriptionId int, include []models.SubscriptionInclude) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Retrieves subscription details. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Self-Service Page token Self-Service Page token for the subscription is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request.
func (*SubscriptionsController) RemoveCouponFromSubscription ¶ added in v0.1.0
func (s *SubscriptionsController) RemoveCouponFromSubscription( ctx context.Context, subscriptionId int, couponCode *string) ( models.ApiResponse[string], error)
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. Removes a coupon from an existing subscription. For more information on the expected behavior of removing a coupon from a subscription, see [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon).
func (*SubscriptionsController) UpdatePrepaidSubscriptionConfiguration ¶ added in v0.1.0
func (s *SubscriptionsController) UpdatePrepaidSubscriptionConfiguration( ctx context.Context, subscriptionId int, body *models.UpsertPrepaidConfigurationRequest) ( models.ApiResponse[models.PrepaidConfigurationResponse], error)
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. Updates a subscription's prepaid configuration.
func (*SubscriptionsController) UpdateSubscription ¶
func (s *SubscriptionsController) UpdateSubscription( ctx context.Context, subscriptionId int, body *models.UpdateSubscriptionRequest) ( models.ApiResponse[models.SubscriptionResponse], error)
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. Updates one or more attributes of a subscription. ## Update Subscription Payment Method Change the card that your subscriber uses for their subscription. You can also use this method to change the expiration date of the card **if your gateway allows**. Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. > Note: Partial card updates for **Authorize.Net** are not allowed via this endpoint. The existing Payment Profile must be directly updated instead. ## Update Product 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 You can change a subscription's product. The new payment amount is calculated and charged at the normal start of the next period. If you require complex product changes or prorated upgrades and downgrades instead, please see the documentation on [Migrating Subscription Products](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations#product-changes-and-migrations-0-0). To perform a product change, 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 is 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 You can update dates for a subscription. ### 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: If you pass an invalid date, the correct date is automatically set to the correct date. For example, if February 30 is passed, the next billing would 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_at`. View the key/value pair of `current_period_ends_at` to verify that the `next_billing_at` date has been changed successfully. ### Calendar Billing and 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_day` and immediately READ/GET the subscription data, it will still contain the original `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, `product`, `product_price_point_id`, and `product_price_point_type` are returned as `null`.
type WebhooksController ¶
type WebhooksController struct {
// contains filtered or unexported fields
}
WebhooksController represents a controller struct.
func NewWebhooksController ¶
func NewWebhooksController(baseController baseController) *WebhooksController
NewWebhooksController creates a new instance of WebhooksController. It takes a baseController as a parameter and returns a pointer to the WebhooksController.
func (*WebhooksController) CreateEndpoint ¶
func (w *WebhooksController) CreateEndpoint( ctx context.Context, body *models.CreateOrUpdateEndpointRequest) ( models.ApiResponse[models.EndpointResponse], error)
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. Creates an endpoint and assigns a list of webhook subscriptions (events) to it. See the [Webhooks Reference](page:introduction/webhooks/webhooks-reference#events) page for available events.
func (*WebhooksController) EnableWebhooks ¶
func (w *WebhooksController) EnableWebhooks( ctx context.Context, body *models.EnableWebhooksRequest) ( models.ApiResponse[models.EnableWebhooksResponse], error)
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. Enables webhooks for your site.
func (*WebhooksController) ListEndpoints ¶
func (w *WebhooksController) ListEndpoints(ctx context.Context) ( models.ApiResponse[[]models.Endpoint], error)
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. Lists endpoints configured for a site.
func (*WebhooksController) ListWebhooks ¶
func (w *WebhooksController) ListWebhooks( ctx context.Context, input ListWebhooksInput) ( models.ApiResponse[[]models.WebhookResponse], error)
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. Retrieves a list of webhooks. You can pass query parameters if you want to filter webhooks. See the [Webhooks](page:introduction/webhooks/webhooks) documentation for more information.
func (*WebhooksController) ReplayWebhooks ¶
func (w *WebhooksController) ReplayWebhooks( ctx context.Context, body *models.ReplayWebhooksRequest) ( models.ApiResponse[models.ReplayWebhooksResponse], error)
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. Replays webhooks. Posting to this endpoint does not immediately resend the webhooks. They are added to a queue and sent as soon as possible, depending on available system resources. You can submit an array of up to 1000 webhook IDs in the replay request.
func (*WebhooksController) UpdateEndpoint ¶
func (w *WebhooksController) UpdateEndpoint( ctx context.Context, endpointId int, body *models.CreateOrUpdateEndpointRequest) ( models.ApiResponse[models.EndpointResponse], error)
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. Updates an Endpoint. You can change the `url` of your endpoint or the list of `webhook_subscriptions` to which you are subscribed. See the [Webhooks Reference](page:introduction/webhooks/webhooks-reference#events) page for available events. Always send a complete list of events to which you want to subscribe. Sending a PUT request for an existing endpoint with an empty list of `webhook_subscriptions` will unsubscribe all events. If you want to unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key.
Source Files
¶
- advance_invoice_controller.go
- api_exports_controller.go
- auth_provider.go
- authentication.go
- base_controller.go
- billing_portal_controller.go
- client.go
- component_price_points_controller.go
- components_controller.go
- configuration.go
- core.go
- coupons_controller.go
- custom_fields_controller.go
- customers_controller.go
- default_configuration.go
- events_based_billing_segments_controller.go
- events_controller.go
- insights_controller.go
- invoices_controller.go
- offers_controller.go
- payment_profiles_controller.go
- product_families_controller.go
- product_price_points_controller.go
- products_controller.go
- proforma_invoices_controller.go
- reason_codes_controller.go
- referral_codes_controller.go
- sales_commissions_controller.go
- sites_controller.go
- subscription_components_controller.go
- subscription_group_invoice_account_controller.go
- subscription_group_status_controller.go
- subscription_groups_controller.go
- subscription_invoice_account_controller.go
- subscription_notes_controller.go
- subscription_products_controller.go
- subscription_renewals_controller.go
- subscription_status_controller.go
- subscriptions_controller.go
- webhooks_controller.go
Directories
¶
| Path | Synopsis |
|---|---|
|
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 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 ). |
|
test
module
|