models

package
v1.0.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 7 Imported by: 3

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 ).

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_DATE = utilities.DEFAULT_DATE

DEFAULT_DATE is a utility.

View Source
var GetFile = https.GetFile

GetFile retrieves a file from the given fileUrl and returns it as a FileWrapper. It makes an HTTP GET request to the fileUrl to fetch the file's content and metadata.

View Source
var TimeToStringMap = utilities.TimeToStringMap

TimeToStringMap is a utility.

View Source
var TimeToStringSlice = utilities.TimeToStringSlice

TimeToStringSlice is a utility.

View Source
var ToTimeMap = utilities.ToTimeMap

ToTimeMap is a utility.

View Source
var ToTimeSlice = utilities.ToTimeSlice

ToTimeSlice is a utility.

Functions

func ToPointer

func ToPointer[T any](value T) *T

Types

type ACHAgreement

type ACHAgreement struct {
	// (Required when providing ACH agreement params) The ACH authorization agreement terms.
	AgreementTerms *string `json:"agreement_terms,omitempty"`
	// (Required when providing ACH agreement params) The first name of the person authorizing the ACH agreement.
	AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"`
	// (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement.
	AuthorizerLastName *string `json:"authorizer_last_name,omitempty"`
	// (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement.
	IpAddress *string `json:"ip_address,omitempty"`
}

ACHAgreement represents a ACHAgreement struct. (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted.

func (*ACHAgreement) MarshalJSON

func (a *ACHAgreement) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ACHAgreement. It customizes the JSON marshaling process for ACHAgreement objects.

func (*ACHAgreement) UnmarshalJSON

func (a *ACHAgreement) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ACHAgreement. It customizes the JSON unmarshaling process for ACHAgreement objects.

type AccountBalance

type AccountBalance struct {
	// The balance in cents.
	BalanceInCents *int64 `json:"balance_in_cents,omitempty"`
}

AccountBalance represents a AccountBalance struct.

func (*AccountBalance) MarshalJSON

func (a *AccountBalance) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AccountBalance. It customizes the JSON marshaling process for AccountBalance objects.

func (*AccountBalance) UnmarshalJSON

func (a *AccountBalance) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AccountBalance. It customizes the JSON unmarshaling process for AccountBalance objects.

type AccountBalances

type AccountBalances struct {
	// The balance, in cents, of the sum of the subscription's  open, payable invoices.
	OpenInvoices *AccountBalance `json:"open_invoices,omitempty"`
	// The balance, in cents, of the subscription's Pending Discount account.
	PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"`
	// The balance, in cents, of the subscription's Service Credit account.
	ServiceCredits *AccountBalance `json:"service_credits,omitempty"`
	// The balance, in cents, of the subscription's Prepayment account.
	Prepayments *AccountBalance `json:"prepayments,omitempty"`
}

AccountBalances represents a AccountBalances struct.

func (*AccountBalances) MarshalJSON

func (a *AccountBalances) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AccountBalances. It customizes the JSON marshaling process for AccountBalances objects.

func (*AccountBalances) UnmarshalJSON

func (a *AccountBalances) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AccountBalances. It customizes the JSON unmarshaling process for AccountBalances objects.

type ActivateSubscriptionRequest

type ActivateSubscriptionRequest struct {
	// You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false`  means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the  site settings (default: `true`)
	RevertOnFailure Optional[bool] `json:"revert_on_failure"`
}

ActivateSubscriptionRequest represents a ActivateSubscriptionRequest struct.

func (*ActivateSubscriptionRequest) MarshalJSON

func (a *ActivateSubscriptionRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ActivateSubscriptionRequest. It customizes the JSON marshaling process for ActivateSubscriptionRequest objects.

func (*ActivateSubscriptionRequest) UnmarshalJSON

func (a *ActivateSubscriptionRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ActivateSubscriptionRequest. It customizes the JSON unmarshaling process for ActivateSubscriptionRequest objects.

type AddCouponsRequest

type AddCouponsRequest struct {
	Codes []string `json:"codes,omitempty"`
}

AddCouponsRequest represents a AddCouponsRequest struct.

func (*AddCouponsRequest) MarshalJSON

func (a *AddCouponsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AddCouponsRequest. It customizes the JSON marshaling process for AddCouponsRequest objects.

func (*AddCouponsRequest) UnmarshalJSON

func (a *AddCouponsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AddCouponsRequest. It customizes the JSON unmarshaling process for AddCouponsRequest objects.

type AddSubscriptionToAGroup

type AddSubscriptionToAGroup struct {
	Group *interface{} `json:"group,omitempty"`
}

AddSubscriptionToAGroup represents a AddSubscriptionToAGroup struct.

func (*AddSubscriptionToAGroup) MarshalJSON

func (a *AddSubscriptionToAGroup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AddSubscriptionToAGroup. It customizes the JSON marshaling process for AddSubscriptionToAGroup objects.

func (*AddSubscriptionToAGroup) UnmarshalJSON

func (a *AddSubscriptionToAGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AddSubscriptionToAGroup. It customizes the JSON unmarshaling process for AddSubscriptionToAGroup objects.

type AddressChange added in v0.1.0

type AddressChange struct {
	Before InvoiceAddress `json:"before"`
	After  InvoiceAddress `json:"after"`
}

AddressChange represents a AddressChange struct.

func (*AddressChange) MarshalJSON added in v0.1.0

func (a *AddressChange) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AddressChange. It customizes the JSON marshaling process for AddressChange objects.

func (*AddressChange) UnmarshalJSON added in v0.1.0

func (a *AddressChange) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AddressChange. It customizes the JSON unmarshaling process for AddressChange objects.

type AgreementAcceptance

type AgreementAcceptance struct {
	// Required when providing agreement acceptance params.
	IpAddress *string `json:"ip_address,omitempty"`
	// Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params.
	TermsUrl                *string `json:"terms_url,omitempty"`
	PrivacyPolicyUrl        *string `json:"privacy_policy_url,omitempty"`
	ReturnRefundPolicyUrl   *string `json:"return_refund_policy_url,omitempty"`
	DeliveryPolicyUrl       *string `json:"delivery_policy_url,omitempty"`
	SecureCheckoutPolicyUrl *string `json:"secure_checkout_policy_url,omitempty"`
}

AgreementAcceptance represents a AgreementAcceptance struct. Required when creating a subscription with Maxio Payments.

func (*AgreementAcceptance) MarshalJSON

func (a *AgreementAcceptance) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AgreementAcceptance. It customizes the JSON marshaling process for AgreementAcceptance objects.

func (*AgreementAcceptance) UnmarshalJSON

func (a *AgreementAcceptance) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AgreementAcceptance. It customizes the JSON unmarshaling process for AgreementAcceptance objects.

type AllocateComponents

type AllocateComponents struct {
	ProrationUpgradeScheme   *string            `json:"proration_upgrade_scheme,omitempty"`   // Deprecated
	ProrationDowngradeScheme *string            `json:"proration_downgrade_scheme,omitempty"` // Deprecated
	Allocations              []CreateAllocation `json:"allocations,omitempty"`
	AccrueCharge             *bool              `json:"accrue_charge,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
	// (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription
	PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"`
	// If true, if the immediate component payment fails, initiate dunning for the subscription.
	// Otherwise, leave the charges on the subscription to pay for at renewal.
	InitiateDunning *bool `json:"initiate_dunning,omitempty"`
}

AllocateComponents represents a AllocateComponents struct.

func (*AllocateComponents) MarshalJSON

func (a *AllocateComponents) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocateComponents. It customizes the JSON marshaling process for AllocateComponents objects.

func (*AllocateComponents) UnmarshalJSON

func (a *AllocateComponents) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocateComponents. It customizes the JSON unmarshaling process for AllocateComponents objects.

type Allocation

type Allocation struct {
	// The allocation unique id
	AllocationId *int `json:"allocation_id,omitempty"`
	// The integer component ID for the allocation. This references a component that you have created in your Product setup
	ComponentId *int `json:"component_id,omitempty"`
	// The handle of the component. This references a component that you have created in your Product setup
	ComponentHandle Optional[string] `json:"component_handle"`
	// The integer subscription ID for the allocation. This references a unique subscription in your Site
	SubscriptionId *int `json:"subscription_id,omitempty"`
	// The allocated quantity set in to effect by the allocation. String for components supporting fractional quantities
	Quantity *interface{} `json:"quantity,omitempty"`
	// The allocated quantity that was in effect before this allocation was created. String for components supporting fractional quantities
	PreviousQuantity *interface{} `json:"previous_quantity,omitempty"`
	// The memo passed when the allocation was created
	Memo Optional[string] `json:"memo"`
	// The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// Timestamp indicating when this allocation was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period.
	ProrationUpgradeScheme *string `json:"proration_upgrade_scheme,omitempty"` // Deprecated
	// The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period.
	ProrationDowngradeScheme *string `json:"proration_downgrade_scheme,omitempty"` // Deprecated
	PricePointId             *int    `json:"price_point_id,omitempty"`
	PricePointName           *string `json:"price_point_name,omitempty"`
	PricePointHandle         *string `json:"price_point_handle,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit         *IntervalUnit `json:"interval_unit,omitempty"`
	PreviousPricePointId *int          `json:"previous_price_point_id,omitempty"`
	// If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately.
	AccrueCharge *bool `json:"accrue_charge,omitempty"`
	// If true, if the immediate component payment fails, initiate dunning for the subscription.
	// Otherwise, leave the charges on the subscription to pay for at renewal.
	InitiateDunning *bool `json:"initiate_dunning,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]           `json:"downgrade_credit"`
	Payment         Optional[PaymentForAllocation] `json:"payment"`
}

Allocation represents a Allocation struct.

func (*Allocation) MarshalJSON

func (a *Allocation) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Allocation. It customizes the JSON marshaling process for Allocation objects.

func (*Allocation) UnmarshalJSON

func (a *Allocation) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Allocation. It customizes the JSON unmarshaling process for Allocation objects.

type AllocationExpirationDate

type AllocationExpirationDate struct {
	ExpiresAt *string `json:"expires_at,omitempty"`
}

AllocationExpirationDate represents a AllocationExpirationDate struct.

func (*AllocationExpirationDate) MarshalJSON

func (a *AllocationExpirationDate) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationExpirationDate. It customizes the JSON marshaling process for AllocationExpirationDate objects.

func (*AllocationExpirationDate) UnmarshalJSON

func (a *AllocationExpirationDate) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationExpirationDate. It customizes the JSON unmarshaling process for AllocationExpirationDate objects.

type AllocationPreview

type AllocationPreview struct {
	StartDate            *string                     `json:"start_date,omitempty"`
	EndDate              *string                     `json:"end_date,omitempty"`
	SubtotalInCents      *int64                      `json:"subtotal_in_cents,omitempty"`
	TotalTaxInCents      *int64                      `json:"total_tax_in_cents,omitempty"`
	TotalDiscountInCents *int64                      `json:"total_discount_in_cents,omitempty"`
	TotalInCents         *int64                      `json:"total_in_cents,omitempty"`
	Direction            *AllocationPreviewDirection `json:"direction,omitempty"`
	ProrationScheme      *string                     `json:"proration_scheme,omitempty"`
	LineItems            []AllocationPreviewLineItem `json:"line_items,omitempty"`
	AccrueCharge         *bool                       `json:"accrue_charge,omitempty"`
	Allocations          []AllocationPreviewItem     `json:"allocations,omitempty"`
	PeriodType           *string                     `json:"period_type,omitempty"`
	// An integer representing the amount of the subscription's current balance
	ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"`
}

AllocationPreview represents a AllocationPreview struct.

func (*AllocationPreview) MarshalJSON

func (a *AllocationPreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationPreview. It customizes the JSON marshaling process for AllocationPreview objects.

func (*AllocationPreview) UnmarshalJSON

func (a *AllocationPreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreview. It customizes the JSON unmarshaling process for AllocationPreview objects.

type AllocationPreviewDirection

type AllocationPreviewDirection string

AllocationPreviewDirection is a string enum.

const (
	AllocationPreviewDirection_UPGRADE   AllocationPreviewDirection = "upgrade"
	AllocationPreviewDirection_DOWNGRADE AllocationPreviewDirection = "downgrade"
)

type AllocationPreviewItem

type AllocationPreviewItem struct {
	ComponentId              *int             `json:"component_id,omitempty"`
	SubscriptionId           *int             `json:"subscription_id,omitempty"`
	Quantity                 *interface{}     `json:"quantity,omitempty"`
	PreviousQuantity         *interface{}     `json:"previous_quantity,omitempty"`
	Memo                     Optional[string] `json:"memo"`
	Timestamp                Optional[string] `json:"timestamp"`
	ProrationUpgradeScheme   *string          `json:"proration_upgrade_scheme,omitempty"`   // Deprecated
	ProrationDowngradeScheme *string          `json:"proration_downgrade_scheme,omitempty"` // Deprecated
	AccrueCharge             *bool            `json:"accrue_charge,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
	PricePointId    *int                 `json:"price_point_id,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit         *IntervalUnit    `json:"interval_unit,omitempty"`
	PreviousPricePointId *int             `json:"previous_price_point_id,omitempty"`
	PricePointHandle     *string          `json:"price_point_handle,omitempty"`
	PricePointName       *string          `json:"price_point_name,omitempty"`
	ComponentHandle      Optional[string] `json:"component_handle"`
}

AllocationPreviewItem represents a AllocationPreviewItem struct.

func (*AllocationPreviewItem) MarshalJSON

func (a *AllocationPreviewItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationPreviewItem. It customizes the JSON marshaling process for AllocationPreviewItem objects.

func (*AllocationPreviewItem) UnmarshalJSON

func (a *AllocationPreviewItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreviewItem. It customizes the JSON unmarshaling process for AllocationPreviewItem objects.

type AllocationPreviewLineItem

type AllocationPreviewLineItem struct {
	// A handle for the line item transaction type
	TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"`
	// A handle for the line item kind for allocation preview
	Kind                  *AllocationPreviewLineItemKind `json:"kind,omitempty"`
	AmountInCents         *int64                         `json:"amount_in_cents,omitempty"`
	Memo                  *string                        `json:"memo,omitempty"`
	DiscountAmountInCents *int64                         `json:"discount_amount_in_cents,omitempty"`
	TaxableAmountInCents  *int64                         `json:"taxable_amount_in_cents,omitempty"`
	ComponentId           *int                           `json:"component_id,omitempty"`
	ComponentHandle       *string                        `json:"component_handle,omitempty"`
	// Visible when using Fine-grained Component Control
	Direction *AllocationPreviewDirection `json:"direction,omitempty"`
}

AllocationPreviewLineItem represents a AllocationPreviewLineItem struct.

func (*AllocationPreviewLineItem) MarshalJSON

func (a *AllocationPreviewLineItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationPreviewLineItem. It customizes the JSON marshaling process for AllocationPreviewLineItem objects.

func (*AllocationPreviewLineItem) UnmarshalJSON

func (a *AllocationPreviewLineItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreviewLineItem. It customizes the JSON unmarshaling process for AllocationPreviewLineItem objects.

type AllocationPreviewLineItemKind

type AllocationPreviewLineItemKind string

AllocationPreviewLineItemKind is a string enum. A handle for the line item kind for allocation preview

const (
	AllocationPreviewLineItemKind_QUANTITYBASEDCOMPONENT AllocationPreviewLineItemKind = "quantity_based_component"
	AllocationPreviewLineItemKind_ONOFFCOMPONENT         AllocationPreviewLineItemKind = "on_off_component"
	AllocationPreviewLineItemKind_COUPON                 AllocationPreviewLineItemKind = "coupon"
	AllocationPreviewLineItemKind_TAX                    AllocationPreviewLineItemKind = "tax"
)

type AllocationPreviewResponse

type AllocationPreviewResponse struct {
	AllocationPreview AllocationPreview `json:"allocation_preview"`
}

AllocationPreviewResponse represents a AllocationPreviewResponse struct.

func (*AllocationPreviewResponse) MarshalJSON

func (a *AllocationPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationPreviewResponse. It customizes the JSON marshaling process for AllocationPreviewResponse objects.

func (*AllocationPreviewResponse) UnmarshalJSON

func (a *AllocationPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationPreviewResponse. It customizes the JSON unmarshaling process for AllocationPreviewResponse objects.

type AllocationResponse

type AllocationResponse struct {
	Allocation *Allocation `json:"allocation,omitempty"`
}

AllocationResponse represents a AllocationResponse struct.

func (*AllocationResponse) MarshalJSON

func (a *AllocationResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationResponse. It customizes the JSON marshaling process for AllocationResponse objects.

func (*AllocationResponse) UnmarshalJSON

func (a *AllocationResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationResponse. It customizes the JSON unmarshaling process for AllocationResponse objects.

type AllocationSettings

type AllocationSettings struct {
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
	// Either "true" or "false".
	AccrueCharge *string `json:"accrue_charge,omitempty"`
}

AllocationSettings represents a AllocationSettings struct.

func (*AllocationSettings) MarshalJSON

func (a *AllocationSettings) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AllocationSettings. It customizes the JSON marshaling process for AllocationSettings objects.

func (*AllocationSettings) UnmarshalJSON

func (a *AllocationSettings) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AllocationSettings. It customizes the JSON unmarshaling process for AllocationSettings objects.

type ApiResponse

type ApiResponse[T any] struct {
	https.ApiResponse[T]
}

ApiResponse is a generic struct that represents an API response containing data and the HTTP response. The `Data` field holds the data of any type `T` returned by the API. The `Response` field contains the underlying HTTP response associated with the API call.

func NewApiResponse

func NewApiResponse[T any](
	data T,
	response *http.Response) ApiResponse[T]

NewApiResponse creates a new instance of ApiResponse. It takes the `data` of type `T` and the `response` as parameters, and returns an ApiResponse[T] struct.

type AppliedCreditNoteData added in v0.1.0

type AppliedCreditNoteData struct {
	// The UID of the credit note
	Uid *string `json:"uid,omitempty"`
	// The number of the credit note
	Number *string `json:"number,omitempty"`
}

AppliedCreditNoteData represents a AppliedCreditNoteData struct.

func (*AppliedCreditNoteData) MarshalJSON added in v0.1.0

func (a *AppliedCreditNoteData) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AppliedCreditNoteData. It customizes the JSON marshaling process for AppliedCreditNoteData objects.

func (*AppliedCreditNoteData) UnmarshalJSON added in v0.1.0

func (a *AppliedCreditNoteData) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AppliedCreditNoteData. It customizes the JSON unmarshaling process for AppliedCreditNoteData objects.

type AttributeError

type AttributeError struct {
	Attribute []string `json:"attribute"`
}

AttributeError represents a AttributeError struct.

func (*AttributeError) MarshalJSON

func (a *AttributeError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AttributeError. It customizes the JSON marshaling process for AttributeError objects.

func (*AttributeError) UnmarshalJSON

func (a *AttributeError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AttributeError. It customizes the JSON unmarshaling process for AttributeError objects.

type AutoInvite

type AutoInvite int

AutoInvite is a int enum.

const (
	AutoInvite_NO  AutoInvite = 0
	AutoInvite_YES AutoInvite = 1
)

type AutoResume

type AutoResume struct {
	AutomaticallyResumeAt Optional[time.Time] `json:"automatically_resume_at"`
}

AutoResume represents a AutoResume struct.

func (*AutoResume) MarshalJSON

func (a *AutoResume) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for AutoResume. It customizes the JSON marshaling process for AutoResume objects.

func (*AutoResume) UnmarshalJSON

func (a *AutoResume) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for AutoResume. It customizes the JSON unmarshaling process for AutoResume objects.

type BankAccountAttributes

type BankAccountAttributes struct {
	ChargifyToken *string `json:"chargify_token,omitempty"`
	// (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides
	BankName *string `json:"bank_name,omitempty"`
	// (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API
	BankRoutingNumber *string `json:"bank_routing_number,omitempty"`
	// (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number
	BankAccountNumber *string `json:"bank_account_number,omitempty"`
	// Defaults to checking
	BankAccountType *BankAccountType `json:"bank_account_type,omitempty"`
	// (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
	BankBranchCode *string `json:"bank_branch_code,omitempty"`
	// (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided
	BankIban *string `json:"bank_iban,omitempty"`
	// Defaults to personal
	BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"`
	PaymentType           *PaymentType           `json:"payment_type,omitempty"`
	// The vault that stores the payment profile with the provided vault_token.
	CurrentVault *BankAccountVault `json:"current_vault,omitempty"`
	VaultToken   *string           `json:"vault_token,omitempty"`
	// (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token
	CustomerVaultToken *string `json:"customer_vault_token,omitempty"`
}

BankAccountAttributes represents a BankAccountAttributes struct.

func (*BankAccountAttributes) MarshalJSON

func (b *BankAccountAttributes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BankAccountAttributes. It customizes the JSON marshaling process for BankAccountAttributes objects.

func (*BankAccountAttributes) UnmarshalJSON

func (b *BankAccountAttributes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BankAccountAttributes. It customizes the JSON unmarshaling process for BankAccountAttributes objects.

type BankAccountHolderType

type BankAccountHolderType string

BankAccountHolderType is a string enum. Defaults to personal

const (
	BankAccountHolderType_PERSONAL BankAccountHolderType = "personal"
	BankAccountHolderType_BUSINESS BankAccountHolderType = "business"
)

type BankAccountPaymentProfile

type BankAccountPaymentProfile struct {
	// The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer
	Id *int `json:"id,omitempty"`
	// The first name of the bank account holder
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the bank account holder
	LastName *string `json:"last_name,omitempty"`
	// The Chargify-assigned id for the customer record to which the bank account belongs
	CustomerId *int `json:"customer_id,omitempty"`
	// The vault that stores the payment profile with the provided vault_token.
	CurrentVault *BankAccountVault `json:"current_vault,omitempty"`
	// The “token” provided by your vault storage for an already stored payment profile
	VaultToken *string `json:"vault_token,omitempty"`
	// The current billing street address for the bank account
	BillingAddress Optional[string] `json:"billing_address"`
	// The current billing address city for the bank account
	BillingCity Optional[string] `json:"billing_city"`
	// The current billing address state for the bank account
	BillingState Optional[string] `json:"billing_state"`
	// The current billing address zip code for the bank account
	BillingZip Optional[string] `json:"billing_zip"`
	// The current billing address country for the bank account
	BillingCountry Optional[string] `json:"billing_country"`
	// (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token.
	CustomerVaultToken Optional[string] `json:"customer_vault_token"`
	// The current billing street address, second line, for the bank account
	BillingAddress2 Optional[string] `json:"billing_address_2"`
	// The bank where the account resides
	BankName *string `json:"bank_name,omitempty"`
	// A string representation of the stored bank routing number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’). payment_type will be bank_account
	MaskedBankRoutingNumber string `json:"masked_bank_routing_number"`
	// A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’)
	MaskedBankAccountNumber string `json:"masked_bank_account_number"`
	// Defaults to checking
	BankAccountType *BankAccountType `json:"bank_account_type,omitempty"`
	// Defaults to personal
	BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"`
	PaymentType           *PaymentType           `json:"payment_type,omitempty"`
	// denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account
	Verified             *bool            `json:"verified,omitempty"`
	SiteGatewaySettingId *int             `json:"site_gateway_setting_id,omitempty"`
	GatewayHandle        Optional[string] `json:"gateway_handle"`
}

BankAccountPaymentProfile represents a BankAccountPaymentProfile struct.

func (*BankAccountPaymentProfile) MarshalJSON

func (b *BankAccountPaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BankAccountPaymentProfile. It customizes the JSON marshaling process for BankAccountPaymentProfile objects.

func (*BankAccountPaymentProfile) UnmarshalJSON

func (b *BankAccountPaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BankAccountPaymentProfile. It customizes the JSON unmarshaling process for BankAccountPaymentProfile objects.

type BankAccountResponse

type BankAccountResponse struct {
	PaymentProfile BankAccountPaymentProfile `json:"payment_profile"`
}

BankAccountResponse represents a BankAccountResponse struct.

func (*BankAccountResponse) MarshalJSON

func (b *BankAccountResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BankAccountResponse. It customizes the JSON marshaling process for BankAccountResponse objects.

func (*BankAccountResponse) UnmarshalJSON

func (b *BankAccountResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BankAccountResponse. It customizes the JSON unmarshaling process for BankAccountResponse objects.

type BankAccountType

type BankAccountType string

BankAccountType is a string enum. Defaults to checking

const (
	BankAccountType_CHECKING BankAccountType = "checking"
	BankAccountType_SAVINGS  BankAccountType = "savings"
)

type BankAccountVault

type BankAccountVault string

BankAccountVault is a string enum. The vault that stores the payment profile with the provided vault_token.

const (
	BankAccountVault_BOGUS         BankAccountVault = "bogus"
	BankAccountVault_AUTHORIZENET  BankAccountVault = "authorizenet"
	BankAccountVault_STRIPECONNECT BankAccountVault = "stripe_connect"
	BankAccountVault_BRAINTREEBLUE BankAccountVault = "braintree_blue"
	BankAccountVault_GOCARDLESS    BankAccountVault = "gocardless"
)

type BankAccountVerification

type BankAccountVerification struct {
	Deposit1InCents *int64 `json:"deposit_1_in_cents,omitempty"`
	Deposit2InCents *int64 `json:"deposit_2_in_cents,omitempty"`
}

BankAccountVerification represents a BankAccountVerification struct.

func (*BankAccountVerification) MarshalJSON

func (b *BankAccountVerification) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BankAccountVerification. It customizes the JSON marshaling process for BankAccountVerification objects.

func (*BankAccountVerification) UnmarshalJSON

func (b *BankAccountVerification) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BankAccountVerification. It customizes the JSON unmarshaling process for BankAccountVerification objects.

type BankAccountVerificationRequest

type BankAccountVerificationRequest struct {
	BankAccountVerification BankAccountVerification `json:"bank_account_verification"`
}

BankAccountVerificationRequest represents a BankAccountVerificationRequest struct.

func (*BankAccountVerificationRequest) MarshalJSON

func (b *BankAccountVerificationRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BankAccountVerificationRequest. It customizes the JSON marshaling process for BankAccountVerificationRequest objects.

func (*BankAccountVerificationRequest) UnmarshalJSON

func (b *BankAccountVerificationRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BankAccountVerificationRequest. It customizes the JSON unmarshaling process for BankAccountVerificationRequest objects.

type BaseRefundError

type BaseRefundError struct {
	Base []interface{} `json:"base,omitempty"`
}

BaseRefundError represents a BaseRefundError struct.

func (*BaseRefundError) MarshalJSON

func (b *BaseRefundError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BaseRefundError. It customizes the JSON marshaling process for BaseRefundError objects.

func (*BaseRefundError) UnmarshalJSON

func (b *BaseRefundError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BaseRefundError. It customizes the JSON unmarshaling process for BaseRefundError objects.

type BaseStringError

type BaseStringError struct {
	Base []string `json:"base,omitempty"`
}

BaseStringError represents a BaseStringError struct. The error is base if it is not directly associated with a single attribute.

func (*BaseStringError) MarshalJSON

func (b *BaseStringError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BaseStringError. It customizes the JSON marshaling process for BaseStringError objects.

func (*BaseStringError) UnmarshalJSON

func (b *BaseStringError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BaseStringError. It customizes the JSON unmarshaling process for BaseStringError objects.

type BasicDateField

type BasicDateField string

BasicDateField is a string enum. Allows to filter by `created_at` or `updated_at`.

const (
	BasicDateField_UPDATEDAT BasicDateField = "updated_at"
	BasicDateField_CREATEDAT BasicDateField = "created_at"
)

type BatchJob

type BatchJob struct {
	Id         *int             `json:"id,omitempty"`
	FinishedAt Optional[string] `json:"finished_at"`
	RowCount   Optional[int]    `json:"row_count"`
	CreatedAt  Optional[string] `json:"created_at"`
	Completed  *string          `json:"completed,omitempty"`
}

BatchJob represents a BatchJob struct.

func (*BatchJob) MarshalJSON

func (b *BatchJob) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BatchJob. It customizes the JSON marshaling process for BatchJob objects.

func (*BatchJob) UnmarshalJSON

func (b *BatchJob) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BatchJob. It customizes the JSON unmarshaling process for BatchJob objects.

type BatchJobResponse

type BatchJobResponse struct {
	Batchjob BatchJob `json:"batchjob"`
}

BatchJobResponse represents a BatchJobResponse struct.

func (*BatchJobResponse) MarshalJSON

func (b *BatchJobResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BatchJobResponse. It customizes the JSON marshaling process for BatchJobResponse objects.

func (*BatchJobResponse) UnmarshalJSON

func (b *BatchJobResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BatchJobResponse. It customizes the JSON unmarshaling process for BatchJobResponse objects.

type BillingAddress

type BillingAddress struct {
	Street  Optional[string] `json:"street"`
	Line2   Optional[string] `json:"line2"`
	City    Optional[string] `json:"city"`
	State   Optional[string] `json:"state"`
	Zip     Optional[string] `json:"zip"`
	Country Optional[string] `json:"country"`
}

BillingAddress represents a BillingAddress struct.

func (*BillingAddress) MarshalJSON

func (b *BillingAddress) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BillingAddress. It customizes the JSON marshaling process for BillingAddress objects.

func (*BillingAddress) UnmarshalJSON

func (b *BillingAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BillingAddress. It customizes the JSON unmarshaling process for BillingAddress objects.

type BillingManifest

type BillingManifest struct {
	LineItems              []BillingManifestItem `json:"line_items,omitempty"`
	TotalInCents           *int64                `json:"total_in_cents,omitempty"`
	TotalDiscountInCents   *int64                `json:"total_discount_in_cents,omitempty"`
	TotalTaxInCents        *int64                `json:"total_tax_in_cents,omitempty"`
	SubtotalInCents        *int64                `json:"subtotal_in_cents,omitempty"`
	StartDate              *string               `json:"start_date,omitempty"`
	EndDate                *string               `json:"end_date,omitempty"`
	PeriodType             *string               `json:"period_type,omitempty"`
	ExistingBalanceInCents *int64                `json:"existing_balance_in_cents,omitempty"`
}

BillingManifest represents a BillingManifest struct.

func (*BillingManifest) MarshalJSON

func (b *BillingManifest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BillingManifest. It customizes the JSON marshaling process for BillingManifest objects.

func (*BillingManifest) UnmarshalJSON

func (b *BillingManifest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BillingManifest. It customizes the JSON unmarshaling process for BillingManifest objects.

type BillingManifestItem

type BillingManifestItem struct {
	// A handle for the line item transaction type
	TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"`
	// A handle for the billing manifest line item kind
	Kind                  *BillingManifestLineItemKind `json:"kind,omitempty"`
	AmountInCents         *int64                       `json:"amount_in_cents,omitempty"`
	Memo                  *string                      `json:"memo,omitempty"`
	DiscountAmountInCents *int64                       `json:"discount_amount_in_cents,omitempty"`
	TaxableAmountInCents  *int64                       `json:"taxable_amount_in_cents,omitempty"`
	ComponentId           *int                         `json:"component_id,omitempty"`
	ComponentHandle       *string                      `json:"component_handle,omitempty"`
	ComponentName         *string                      `json:"component_name,omitempty"`
	ProductId             *int                         `json:"product_id,omitempty"`
	ProductHandle         *string                      `json:"product_handle,omitempty"`
	ProductName           *string                      `json:"product_name,omitempty"`
	PeriodRangeStart      *string                      `json:"period_range_start,omitempty"`
	PeriodRangeEnd        *string                      `json:"period_range_end,omitempty"`
}

BillingManifestItem represents a BillingManifestItem struct.

func (*BillingManifestItem) MarshalJSON

func (b *BillingManifestItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BillingManifestItem. It customizes the JSON marshaling process for BillingManifestItem objects.

func (*BillingManifestItem) UnmarshalJSON

func (b *BillingManifestItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BillingManifestItem. It customizes the JSON unmarshaling process for BillingManifestItem objects.

type BillingManifestLineItemKind

type BillingManifestLineItemKind string

BillingManifestLineItemKind is a string enum. A handle for the billing manifest line item kind

const (
	BillingManifestLineItemKind_BASELINE  BillingManifestLineItemKind = "baseline"
	BillingManifestLineItemKind_INITIAL   BillingManifestLineItemKind = "initial"
	BillingManifestLineItemKind_TRIAL     BillingManifestLineItemKind = "trial"
	BillingManifestLineItemKind_COUPON    BillingManifestLineItemKind = "coupon"
	BillingManifestLineItemKind_COMPONENT BillingManifestLineItemKind = "component"
	BillingManifestLineItemKind_TAX       BillingManifestLineItemKind = "tax"
)

type BillingSchedule

type BillingSchedule struct {
	// The initial_billing_at attribute in Maxio allows you to specify a custom starting date for billing cycles associated with components that have their own billing frequency set. Only ISO8601 format is supported.
	InitialBillingAt *time.Time `json:"initial_billing_at,omitempty"`
}

BillingSchedule represents a BillingSchedule struct. This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled

func (*BillingSchedule) MarshalJSON

func (b *BillingSchedule) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BillingSchedule. It customizes the JSON marshaling process for BillingSchedule objects.

func (*BillingSchedule) UnmarshalJSON

func (b *BillingSchedule) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BillingSchedule. It customizes the JSON unmarshaling process for BillingSchedule objects.

type Breakouts

type Breakouts struct {
	PlanAmountInCents    *int64  `json:"plan_amount_in_cents,omitempty"`
	PlanAmountFormatted  *string `json:"plan_amount_formatted,omitempty"`
	UsageAmountInCents   *int64  `json:"usage_amount_in_cents,omitempty"`
	UsageAmountFormatted *string `json:"usage_amount_formatted,omitempty"`
}

Breakouts represents a Breakouts struct.

func (*Breakouts) MarshalJSON

func (b *Breakouts) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Breakouts. It customizes the JSON marshaling process for Breakouts objects.

func (*Breakouts) UnmarshalJSON

func (b *Breakouts) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Breakouts. It customizes the JSON unmarshaling process for Breakouts objects.

type BulkComponentSPricePointAssignment

type BulkComponentSPricePointAssignment struct {
	Components []ComponentSPricePointAssignment `json:"components,omitempty"`
}

BulkComponentSPricePointAssignment represents a BulkComponentSPricePointAssignment struct.

func (*BulkComponentSPricePointAssignment) MarshalJSON

func (b *BulkComponentSPricePointAssignment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkComponentSPricePointAssignment. It customizes the JSON marshaling process for BulkComponentSPricePointAssignment objects.

func (*BulkComponentSPricePointAssignment) UnmarshalJSON

func (b *BulkComponentSPricePointAssignment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkComponentSPricePointAssignment. It customizes the JSON unmarshaling process for BulkComponentSPricePointAssignment objects.

type BulkCreateProductPricePointsRequest

type BulkCreateProductPricePointsRequest struct {
	PricePoints []CreateProductPricePoint `json:"price_points"`
}

BulkCreateProductPricePointsRequest represents a BulkCreateProductPricePointsRequest struct.

func (*BulkCreateProductPricePointsRequest) MarshalJSON

func (b *BulkCreateProductPricePointsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkCreateProductPricePointsRequest. It customizes the JSON marshaling process for BulkCreateProductPricePointsRequest objects.

func (*BulkCreateProductPricePointsRequest) UnmarshalJSON

func (b *BulkCreateProductPricePointsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkCreateProductPricePointsRequest. It customizes the JSON unmarshaling process for BulkCreateProductPricePointsRequest objects.

type BulkCreateProductPricePointsResponse

type BulkCreateProductPricePointsResponse struct {
	PricePoints []ProductPricePoint `json:"price_points,omitempty"`
}

BulkCreateProductPricePointsResponse represents a BulkCreateProductPricePointsResponse struct.

func (*BulkCreateProductPricePointsResponse) MarshalJSON

func (b *BulkCreateProductPricePointsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkCreateProductPricePointsResponse. It customizes the JSON marshaling process for BulkCreateProductPricePointsResponse objects.

func (*BulkCreateProductPricePointsResponse) UnmarshalJSON

func (b *BulkCreateProductPricePointsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkCreateProductPricePointsResponse. It customizes the JSON unmarshaling process for BulkCreateProductPricePointsResponse objects.

type BulkCreateSegments

type BulkCreateSegments struct {
	Segments []CreateSegment `json:"segments,omitempty"`
}

BulkCreateSegments represents a BulkCreateSegments struct.

func (*BulkCreateSegments) MarshalJSON

func (b *BulkCreateSegments) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkCreateSegments. It customizes the JSON marshaling process for BulkCreateSegments objects.

func (*BulkCreateSegments) UnmarshalJSON

func (b *BulkCreateSegments) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkCreateSegments. It customizes the JSON unmarshaling process for BulkCreateSegments objects.

type BulkUpdateSegments

type BulkUpdateSegments struct {
	Segments []BulkUpdateSegmentsItem `json:"segments,omitempty"`
}

BulkUpdateSegments represents a BulkUpdateSegments struct.

func (*BulkUpdateSegments) MarshalJSON

func (b *BulkUpdateSegments) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkUpdateSegments. It customizes the JSON marshaling process for BulkUpdateSegments objects.

func (*BulkUpdateSegments) UnmarshalJSON

func (b *BulkUpdateSegments) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkUpdateSegments. It customizes the JSON unmarshaling process for BulkUpdateSegments objects.

type BulkUpdateSegmentsItem

type BulkUpdateSegmentsItem struct {
	// The ID of the segment you want to update.
	Id int `json:"id"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme                `json:"pricing_scheme"`
	Prices        []CreateOrUpdateSegmentPrice `json:"prices"`
}

BulkUpdateSegmentsItem represents a BulkUpdateSegmentsItem struct.

func (*BulkUpdateSegmentsItem) MarshalJSON

func (b *BulkUpdateSegmentsItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for BulkUpdateSegmentsItem. It customizes the JSON marshaling process for BulkUpdateSegmentsItem objects.

func (*BulkUpdateSegmentsItem) UnmarshalJSON

func (b *BulkUpdateSegmentsItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for BulkUpdateSegmentsItem. It customizes the JSON unmarshaling process for BulkUpdateSegmentsItem objects.

type CalendarBilling

type CalendarBilling struct {
	// A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'.
	SnapDay                    *interface{}     `json:"snap_day,omitempty"`
	CalendarBillingFirstCharge *FirstChargeType `json:"calendar_billing_first_charge,omitempty"`
}

CalendarBilling represents a CalendarBilling struct. (Optional). Cannot be used when also specifying next_billing_at

func (*CalendarBilling) MarshalJSON

func (c *CalendarBilling) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CalendarBilling. It customizes the JSON marshaling process for CalendarBilling objects.

func (*CalendarBilling) UnmarshalJSON

func (c *CalendarBilling) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CalendarBilling. It customizes the JSON unmarshaling process for CalendarBilling objects.

type CancelGroupedSubscriptionsRequest

type CancelGroupedSubscriptionsRequest struct {
	ChargeUnbilledUsage *bool `json:"charge_unbilled_usage,omitempty"`
}

CancelGroupedSubscriptionsRequest represents a CancelGroupedSubscriptionsRequest struct.

func (*CancelGroupedSubscriptionsRequest) MarshalJSON

func (c *CancelGroupedSubscriptionsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CancelGroupedSubscriptionsRequest. It customizes the JSON marshaling process for CancelGroupedSubscriptionsRequest objects.

func (*CancelGroupedSubscriptionsRequest) UnmarshalJSON

func (c *CancelGroupedSubscriptionsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CancelGroupedSubscriptionsRequest. It customizes the JSON unmarshaling process for CancelGroupedSubscriptionsRequest objects.

type CancellationMethod

type CancellationMethod string

CancellationMethod is a string enum. The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled.

const (
	CancellationMethod_MERCHANTUI    CancellationMethod = "merchant_ui"
	CancellationMethod_MERCHANTAPI   CancellationMethod = "merchant_api"
	CancellationMethod_DUNNING       CancellationMethod = "dunning"
	CancellationMethod_BILLINGPORTAL CancellationMethod = "billing_portal"
	CancellationMethod_UNKNOWN       CancellationMethod = "unknown"
)

type CancellationOptions

type CancellationOptions struct {
	// For your internal use. An indication as to why the subscription is being canceled.
	CancellationMessage *string `json:"cancellation_message,omitempty"`
	// The reason code associated with the cancellation. See the list of reason codes associated with your site.
	ReasonCode *string `json:"reason_code,omitempty"`
}

CancellationOptions represents a CancellationOptions struct.

func (*CancellationOptions) MarshalJSON

func (c *CancellationOptions) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CancellationOptions. It customizes the JSON marshaling process for CancellationOptions objects.

func (*CancellationOptions) UnmarshalJSON

func (c *CancellationOptions) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CancellationOptions. It customizes the JSON unmarshaling process for CancellationOptions objects.

type CancellationRequest

type CancellationRequest struct {
	Subscription CancellationOptions `json:"subscription"`
}

CancellationRequest represents a CancellationRequest struct.

func (*CancellationRequest) MarshalJSON

func (c *CancellationRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CancellationRequest. It customizes the JSON marshaling process for CancellationRequest objects.

func (*CancellationRequest) UnmarshalJSON

func (c *CancellationRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CancellationRequest. It customizes the JSON unmarshaling process for CancellationRequest objects.

type CardType

type CardType string

CardType is a string enum. The type of card used.

const (
	CardType_VISA               CardType = "visa"
	CardType_MASTER             CardType = "master"
	CardType_ELO                CardType = "elo"
	CardType_CABAL              CardType = "cabal"
	CardType_ALELO              CardType = "alelo"
	CardType_DISCOVER           CardType = "discover"
	CardType_AMERICANEXPRESS    CardType = "american_express"
	CardType_NARANJA            CardType = "naranja"
	CardType_DINERSCLUB         CardType = "diners_club"
	CardType_JCB                CardType = "jcb"
	CardType_DANKORT            CardType = "dankort"
	CardType_MAESTRO            CardType = "maestro"
	CardType_MAESTRONOLUHN      CardType = "maestro_no_luhn"
	CardType_FORBRUGSFORENINGEN CardType = "forbrugsforeningen"
	CardType_SODEXO             CardType = "sodexo"
	CardType_ALIA               CardType = "alia"
	CardType_VR                 CardType = "vr"
	CardType_UNIONPAY           CardType = "unionpay"
	CardType_CARNET             CardType = "carnet"
	CardType_CARTESBANCAIRES    CardType = "cartes_bancaires"
	CardType_OLIMPICA           CardType = "olimpica"
	CardType_CREDITEL           CardType = "creditel"
	CardType_CONFIABLE          CardType = "confiable"
	CardType_SYNCHRONY          CardType = "synchrony"
	CardType_ROUTEX             CardType = "routex"
	CardType_MADA               CardType = "mada"
	CardType_BPPLUS             CardType = "bp_plus"
	CardType_PASSCARD           CardType = "passcard"
	CardType_EDENRED            CardType = "edenred"
	CardType_ANDA               CardType = "anda"
	CardType_TARJETAD           CardType = "tarjeta-d"
	CardType_HIPERCARD          CardType = "hipercard"
	CardType_BOGUS              CardType = "bogus"
	CardType_ENUMSWITCH         CardType = "switch"
	CardType_SOLO               CardType = "solo"
	CardType_LASER              CardType = "laser"
)

type ChargifyEBB

type ChargifyEBB struct {
	// This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add `chargify.timestamp` to the event payload and set the value to `now`.
	Timestamp *string `json:"timestamp,omitempty"`
	// A unique ID set by Chargify. Please note that this field is reserved. If `chargify.id` is present in the request payload, it will be overwritten.
	Id *string `json:"id,omitempty"`
	// An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If `chargify.created_at` is present in the request payload, it will be overwritten.
	CreatedAt *string `json:"created_at,omitempty"`
	// User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
	UniquenessToken *string `json:"uniqueness_token,omitempty"`
	// Id of Maxio Advanced Billing Subscription which is connected to this event.
	// Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream.
	SubscriptionId *int `json:"subscription_id,omitempty"`
	// Reference of Maxio Advanced Billing Subscription which is connected to this event.
	// Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream.
	SubscriptionReference *string `json:"subscription_reference,omitempty"`
}

ChargifyEBB represents a ChargifyEBB struct.

func (*ChargifyEBB) MarshalJSON

func (c *ChargifyEBB) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ChargifyEBB. It customizes the JSON marshaling process for ChargifyEBB objects.

func (*ChargifyEBB) UnmarshalJSON

func (c *ChargifyEBB) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ChargifyEBB. It customizes the JSON unmarshaling process for ChargifyEBB objects.

type CleanupScope

type CleanupScope string

CleanupScope is a string enum. all: Will clear all products, customers, and related subscriptions from the site. customers: Will clear only customers and related subscriptions (leaving the products untouched) for the site. Revenue will also be reset to 0.

const (
	CleanupScope_ALL       CleanupScope = "all"
	CleanupScope_CUSTOMERS CleanupScope = "customers"
)

type CollectionMethod added in v0.1.0

type CollectionMethod string

CollectionMethod is a string enum. The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.

const (
	CollectionMethod_AUTOMATIC  CollectionMethod = "automatic"
	CollectionMethod_REMITTANCE CollectionMethod = "remittance"
	CollectionMethod_PREPAID    CollectionMethod = "prepaid"
	CollectionMethod_INVOICE    CollectionMethod = "invoice"
)

type Component

type Component struct {
	// The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API.
	Id *int `json:"id,omitempty"`
	// The name of the Component, suitable for display on statements. i.e. Text Messages.
	Name *string `json:"name,omitempty"`
	// The component API handle
	Handle        Optional[string]        `json:"handle"`
	PricingScheme Optional[PricingScheme] `json:"pricing_scheme"`
	// The name of the unit that the component’s usage is measured in. i.e. message
	UnitName *string `json:"unit_name,omitempty"`
	// The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null.
	UnitPrice Optional[string] `json:"unit_price"`
	// The id of the Product Family to which the Component belongs
	ProductFamilyId *int `json:"product_family_id,omitempty"`
	// The name of the Product Family to which the Component belongs
	ProductFamilyName *string `json:"product_family_name,omitempty"`
	// deprecated - use unit_price instead
	PricePerUnitInCents Optional[int64] `json:"price_per_unit_in_cents"`
	// A handle for the component type
	Kind *ComponentKind `json:"kind,omitempty"`
	// Boolean flag describing whether a component is archived or not.
	Archived *bool `json:"archived,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// The description of the component.
	Description         Optional[string] `json:"description"`
	DefaultPricePointId Optional[int]    `json:"default_price_point_id"`
	// An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty.
	OveragePrices Optional[[]ComponentPrice] `json:"overage_prices"`
	// An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty.
	Prices Optional[[]ComponentPrice] `json:"prices"`
	// Count for the number of price points associated with the component
	PricePointCount *int `json:"price_point_count,omitempty"`
	// URL that points to the location to read the existing price points via GET request
	PricePointsUrl        *string `json:"price_points_url,omitempty"`
	DefaultPricePointName *string `json:"default_price_point_name,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode   Optional[string] `json:"tax_code"`
	Recurring *bool            `json:"recurring,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
	// Timestamp indicating when this component was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Timestamp indicating when this component was updated
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Timestamp indicating when this component was archived
	ArchivedAt Optional[string] `json:"archived_at"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice    *bool `json:"hide_date_range_on_invoice,omitempty"`
	AllowFractionalQuantities *bool `json:"allow_fractional_quantities,omitempty"`
	// One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
	ItemCategory        Optional[ItemCategory] `json:"item_category"`
	UseSiteExchangeRate Optional[bool]         `json:"use_site_exchange_rate"`
	// E.g. Internal ID or SKU Number
	AccountingCode Optional[string] `json:"accounting_code"`
	// (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events.
	EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

Component represents a Component struct.

func (*Component) MarshalJSON

func (c *Component) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Component. It customizes the JSON marshaling process for Component objects.

func (*Component) UnmarshalJSON

func (c *Component) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Component. It customizes the JSON unmarshaling process for Component objects.

type ComponentAllocationErrorItem

type ComponentAllocationErrorItem struct {
	ComponentId *int    `json:"component_id,omitempty"`
	Message     *string `json:"message,omitempty"`
	Kind        *string `json:"kind,omitempty"`
	On          *string `json:"on,omitempty"`
}

ComponentAllocationErrorItem represents a ComponentAllocationErrorItem struct.

func (*ComponentAllocationErrorItem) MarshalJSON

func (c *ComponentAllocationErrorItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentAllocationErrorItem. It customizes the JSON marshaling process for ComponentAllocationErrorItem objects.

func (*ComponentAllocationErrorItem) UnmarshalJSON

func (c *ComponentAllocationErrorItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentAllocationErrorItem. It customizes the JSON unmarshaling process for ComponentAllocationErrorItem objects.

type ComponentCostData

type ComponentCostData struct {
	ComponentCodeId Optional[int] `json:"component_code_id"`
	PricePointId    *int          `json:"price_point_id,omitempty"`
	ProductId       *int          `json:"product_id,omitempty"`
	Quantity        *string       `json:"quantity,omitempty"`
	Amount          *string       `json:"amount,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme              `json:"pricing_scheme,omitempty"`
	Tiers         []ComponentCostDataRateTier `json:"tiers,omitempty"`
}

ComponentCostData represents a ComponentCostData struct.

func (*ComponentCostData) MarshalJSON

func (c *ComponentCostData) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentCostData. It customizes the JSON marshaling process for ComponentCostData objects.

func (*ComponentCostData) UnmarshalJSON

func (c *ComponentCostData) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentCostData. It customizes the JSON unmarshaling process for ComponentCostData objects.

type ComponentCostDataRateTier

type ComponentCostDataRateTier struct {
	StartingQuantity *int          `json:"starting_quantity,omitempty"`
	EndingQuantity   Optional[int] `json:"ending_quantity"`
	Quantity         *string       `json:"quantity,omitempty"`
	UnitPrice        *string       `json:"unit_price,omitempty"`
	Amount           *string       `json:"amount,omitempty"`
}

ComponentCostDataRateTier represents a ComponentCostDataRateTier struct.

func (*ComponentCostDataRateTier) MarshalJSON

func (c *ComponentCostDataRateTier) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentCostDataRateTier. It customizes the JSON marshaling process for ComponentCostDataRateTier objects.

func (*ComponentCostDataRateTier) UnmarshalJSON

func (c *ComponentCostDataRateTier) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentCostDataRateTier. It customizes the JSON unmarshaling process for ComponentCostDataRateTier objects.

type ComponentCurrencyPrice

type ComponentCurrencyPrice struct {
	Id             *int    `json:"id,omitempty"`
	Currency       *string `json:"currency,omitempty"`
	Price          *string `json:"price,omitempty"`
	FormattedPrice *string `json:"formatted_price,omitempty"`
	PriceId        *int    `json:"price_id,omitempty"`
	PricePointId   *int    `json:"price_point_id,omitempty"`
}

ComponentCurrencyPrice represents a ComponentCurrencyPrice struct.

func (*ComponentCurrencyPrice) MarshalJSON

func (c *ComponentCurrencyPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentCurrencyPrice. It customizes the JSON marshaling process for ComponentCurrencyPrice objects.

func (*ComponentCurrencyPrice) UnmarshalJSON

func (c *ComponentCurrencyPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentCurrencyPrice. It customizes the JSON unmarshaling process for ComponentCurrencyPrice objects.

type ComponentCurrencyPricesResponse added in v0.1.0

type ComponentCurrencyPricesResponse struct {
	CurrencyPrices []ComponentCurrencyPrice `json:"currency_prices"`
}

ComponentCurrencyPricesResponse represents a ComponentCurrencyPricesResponse struct.

func (*ComponentCurrencyPricesResponse) MarshalJSON added in v0.1.0

func (c *ComponentCurrencyPricesResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentCurrencyPricesResponse. It customizes the JSON marshaling process for ComponentCurrencyPricesResponse objects.

func (*ComponentCurrencyPricesResponse) UnmarshalJSON added in v0.1.0

func (c *ComponentCurrencyPricesResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentCurrencyPricesResponse. It customizes the JSON unmarshaling process for ComponentCurrencyPricesResponse objects.

type ComponentCustomPrice

type ComponentCustomPrice struct {
	// Omit for On/Off components
	PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
	// On/off components only need one price bracket starting at 1
	Prices []Price `json:"prices,omitempty"`
}

ComponentCustomPrice represents a ComponentCustomPrice struct. Create or update custom pricing unique to the subscription. Used in place of `price_point_id`.

func (*ComponentCustomPrice) MarshalJSON

func (c *ComponentCustomPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentCustomPrice. It customizes the JSON marshaling process for ComponentCustomPrice objects.

func (*ComponentCustomPrice) UnmarshalJSON

func (c *ComponentCustomPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentCustomPrice. It customizes the JSON unmarshaling process for ComponentCustomPrice objects.

type ComponentKind

type ComponentKind string

ComponentKind is a string enum. A handle for the component type

const (
	ComponentKind_METEREDCOMPONENT       ComponentKind = "metered_component"
	ComponentKind_QUANTITYBASEDCOMPONENT ComponentKind = "quantity_based_component"
	ComponentKind_ONOFFCOMPONENT         ComponentKind = "on_off_component"
	ComponentKind_PREPAIDUSAGECOMPONENT  ComponentKind = "prepaid_usage_component"
	ComponentKind_EVENTBASEDCOMPONENT    ComponentKind = "event_based_component"
)

type ComponentPrice

type ComponentPrice struct {
	Id                 *int          `json:"id,omitempty"`
	ComponentId        *int          `json:"component_id,omitempty"`
	StartingQuantity   *int          `json:"starting_quantity,omitempty"`
	EndingQuantity     Optional[int] `json:"ending_quantity"`
	UnitPrice          *string       `json:"unit_price,omitempty"`
	PricePointId       *int          `json:"price_point_id,omitempty"`
	FormattedUnitPrice *string       `json:"formatted_unit_price,omitempty"`
	SegmentId          Optional[int] `json:"segment_id"`
}

ComponentPrice represents a ComponentPrice struct.

func (*ComponentPrice) MarshalJSON

func (c *ComponentPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPrice. It customizes the JSON marshaling process for ComponentPrice objects.

func (*ComponentPrice) UnmarshalJSON

func (c *ComponentPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPrice. It customizes the JSON unmarshaling process for ComponentPrice objects.

type ComponentPricePoint

type ComponentPricePoint struct {
	Id *int `json:"id,omitempty"`
	// Price point type. We expose the following types:
	// 1. **default**: a price point that is marked as a default price for a certain product.
	// 2. **custom**: a custom price point.
	// 3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one.
	Type *PricePointType `json:"type,omitempty"`
	// Note: Refer to type attribute instead
	Default *bool   `json:"default,omitempty"` // Deprecated
	Name    *string `json:"name,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme      `json:"pricing_scheme,omitempty"`
	ComponentId   *int                `json:"component_id,omitempty"`
	Handle        *string             `json:"handle,omitempty"`
	ArchivedAt    Optional[time.Time] `json:"archived_at"`
	CreatedAt     *time.Time          `json:"created_at,omitempty"`
	UpdatedAt     *time.Time          `json:"updated_at,omitempty"`
	Prices        []ComponentPrice    `json:"prices,omitempty"`
	// Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation.
	UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"`
	// (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for.
	SubscriptionId *int  `json:"subscription_id,omitempty"`
	TaxIncluded    *bool `json:"tax_included,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval Optional[int] `json:"interval"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit Optional[IntervalUnit] `json:"interval_unit"`
	// An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter.
	CurrencyPrices []ComponentCurrencyPrice `json:"currency_prices,omitempty"`
}

ComponentPricePoint represents a ComponentPricePoint struct.

func (*ComponentPricePoint) MarshalJSON

func (c *ComponentPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPricePoint. It customizes the JSON marshaling process for ComponentPricePoint objects.

func (*ComponentPricePoint) UnmarshalJSON

func (c *ComponentPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPricePoint. It customizes the JSON unmarshaling process for ComponentPricePoint objects.

type ComponentPricePointErrorItem

type ComponentPricePointErrorItem struct {
	ComponentId *int    `json:"component_id,omitempty"`
	Message     *string `json:"message,omitempty"`
	PricePoint  *int    `json:"price_point,omitempty"`
}

ComponentPricePointErrorItem represents a ComponentPricePointErrorItem struct.

func (*ComponentPricePointErrorItem) MarshalJSON

func (c *ComponentPricePointErrorItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPricePointErrorItem. It customizes the JSON marshaling process for ComponentPricePointErrorItem objects.

func (*ComponentPricePointErrorItem) UnmarshalJSON

func (c *ComponentPricePointErrorItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPricePointErrorItem. It customizes the JSON unmarshaling process for ComponentPricePointErrorItem objects.

type ComponentPricePointItem added in v0.1.0

type ComponentPricePointItem struct {
	Name   *string `json:"name,omitempty"`
	Handle *string `json:"handle,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
	Prices       []Price       `json:"prices,omitempty"`
}

ComponentPricePointItem represents a ComponentPricePointItem struct.

func (*ComponentPricePointItem) MarshalJSON added in v0.1.0

func (c *ComponentPricePointItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPricePointItem. It customizes the JSON marshaling process for ComponentPricePointItem objects.

func (*ComponentPricePointItem) UnmarshalJSON added in v0.1.0

func (c *ComponentPricePointItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPricePointItem. It customizes the JSON unmarshaling process for ComponentPricePointItem objects.

type ComponentPricePointResponse

type ComponentPricePointResponse struct {
	PricePoint ComponentPricePoint `json:"price_point"`
}

ComponentPricePointResponse represents a ComponentPricePointResponse struct.

func (*ComponentPricePointResponse) MarshalJSON

func (c *ComponentPricePointResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPricePointResponse. It customizes the JSON marshaling process for ComponentPricePointResponse objects.

func (*ComponentPricePointResponse) UnmarshalJSON

func (c *ComponentPricePointResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPricePointResponse. It customizes the JSON unmarshaling process for ComponentPricePointResponse objects.

type ComponentPricePointsResponse

type ComponentPricePointsResponse struct {
	PricePoints []ComponentPricePoint `json:"price_points,omitempty"`
	Meta        *ListPublicKeysMeta   `json:"meta,omitempty"`
}

ComponentPricePointsResponse represents a ComponentPricePointsResponse struct.

func (*ComponentPricePointsResponse) MarshalJSON

func (c *ComponentPricePointsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentPricePointsResponse. It customizes the JSON marshaling process for ComponentPricePointsResponse objects.

func (*ComponentPricePointsResponse) UnmarshalJSON

func (c *ComponentPricePointsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentPricePointsResponse. It customizes the JSON unmarshaling process for ComponentPricePointsResponse objects.

type ComponentResponse

type ComponentResponse struct {
	Component Component `json:"component"`
}

ComponentResponse represents a ComponentResponse struct.

func (*ComponentResponse) MarshalJSON

func (c *ComponentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentResponse. It customizes the JSON marshaling process for ComponentResponse objects.

func (*ComponentResponse) UnmarshalJSON

func (c *ComponentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentResponse. It customizes the JSON unmarshaling process for ComponentResponse objects.

type ComponentSPricePointAssignment

type ComponentSPricePointAssignment struct {
	ComponentId *int         `json:"component_id,omitempty"`
	PricePoint  *interface{} `json:"price_point,omitempty"`
}

ComponentSPricePointAssignment represents a ComponentSPricePointAssignment struct.

func (*ComponentSPricePointAssignment) MarshalJSON

func (c *ComponentSPricePointAssignment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ComponentSPricePointAssignment. It customizes the JSON marshaling process for ComponentSPricePointAssignment objects.

func (*ComponentSPricePointAssignment) UnmarshalJSON

func (c *ComponentSPricePointAssignment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComponentSPricePointAssignment. It customizes the JSON unmarshaling process for ComponentSPricePointAssignment objects.

type CompoundingStrategy

type CompoundingStrategy string

CompoundingStrategy is a string enum.

const (
	CompoundingStrategy_COMPOUND  CompoundingStrategy = "compound"
	CompoundingStrategy_FULLPRICE CompoundingStrategy = "full-price"
)

type ConsolidatedInvoice

type ConsolidatedInvoice struct {
	Invoices []Invoice `json:"invoices,omitempty"`
}

ConsolidatedInvoice represents a ConsolidatedInvoice struct.

func (*ConsolidatedInvoice) MarshalJSON

func (c *ConsolidatedInvoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ConsolidatedInvoice. It customizes the JSON marshaling process for ConsolidatedInvoice objects.

func (*ConsolidatedInvoice) UnmarshalJSON

func (c *ConsolidatedInvoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ConsolidatedInvoice. It customizes the JSON unmarshaling process for ConsolidatedInvoice objects.

type CountResponse

type CountResponse struct {
	Count *int `json:"count,omitempty"`
}

CountResponse represents a CountResponse struct.

func (*CountResponse) MarshalJSON

func (c *CountResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CountResponse. It customizes the JSON marshaling process for CountResponse objects.

func (*CountResponse) UnmarshalJSON

func (c *CountResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CountResponse. It customizes the JSON unmarshaling process for CountResponse objects.

type Coupon

type Coupon struct {
	Id                          *int                `json:"id,omitempty"`
	Name                        *string             `json:"name,omitempty"`
	Code                        *string             `json:"code,omitempty"`
	Description                 *string             `json:"description,omitempty"`
	Amount                      Optional[float64]   `json:"amount"`
	AmountInCents               Optional[int]       `json:"amount_in_cents"`
	ProductFamilyId             *int                `json:"product_family_id,omitempty"`
	ProductFamilyName           Optional[string]    `json:"product_family_name"`
	StartDate                   *string             `json:"start_date,omitempty"`
	EndDate                     Optional[string]    `json:"end_date"`
	Percentage                  Optional[string]    `json:"percentage"`
	Recurring                   *bool               `json:"recurring,omitempty"`
	RecurringScheme             *RecurringScheme    `json:"recurring_scheme,omitempty"`
	DurationPeriodCount         Optional[int]       `json:"duration_period_count"`
	DurationInterval            Optional[int]       `json:"duration_interval"`
	DurationIntervalUnit        Optional[string]    `json:"duration_interval_unit"`
	DurationIntervalSpan        Optional[string]    `json:"duration_interval_span"`
	AllowNegativeBalance        *bool               `json:"allow_negative_balance,omitempty"`
	ArchivedAt                  Optional[string]    `json:"archived_at"`
	ConversionLimit             Optional[string]    `json:"conversion_limit"`
	Stackable                   *bool               `json:"stackable,omitempty"`
	CompoundingStrategy         *interface{}        `json:"compounding_strategy,omitempty"`
	UseSiteExchangeRate         *bool               `json:"use_site_exchange_rate,omitempty"`
	CreatedAt                   *string             `json:"created_at,omitempty"`
	UpdatedAt                   *string             `json:"updated_at,omitempty"`
	DiscountType                *DiscountType       `json:"discount_type,omitempty"`
	ExcludeMidPeriodAllocations *bool               `json:"exclude_mid_period_allocations,omitempty"`
	ApplyOnCancelAtEndOfPeriod  *bool               `json:"apply_on_cancel_at_end_of_period,omitempty"`
	CouponRestrictions          []CouponRestriction `json:"coupon_restrictions,omitempty"`
}

Coupon represents a Coupon struct.

func (*Coupon) MarshalJSON

func (c *Coupon) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Coupon. It customizes the JSON marshaling process for Coupon objects.

func (*Coupon) UnmarshalJSON

func (c *Coupon) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Coupon. It customizes the JSON unmarshaling process for Coupon objects.

type CouponCurrency

type CouponCurrency struct {
	Id       *int    `json:"id,omitempty"`
	Currency *string `json:"currency,omitempty"`
	Price    *int    `json:"price,omitempty"`
	CouponId *int    `json:"coupon_id,omitempty"`
}

CouponCurrency represents a CouponCurrency struct.

func (*CouponCurrency) MarshalJSON

func (c *CouponCurrency) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponCurrency. It customizes the JSON marshaling process for CouponCurrency objects.

func (*CouponCurrency) UnmarshalJSON

func (c *CouponCurrency) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponCurrency. It customizes the JSON unmarshaling process for CouponCurrency objects.

type CouponCurrencyRequest

type CouponCurrencyRequest struct {
	CurrencyPrices []UpdateCouponCurrency `json:"currency_prices"`
}

CouponCurrencyRequest represents a CouponCurrencyRequest struct.

func (*CouponCurrencyRequest) MarshalJSON

func (c *CouponCurrencyRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponCurrencyRequest. It customizes the JSON marshaling process for CouponCurrencyRequest objects.

func (*CouponCurrencyRequest) UnmarshalJSON

func (c *CouponCurrencyRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponCurrencyRequest. It customizes the JSON unmarshaling process for CouponCurrencyRequest objects.

type CouponCurrencyResponse

type CouponCurrencyResponse struct {
	CurrencyPrices []CouponCurrency `json:"currency_prices,omitempty"`
}

CouponCurrencyResponse represents a CouponCurrencyResponse struct.

func (*CouponCurrencyResponse) MarshalJSON

func (c *CouponCurrencyResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponCurrencyResponse. It customizes the JSON marshaling process for CouponCurrencyResponse objects.

func (*CouponCurrencyResponse) UnmarshalJSON

func (c *CouponCurrencyResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponCurrencyResponse. It customizes the JSON unmarshaling process for CouponCurrencyResponse objects.

type CouponResponse

type CouponResponse struct {
	Coupon *Coupon `json:"coupon,omitempty"`
}

CouponResponse represents a CouponResponse struct.

func (*CouponResponse) MarshalJSON

func (c *CouponResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponResponse. It customizes the JSON marshaling process for CouponResponse objects.

func (*CouponResponse) UnmarshalJSON

func (c *CouponResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponResponse. It customizes the JSON unmarshaling process for CouponResponse objects.

type CouponRestriction

type CouponRestriction struct {
	Id       *int             `json:"id,omitempty"`
	ItemType *RestrictionType `json:"item_type,omitempty"`
	ItemId   *int             `json:"item_id,omitempty"`
	Name     *string          `json:"name,omitempty"`
	Handle   Optional[string] `json:"handle"`
}

CouponRestriction represents a CouponRestriction struct.

func (*CouponRestriction) MarshalJSON

func (c *CouponRestriction) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponRestriction. It customizes the JSON marshaling process for CouponRestriction objects.

func (*CouponRestriction) UnmarshalJSON

func (c *CouponRestriction) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponRestriction. It customizes the JSON unmarshaling process for CouponRestriction objects.

type CouponSubcodes

type CouponSubcodes struct {
	Codes []string `json:"codes,omitempty"`
}

CouponSubcodes represents a CouponSubcodes struct.

func (*CouponSubcodes) MarshalJSON

func (c *CouponSubcodes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponSubcodes. It customizes the JSON marshaling process for CouponSubcodes objects.

func (*CouponSubcodes) UnmarshalJSON

func (c *CouponSubcodes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponSubcodes. It customizes the JSON unmarshaling process for CouponSubcodes objects.

type CouponSubcodesResponse

type CouponSubcodesResponse struct {
	CreatedCodes   []string `json:"created_codes,omitempty"`
	DuplicateCodes []string `json:"duplicate_codes,omitempty"`
	InvalidCodes   []string `json:"invalid_codes,omitempty"`
}

CouponSubcodesResponse represents a CouponSubcodesResponse struct.

func (*CouponSubcodesResponse) MarshalJSON

func (c *CouponSubcodesResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponSubcodesResponse. It customizes the JSON marshaling process for CouponSubcodesResponse objects.

func (*CouponSubcodesResponse) UnmarshalJSON

func (c *CouponSubcodesResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponSubcodesResponse. It customizes the JSON unmarshaling process for CouponSubcodesResponse objects.

type CouponUsage

type CouponUsage struct {
	// The Chargify id of the product
	Id *int `json:"id,omitempty"`
	// Name of the product
	Name *string `json:"name,omitempty"`
	// Number of times the coupon has been applied
	Signups *int `json:"signups,omitempty"`
	// Dollar amount of customer savings as a result of the coupon.
	Savings Optional[int] `json:"savings"`
	// Dollar amount of customer savings as a result of the coupon.
	SavingsInCents Optional[int64] `json:"savings_in_cents"`
	// Total revenue of the all subscriptions that have received a discount from this coupon.
	Revenue Optional[int] `json:"revenue"`
	// Total revenue of the all subscriptions that have received a discount from this coupon.
	RevenueInCents *int64 `json:"revenue_in_cents,omitempty"`
}

CouponUsage represents a CouponUsage struct.

func (*CouponUsage) MarshalJSON

func (c *CouponUsage) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CouponUsage. It customizes the JSON marshaling process for CouponUsage objects.

func (*CouponUsage) UnmarshalJSON

func (c *CouponUsage) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CouponUsage. It customizes the JSON unmarshaling process for CouponUsage objects.

type CreateAllocation

type CreateAllocation struct {
	// The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off.
	Quantity float64 `json:"quantity"`
	// (required for the multiple allocations endpoint) The id associated with the component for which the allocation is being made
	ComponentId *int `json:"component_id,omitempty"`
	// A memo to record along with the allocation
	Memo *string `json:"memo,omitempty"`
	// The scheme used if the proration is a downgrade. Defaults to the site setting if one is not provided.
	ProrationDowngradeScheme *string `json:"proration_downgrade_scheme,omitempty"` // Deprecated
	// The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided.
	ProrationUpgradeScheme *string `json:"proration_upgrade_scheme,omitempty"` // Deprecated
	// If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. Defaults to the site setting if one is not provided.
	AccrueCharge *bool `json:"accrue_charge,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// If set to true, if the immediate component payment fails, initiate dunning for the subscription.
	// Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false.
	InitiateDunning *bool `json:"initiate_dunning,omitempty"`
	// Price point that the allocation should be charged at. Accepts either the price point's id (integer) or handle (string). When not specified, the default price point will be used.
	PricePointId Optional[interface{}] `json:"price_point_id"`
	// This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled
	BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"`
}

CreateAllocation represents a CreateAllocation struct.

func (*CreateAllocation) MarshalJSON

func (c *CreateAllocation) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateAllocation. It customizes the JSON marshaling process for CreateAllocation objects.

func (*CreateAllocation) UnmarshalJSON

func (c *CreateAllocation) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateAllocation. It customizes the JSON unmarshaling process for CreateAllocation objects.

type CreateAllocationRequest

type CreateAllocationRequest struct {
	Allocation CreateAllocation `json:"allocation"`
}

CreateAllocationRequest represents a CreateAllocationRequest struct.

func (*CreateAllocationRequest) MarshalJSON

func (c *CreateAllocationRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateAllocationRequest. It customizes the JSON marshaling process for CreateAllocationRequest objects.

func (*CreateAllocationRequest) UnmarshalJSON

func (c *CreateAllocationRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateAllocationRequest. It customizes the JSON unmarshaling process for CreateAllocationRequest objects.

type CreateComponentPricePointRequest

type CreateComponentPricePointRequest struct {
	PricePoint PricePoint `json:"price_point"`
}

CreateComponentPricePointRequest represents a CreateComponentPricePointRequest struct.

func (*CreateComponentPricePointRequest) MarshalJSON

func (c *CreateComponentPricePointRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateComponentPricePointRequest. It customizes the JSON marshaling process for CreateComponentPricePointRequest objects.

func (*CreateComponentPricePointRequest) UnmarshalJSON

func (c *CreateComponentPricePointRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateComponentPricePointRequest. It customizes the JSON unmarshaling process for CreateComponentPricePointRequest objects.

type CreateComponentPricePointsRequest

type CreateComponentPricePointsRequest struct {
	PricePoints []PricePoint `json:"price_points"`
}

CreateComponentPricePointsRequest represents a CreateComponentPricePointsRequest struct.

func (*CreateComponentPricePointsRequest) MarshalJSON

func (c *CreateComponentPricePointsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateComponentPricePointsRequest. It customizes the JSON marshaling process for CreateComponentPricePointsRequest objects.

func (*CreateComponentPricePointsRequest) UnmarshalJSON

func (c *CreateComponentPricePointsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateComponentPricePointsRequest. It customizes the JSON unmarshaling process for CreateComponentPricePointsRequest objects.

type CreateCurrencyPrice

type CreateCurrencyPrice struct {
	// ISO code for a currency defined on the site level
	Currency *string `json:"currency,omitempty"`
	// Price for the price level in this currency
	Price *float64 `json:"price,omitempty"`
	// ID of the price that this corresponds with
	PriceId *int `json:"price_id,omitempty"`
}

CreateCurrencyPrice represents a CreateCurrencyPrice struct.

func (*CreateCurrencyPrice) MarshalJSON

func (c *CreateCurrencyPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateCurrencyPrice. It customizes the JSON marshaling process for CreateCurrencyPrice objects.

func (*CreateCurrencyPrice) UnmarshalJSON

func (c *CreateCurrencyPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateCurrencyPrice. It customizes the JSON unmarshaling process for CreateCurrencyPrice objects.

type CreateCurrencyPricesRequest

type CreateCurrencyPricesRequest struct {
	CurrencyPrices []CreateCurrencyPrice `json:"currency_prices"`
}

CreateCurrencyPricesRequest represents a CreateCurrencyPricesRequest struct.

func (*CreateCurrencyPricesRequest) MarshalJSON

func (c *CreateCurrencyPricesRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateCurrencyPricesRequest. It customizes the JSON marshaling process for CreateCurrencyPricesRequest objects.

func (*CreateCurrencyPricesRequest) UnmarshalJSON

func (c *CreateCurrencyPricesRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateCurrencyPricesRequest. It customizes the JSON unmarshaling process for CreateCurrencyPricesRequest objects.

type CreateCustomer

type CreateCustomer struct {
	FirstName    string  `json:"first_name"`
	LastName     string  `json:"last_name"`
	Email        string  `json:"email"`
	CcEmails     *string `json:"cc_emails,omitempty"`
	Organization *string `json:"organization,omitempty"`
	Reference    *string `json:"reference,omitempty"`
	Address      *string `json:"address,omitempty"`
	Address2     *string `json:"address_2,omitempty"`
	City         *string `json:"city,omitempty"`
	State        *string `json:"state,omitempty"`
	Zip          *string `json:"zip,omitempty"`
	Country      *string `json:"country,omitempty"`
	Phone        *string `json:"phone,omitempty"`
	// Set a specific language on a customer record.
	Locale          *string `json:"locale,omitempty"`
	VatNumber       *string `json:"vat_number,omitempty"`
	TaxExempt       *bool   `json:"tax_exempt,omitempty"`
	TaxExemptReason *string `json:"tax_exempt_reason,omitempty"`
	// The parent ID in Chargify if applicable. Parent is another Customer object.
	ParentId Optional[int] `json:"parent_id"`
}

CreateCustomer represents a CreateCustomer struct.

func (*CreateCustomer) MarshalJSON

func (c *CreateCustomer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateCustomer. It customizes the JSON marshaling process for CreateCustomer objects.

func (*CreateCustomer) UnmarshalJSON

func (c *CreateCustomer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateCustomer. It customizes the JSON unmarshaling process for CreateCustomer objects.

type CreateCustomerRequest

type CreateCustomerRequest struct {
	Customer CreateCustomer `json:"customer"`
}

CreateCustomerRequest represents a CreateCustomerRequest struct.

func (*CreateCustomerRequest) MarshalJSON

func (c *CreateCustomerRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateCustomerRequest. It customizes the JSON marshaling process for CreateCustomerRequest objects.

func (*CreateCustomerRequest) UnmarshalJSON

func (c *CreateCustomerRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateCustomerRequest. It customizes the JSON unmarshaling process for CreateCustomerRequest objects.

type CreateEBBComponent added in v0.1.0

type CreateEBBComponent struct {
	EventBasedComponent EBBComponent `json:"event_based_component"`
}

CreateEBBComponent represents a CreateEBBComponent struct.

func (*CreateEBBComponent) MarshalJSON added in v0.1.0

func (c *CreateEBBComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateEBBComponent. It customizes the JSON marshaling process for CreateEBBComponent objects.

func (*CreateEBBComponent) UnmarshalJSON added in v0.1.0

func (c *CreateEBBComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateEBBComponent. It customizes the JSON unmarshaling process for CreateEBBComponent objects.

type CreateInvoice

type CreateInvoice struct {
	LineItems []CreateInvoiceItem `json:"line_items,omitempty"`
	IssueDate *time.Time          `json:"issue_date,omitempty"`
	// 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.
	NetTerms            *int    `json:"net_terms,omitempty"`
	PaymentInstructions *string `json:"payment_instructions,omitempty"`
	// A custom memo can be sent to override the site's default.
	Memo *string `json:"memo,omitempty"`
	// Overrides the defaults for the site
	SellerAddress *CreateInvoiceAddress `json:"seller_address,omitempty"`
	// Overrides the default for the customer
	BillingAddress *CreateInvoiceAddress `json:"billing_address,omitempty"`
	// Overrides the default for the customer
	ShippingAddress *CreateInvoiceAddress `json:"shipping_address,omitempty"`
	Coupons         []CreateInvoiceCoupon `json:"coupons,omitempty"`
	Status          *CreateInvoiceStatus  `json:"status,omitempty"`
}

CreateInvoice represents a CreateInvoice struct.

func (*CreateInvoice) MarshalJSON

func (c *CreateInvoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoice. It customizes the JSON marshaling process for CreateInvoice objects.

func (*CreateInvoice) UnmarshalJSON

func (c *CreateInvoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoice. It customizes the JSON unmarshaling process for CreateInvoice objects.

type CreateInvoiceAddress

type CreateInvoiceAddress struct {
	FirstName *string `json:"first_name,omitempty"`
	LastName  *string `json:"last_name,omitempty"`
	Phone     *string `json:"phone,omitempty"`
	Address   *string `json:"address,omitempty"`
	Address2  *string `json:"address_2,omitempty"`
	City      *string `json:"city,omitempty"`
	State     *string `json:"state,omitempty"`
	Zip       *string `json:"zip,omitempty"`
	Country   *string `json:"country,omitempty"`
}

CreateInvoiceAddress represents a CreateInvoiceAddress struct. Overrides the default address.

func (*CreateInvoiceAddress) MarshalJSON

func (c *CreateInvoiceAddress) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoiceAddress. It customizes the JSON marshaling process for CreateInvoiceAddress objects.

func (*CreateInvoiceAddress) UnmarshalJSON

func (c *CreateInvoiceAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceAddress. It customizes the JSON unmarshaling process for CreateInvoiceAddress objects.

type CreateInvoiceCoupon

type CreateInvoiceCoupon struct {
	Code                *string              `json:"code,omitempty"`
	Percentage          *interface{}         `json:"percentage,omitempty"`
	Amount              *interface{}         `json:"amount,omitempty"`
	Description         *string              `json:"description,omitempty"`
	ProductFamilyId     *interface{}         `json:"product_family_id,omitempty"`
	CompoundingStrategy *CompoundingStrategy `json:"compounding_strategy,omitempty"`
}

CreateInvoiceCoupon represents a CreateInvoiceCoupon struct.

func (*CreateInvoiceCoupon) MarshalJSON

func (c *CreateInvoiceCoupon) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoiceCoupon. It customizes the JSON marshaling process for CreateInvoiceCoupon objects.

func (*CreateInvoiceCoupon) UnmarshalJSON

func (c *CreateInvoiceCoupon) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceCoupon. It customizes the JSON unmarshaling process for CreateInvoiceCoupon objects.

type CreateInvoiceItem

type CreateInvoiceItem struct {
	Title *string `json:"title,omitempty"`
	// The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place.
	Quantity *interface{} `json:"quantity,omitempty"`
	// The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place.
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes.
	// If using Avalara, a tax_code parameter must also be sent.
	Taxable *bool   `json:"taxable,omitempty"`
	TaxCode *string `json:"tax_code,omitempty"`
	// YYYY-MM-DD
	PeriodRangeStart *string `json:"period_range_start,omitempty"`
	// YYYY-MM-DD
	PeriodRangeEnd *string `json:"period_range_end,omitempty"`
	// Product handle or product id.
	ProductId *interface{} `json:"product_id,omitempty"`
	// Component handle or component id.
	ComponentId *interface{} `json:"component_id,omitempty"`
	// Price point handle or id. For component.
	PricePointId        *interface{} `json:"price_point_id,omitempty"`
	ProductPricePointId *interface{} `json:"product_price_point_id,omitempty"`
	Description         *string      `json:"description,omitempty"`
}

CreateInvoiceItem represents a CreateInvoiceItem struct.

func (*CreateInvoiceItem) MarshalJSON

func (c *CreateInvoiceItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoiceItem. It customizes the JSON marshaling process for CreateInvoiceItem objects.

func (*CreateInvoiceItem) UnmarshalJSON

func (c *CreateInvoiceItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceItem. It customizes the JSON unmarshaling process for CreateInvoiceItem objects.

type CreateInvoicePayment

type CreateInvoicePayment struct {
	// A string of the dollar amount to be refunded (eg. "10.50" => $10.50)
	Amount *interface{} `json:"amount,omitempty"`
	// A description to be attached to the payment.
	Memo *string `json:"memo,omitempty"`
	// The type of payment method used. Defaults to other.
	Method *InvoicePaymentMethodType `json:"method,omitempty"`
	// Additional information related to the payment method (eg. Check #)
	Details *string `json:"details,omitempty"`
}

CreateInvoicePayment represents a CreateInvoicePayment struct.

func (*CreateInvoicePayment) MarshalJSON

func (c *CreateInvoicePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoicePayment. It customizes the JSON marshaling process for CreateInvoicePayment objects.

func (*CreateInvoicePayment) UnmarshalJSON

func (c *CreateInvoicePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePayment. It customizes the JSON unmarshaling process for CreateInvoicePayment objects.

type CreateInvoicePaymentApplication

type CreateInvoicePaymentApplication struct {
	// Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters.
	InvoiceUid string `json:"invoice_uid"`
	// Dollar amount of the invoice payment (eg. "10.50" => $10.50).
	Amount string `json:"amount"`
}

CreateInvoicePaymentApplication represents a CreateInvoicePaymentApplication struct.

func (*CreateInvoicePaymentApplication) MarshalJSON

func (c *CreateInvoicePaymentApplication) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentApplication. It customizes the JSON marshaling process for CreateInvoicePaymentApplication objects.

func (*CreateInvoicePaymentApplication) UnmarshalJSON

func (c *CreateInvoicePaymentApplication) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentApplication. It customizes the JSON unmarshaling process for CreateInvoicePaymentApplication objects.

type CreateInvoicePaymentRequest

type CreateInvoicePaymentRequest struct {
	Payment CreateInvoicePayment `json:"payment"`
	// The type of payment to be applied to an Invoice. Defaults to external.
	Type *InvoicePaymentType `json:"type,omitempty"`
}

CreateInvoicePaymentRequest represents a CreateInvoicePaymentRequest struct.

func (*CreateInvoicePaymentRequest) MarshalJSON

func (c *CreateInvoicePaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoicePaymentRequest. It customizes the JSON marshaling process for CreateInvoicePaymentRequest objects.

func (*CreateInvoicePaymentRequest) UnmarshalJSON

func (c *CreateInvoicePaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoicePaymentRequest. It customizes the JSON unmarshaling process for CreateInvoicePaymentRequest objects.

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	Invoice CreateInvoice `json:"invoice"`
}

CreateInvoiceRequest represents a CreateInvoiceRequest struct.

func (*CreateInvoiceRequest) MarshalJSON

func (c *CreateInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateInvoiceRequest. It customizes the JSON marshaling process for CreateInvoiceRequest objects.

func (*CreateInvoiceRequest) UnmarshalJSON

func (c *CreateInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateInvoiceRequest. It customizes the JSON unmarshaling process for CreateInvoiceRequest objects.

type CreateInvoiceStatus

type CreateInvoiceStatus string

CreateInvoiceStatus is a string enum.

const (
	CreateInvoiceStatus_DRAFT CreateInvoiceStatus = "draft"
	CreateInvoiceStatus_OPEN  CreateInvoiceStatus = "open"
)

type CreateMetadata

type CreateMetadata struct {
	Name  *string `json:"name,omitempty"`
	Value *string `json:"value,omitempty"`
}

CreateMetadata represents a CreateMetadata struct.

func (*CreateMetadata) MarshalJSON

func (c *CreateMetadata) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMetadata. It customizes the JSON marshaling process for CreateMetadata objects.

func (*CreateMetadata) UnmarshalJSON

func (c *CreateMetadata) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadata. It customizes the JSON unmarshaling process for CreateMetadata objects.

type CreateMetadataRequest

type CreateMetadataRequest struct {
	Metadata []CreateMetadata `json:"metadata"`
}

CreateMetadataRequest represents a CreateMetadataRequest struct.

func (*CreateMetadataRequest) MarshalJSON

func (c *CreateMetadataRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMetadataRequest. It customizes the JSON marshaling process for CreateMetadataRequest objects.

func (*CreateMetadataRequest) UnmarshalJSON

func (c *CreateMetadataRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMetadataRequest. It customizes the JSON unmarshaling process for CreateMetadataRequest objects.

type CreateMetafieldsRequest

type CreateMetafieldsRequest struct {
	Metafields interface{} `json:"metafields"`
}

CreateMetafieldsRequest represents a CreateMetafieldsRequest struct.

func (*CreateMetafieldsRequest) MarshalJSON

func (c *CreateMetafieldsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMetafieldsRequest. It customizes the JSON marshaling process for CreateMetafieldsRequest objects.

func (*CreateMetafieldsRequest) UnmarshalJSON

func (c *CreateMetafieldsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMetafieldsRequest. It customizes the JSON unmarshaling process for CreateMetafieldsRequest objects.

type CreateMeteredComponent added in v0.1.0

type CreateMeteredComponent struct {
	MeteredComponent MeteredComponent `json:"metered_component"`
}

CreateMeteredComponent represents a CreateMeteredComponent struct.

func (*CreateMeteredComponent) MarshalJSON added in v0.1.0

func (c *CreateMeteredComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMeteredComponent. It customizes the JSON marshaling process for CreateMeteredComponent objects.

func (*CreateMeteredComponent) UnmarshalJSON added in v0.1.0

func (c *CreateMeteredComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMeteredComponent. It customizes the JSON unmarshaling process for CreateMeteredComponent objects.

type CreateMultiInvoicePayment

type CreateMultiInvoicePayment struct {
	// A description to be attached to the payment.
	Memo *string `json:"memo,omitempty"`
	// Additional information related to the payment method (eg. Check #).
	Details *string `json:"details,omitempty"`
	// The type of payment method used. Defaults to other.
	Method *InvoicePaymentMethodType `json:"method,omitempty"`
	// Dollar amount of the sum of the invoices payment (eg. "10.50" => $10.50).
	Amount interface{} `json:"amount"`
	// Date reflecting when the payment was received from a customer. Must be in the past.
	ReceivedOn   *string                           `json:"received_on,omitempty"`
	Applications []CreateInvoicePaymentApplication `json:"applications"`
}

CreateMultiInvoicePayment represents a CreateMultiInvoicePayment struct.

func (*CreateMultiInvoicePayment) MarshalJSON

func (c *CreateMultiInvoicePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePayment. It customizes the JSON marshaling process for CreateMultiInvoicePayment objects.

func (*CreateMultiInvoicePayment) UnmarshalJSON

func (c *CreateMultiInvoicePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePayment. It customizes the JSON unmarshaling process for CreateMultiInvoicePayment objects.

type CreateMultiInvoicePaymentRequest

type CreateMultiInvoicePaymentRequest struct {
	Payment CreateMultiInvoicePayment `json:"payment"`
}

CreateMultiInvoicePaymentRequest represents a CreateMultiInvoicePaymentRequest struct.

func (*CreateMultiInvoicePaymentRequest) MarshalJSON

func (c *CreateMultiInvoicePaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateMultiInvoicePaymentRequest. It customizes the JSON marshaling process for CreateMultiInvoicePaymentRequest objects.

func (*CreateMultiInvoicePaymentRequest) UnmarshalJSON

func (c *CreateMultiInvoicePaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateMultiInvoicePaymentRequest. It customizes the JSON unmarshaling process for CreateMultiInvoicePaymentRequest objects.

type CreateOffer

type CreateOffer struct {
	Name                string                 `json:"name"`
	Handle              string                 `json:"handle"`
	Description         *string                `json:"description,omitempty"`
	ProductId           int                    `json:"product_id"`
	ProductPricePointId *int                   `json:"product_price_point_id,omitempty"`
	Components          []CreateOfferComponent `json:"components,omitempty"`
	Coupons             []string               `json:"coupons,omitempty"`
}

CreateOffer represents a CreateOffer struct.

func (*CreateOffer) MarshalJSON

func (c *CreateOffer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOffer. It customizes the JSON marshaling process for CreateOffer objects.

func (*CreateOffer) UnmarshalJSON

func (c *CreateOffer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOffer. It customizes the JSON unmarshaling process for CreateOffer objects.

type CreateOfferComponent

type CreateOfferComponent struct {
	ComponentId      *int `json:"component_id,omitempty"`
	StartingQuantity *int `json:"starting_quantity,omitempty"`
}

CreateOfferComponent represents a CreateOfferComponent struct.

func (*CreateOfferComponent) MarshalJSON

func (c *CreateOfferComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOfferComponent. It customizes the JSON marshaling process for CreateOfferComponent objects.

func (*CreateOfferComponent) UnmarshalJSON

func (c *CreateOfferComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferComponent. It customizes the JSON unmarshaling process for CreateOfferComponent objects.

type CreateOfferRequest

type CreateOfferRequest struct {
	Offer CreateOffer `json:"offer"`
}

CreateOfferRequest represents a CreateOfferRequest struct.

func (*CreateOfferRequest) MarshalJSON

func (c *CreateOfferRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOfferRequest. It customizes the JSON marshaling process for CreateOfferRequest objects.

func (*CreateOfferRequest) UnmarshalJSON

func (c *CreateOfferRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOfferRequest. It customizes the JSON unmarshaling process for CreateOfferRequest objects.

type CreateOnOffComponent added in v0.1.0

type CreateOnOffComponent struct {
	OnOffComponent OnOffComponent `json:"on_off_component"`
}

CreateOnOffComponent represents a CreateOnOffComponent struct.

func (*CreateOnOffComponent) MarshalJSON added in v0.1.0

func (c *CreateOnOffComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOnOffComponent. It customizes the JSON marshaling process for CreateOnOffComponent objects.

func (*CreateOnOffComponent) UnmarshalJSON added in v0.1.0

func (c *CreateOnOffComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOnOffComponent. It customizes the JSON unmarshaling process for CreateOnOffComponent objects.

type CreateOrUpdateCoupon

type CreateOrUpdateCoupon struct {
	Coupon *interface{} `json:"coupon,omitempty"`
	// An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product
	RestrictedProducts map[string]bool `json:"restricted_products,omitempty"`
	// An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component
	RestrictedComponents map[string]bool `json:"restricted_components,omitempty"`
}

CreateOrUpdateCoupon represents a CreateOrUpdateCoupon struct.

func (*CreateOrUpdateCoupon) MarshalJSON

func (c *CreateOrUpdateCoupon) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOrUpdateCoupon. It customizes the JSON marshaling process for CreateOrUpdateCoupon objects.

func (*CreateOrUpdateCoupon) UnmarshalJSON

func (c *CreateOrUpdateCoupon) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateCoupon. It customizes the JSON unmarshaling process for CreateOrUpdateCoupon objects.

type CreateOrUpdateProduct

type CreateOrUpdateProduct struct {
	// The product name
	Name string `json:"name"`
	// The product API handle
	Handle *string `json:"handle,omitempty"`
	// The product description
	Description string `json:"description"`
	// E.g. Internal ID or SKU Number
	AccountingCode *string `json:"accounting_code,omitempty"`
	// Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page.
	RequireCreditCard *bool `json:"require_credit_card,omitempty"`
	// The product price, in integer cents
	PriceInCents int64 `json:"price_in_cents"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days
	Interval int `json:"interval"`
	// A string representing the interval unit for this product, either month or day
	IntervalUnit         IntervalUnit `json:"interval_unit"`
	AutoCreateSignupPage *bool        `json:"auto_create_signup_page,omitempty"`
	// A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
}

CreateOrUpdateProduct represents a CreateOrUpdateProduct struct.

func (*CreateOrUpdateProduct) MarshalJSON

func (c *CreateOrUpdateProduct) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProduct. It customizes the JSON marshaling process for CreateOrUpdateProduct objects.

func (*CreateOrUpdateProduct) UnmarshalJSON

func (c *CreateOrUpdateProduct) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProduct. It customizes the JSON unmarshaling process for CreateOrUpdateProduct objects.

type CreateOrUpdateProductRequest

type CreateOrUpdateProductRequest struct {
	Product CreateOrUpdateProduct `json:"product"`
}

CreateOrUpdateProductRequest represents a CreateOrUpdateProductRequest struct.

func (*CreateOrUpdateProductRequest) MarshalJSON

func (c *CreateOrUpdateProductRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOrUpdateProductRequest. It customizes the JSON marshaling process for CreateOrUpdateProductRequest objects.

func (*CreateOrUpdateProductRequest) UnmarshalJSON

func (c *CreateOrUpdateProductRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateProductRequest. It customizes the JSON unmarshaling process for CreateOrUpdateProductRequest objects.

type CreateOrUpdateSegmentPrice

type CreateOrUpdateSegmentPrice struct {
	StartingQuantity *int `json:"starting_quantity,omitempty"`
	EndingQuantity   *int `json:"ending_quantity,omitempty"`
	// The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice interface{} `json:"unit_price"`
}

CreateOrUpdateSegmentPrice represents a CreateOrUpdateSegmentPrice struct.

func (*CreateOrUpdateSegmentPrice) MarshalJSON

func (c *CreateOrUpdateSegmentPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateOrUpdateSegmentPrice. It customizes the JSON marshaling process for CreateOrUpdateSegmentPrice objects.

func (*CreateOrUpdateSegmentPrice) UnmarshalJSON

func (c *CreateOrUpdateSegmentPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateOrUpdateSegmentPrice. It customizes the JSON unmarshaling process for CreateOrUpdateSegmentPrice objects.

type CreatePayment

type CreatePayment struct {
	Amount         string `json:"amount"`
	Memo           string `json:"memo"`
	PaymentDetails string `json:"payment_details"`
	PaymentMethod  string `json:"payment_method"`
}

CreatePayment represents a CreatePayment struct.

func (*CreatePayment) MarshalJSON

func (c *CreatePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePayment. It customizes the JSON marshaling process for CreatePayment objects.

func (*CreatePayment) UnmarshalJSON

func (c *CreatePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePayment. It customizes the JSON unmarshaling process for CreatePayment objects.

type CreatePaymentProfile

type CreatePaymentProfile struct {
	// Token received after sending billing informations using chargify.js.
	ChargifyToken *string      `json:"chargify_token,omitempty"`
	Id            *int         `json:"id,omitempty"`
	PaymentType   *PaymentType `json:"payment_type,omitempty"`
	// First name on card or bank account. If omitted, the first_name from customer attributes will be used.
	FirstName *string `json:"first_name,omitempty"`
	// Last name on card or bank account. If omitted, the last_name from customer attributes will be used.
	LastName         *string `json:"last_name,omitempty"`
	MaskedCardNumber *string `json:"masked_card_number,omitempty"`
	// The full credit card number
	FullNumber *string `json:"full_number,omitempty"`
	// The type of card used.
	CardType *CardType `json:"card_type,omitempty"`
	// (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5
	ExpirationMonth *interface{} `json:"expiration_month,omitempty"`
	// (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012
	ExpirationYear *interface{} `json:"expiration_year,omitempty"`
	// The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway.
	BillingAddress *string `json:"billing_address,omitempty"`
	// Second line of the customer’s billing address i.e. Apt. 100
	BillingAddress2 Optional[string] `json:"billing_address_2"`
	// The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway.
	BillingCity *string `json:"billing_city,omitempty"`
	// The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.
	BillingState *string `json:"billing_state,omitempty"`
	// The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.
	BillingCountry *string `json:"billing_country,omitempty"`
	// The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway.
	BillingZip *string `json:"billing_zip,omitempty"`
	// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
	CurrentVault *CurrentVault `json:"current_vault,omitempty"`
	// The “token” provided by your vault storage for an already stored payment profile
	VaultToken *string `json:"vault_token,omitempty"`
	// (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token
	CustomerVaultToken *string `json:"customer_vault_token,omitempty"`
	// (Required when creating a new payment profile) The Chargify customer id.
	CustomerId *int `json:"customer_id,omitempty"`
	// used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead.
	PaypalEmail *string `json:"paypal_email,omitempty"` // Deprecated
	// used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead.
	PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"` // Deprecated
	// This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed.
	GatewayHandle *string `json:"gateway_handle,omitempty"`
	// The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway.
	Cvv *string `json:"cvv,omitempty"`
	// (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides
	BankName *string `json:"bank_name,omitempty"`
	// (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided
	BankIban *string `json:"bank_iban,omitempty"`
	// (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API
	BankRoutingNumber *string `json:"bank_routing_number,omitempty"`
	// (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is blank) The customerʼs bank account number
	BankAccountNumber *string `json:"bank_account_number,omitempty"`
	// (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. Alternatively, an IBAN can be provided
	BankBranchCode *string `json:"bank_branch_code,omitempty"`
	// Defaults to checking
	BankAccountType *BankAccountType `json:"bank_account_type,omitempty"`
	// Defaults to personal
	BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"`
	// (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI
	LastFour *string `json:"last_four,omitempty"`
}

CreatePaymentProfile represents a CreatePaymentProfile struct.

func (*CreatePaymentProfile) MarshalJSON

func (c *CreatePaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePaymentProfile. It customizes the JSON marshaling process for CreatePaymentProfile objects.

func (*CreatePaymentProfile) UnmarshalJSON

func (c *CreatePaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfile. It customizes the JSON unmarshaling process for CreatePaymentProfile objects.

type CreatePaymentProfileRequest

type CreatePaymentProfileRequest struct {
	PaymentProfile CreatePaymentProfile `json:"payment_profile"`
}

CreatePaymentProfileRequest represents a CreatePaymentProfileRequest struct.

func (*CreatePaymentProfileRequest) MarshalJSON

func (c *CreatePaymentProfileRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePaymentProfileRequest. It customizes the JSON marshaling process for CreatePaymentProfileRequest objects.

func (*CreatePaymentProfileRequest) UnmarshalJSON

func (c *CreatePaymentProfileRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePaymentProfileRequest. It customizes the JSON unmarshaling process for CreatePaymentProfileRequest objects.

type CreatePrepaidComponent added in v0.1.0

type CreatePrepaidComponent struct {
	PrepaidUsageComponent PrepaidUsageComponent `json:"prepaid_usage_component"`
}

CreatePrepaidComponent represents a CreatePrepaidComponent struct.

func (*CreatePrepaidComponent) MarshalJSON added in v0.1.0

func (c *CreatePrepaidComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePrepaidComponent. It customizes the JSON marshaling process for CreatePrepaidComponent objects.

func (*CreatePrepaidComponent) UnmarshalJSON added in v0.1.0

func (c *CreatePrepaidComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaidComponent. It customizes the JSON unmarshaling process for CreatePrepaidComponent objects.

type CreatePrepayment

type CreatePrepayment struct {
	Amount  float64 `json:"amount"`
	Details string  `json:"details"`
	Memo    string  `json:"memo"`
	// :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions.
	Method           PrepaymentMethod `json:"method"`
	PaymentProfileId *int             `json:"payment_profile_id,omitempty"`
}

CreatePrepayment represents a CreatePrepayment struct.

func (*CreatePrepayment) MarshalJSON

func (c *CreatePrepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePrepayment. It customizes the JSON marshaling process for CreatePrepayment objects.

func (*CreatePrepayment) UnmarshalJSON

func (c *CreatePrepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepayment. It customizes the JSON unmarshaling process for CreatePrepayment objects.

type CreatePrepaymentRequest

type CreatePrepaymentRequest struct {
	Prepayment CreatePrepayment `json:"prepayment"`
}

CreatePrepaymentRequest represents a CreatePrepaymentRequest struct.

func (*CreatePrepaymentRequest) MarshalJSON

func (c *CreatePrepaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePrepaymentRequest. It customizes the JSON marshaling process for CreatePrepaymentRequest objects.

func (*CreatePrepaymentRequest) UnmarshalJSON

func (c *CreatePrepaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentRequest. It customizes the JSON unmarshaling process for CreatePrepaymentRequest objects.

type CreatePrepaymentResponse

type CreatePrepaymentResponse struct {
	Prepayment CreatedPrepayment `json:"prepayment"`
}

CreatePrepaymentResponse represents a CreatePrepaymentResponse struct.

func (*CreatePrepaymentResponse) MarshalJSON

func (c *CreatePrepaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatePrepaymentResponse. It customizes the JSON marshaling process for CreatePrepaymentResponse objects.

func (*CreatePrepaymentResponse) UnmarshalJSON

func (c *CreatePrepaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatePrepaymentResponse. It customizes the JSON unmarshaling process for CreatePrepaymentResponse objects.

type CreateProductCurrencyPrice

type CreateProductCurrencyPrice struct {
	// ISO code for one of the site level currencies.
	Currency string `json:"currency"`
	// Price for the given role.
	Price int `json:"price"`
	// Role for the price.
	Role CurrencyPriceRole `json:"role"`
}

CreateProductCurrencyPrice represents a CreateProductCurrencyPrice struct.

func (*CreateProductCurrencyPrice) MarshalJSON

func (c *CreateProductCurrencyPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPrice. It customizes the JSON marshaling process for CreateProductCurrencyPrice objects.

func (*CreateProductCurrencyPrice) UnmarshalJSON

func (c *CreateProductCurrencyPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPrice. It customizes the JSON unmarshaling process for CreateProductCurrencyPrice objects.

type CreateProductCurrencyPricesRequest

type CreateProductCurrencyPricesRequest struct {
	CurrencyPrices []CreateProductCurrencyPrice `json:"currency_prices"`
}

CreateProductCurrencyPricesRequest represents a CreateProductCurrencyPricesRequest struct.

func (*CreateProductCurrencyPricesRequest) MarshalJSON

func (c *CreateProductCurrencyPricesRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductCurrencyPricesRequest. It customizes the JSON marshaling process for CreateProductCurrencyPricesRequest objects.

func (*CreateProductCurrencyPricesRequest) UnmarshalJSON

func (c *CreateProductCurrencyPricesRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductCurrencyPricesRequest. It customizes the JSON unmarshaling process for CreateProductCurrencyPricesRequest objects.

type CreateProductFamily

type CreateProductFamily struct {
	Name        *string          `json:"name,omitempty"`
	Description Optional[string] `json:"description"`
}

CreateProductFamily represents a CreateProductFamily struct.

func (*CreateProductFamily) MarshalJSON

func (c *CreateProductFamily) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductFamily. It customizes the JSON marshaling process for CreateProductFamily objects.

func (*CreateProductFamily) UnmarshalJSON

func (c *CreateProductFamily) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamily. It customizes the JSON unmarshaling process for CreateProductFamily objects.

type CreateProductFamilyRequest

type CreateProductFamilyRequest struct {
	ProductFamily CreateProductFamily `json:"product_family"`
}

CreateProductFamilyRequest represents a CreateProductFamilyRequest struct.

func (*CreateProductFamilyRequest) MarshalJSON

func (c *CreateProductFamilyRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductFamilyRequest. It customizes the JSON marshaling process for CreateProductFamilyRequest objects.

func (*CreateProductFamilyRequest) UnmarshalJSON

func (c *CreateProductFamilyRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductFamilyRequest. It customizes the JSON unmarshaling process for CreateProductFamilyRequest objects.

type CreateProductPricePoint

type CreateProductPricePoint struct {
	// The product price point name
	Name string `json:"name"`
	// The product price point API handle
	Handle *string `json:"handle,omitempty"`
	// The product price point price, in integer cents
	PriceInCents int64 `json:"price_in_cents"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days
	Interval int `json:"interval"`
	// A string representing the interval unit for this product price point, either month or day
	IntervalUnit IntervalUnit `json:"interval_unit"`
	// The product price point trial price, in integer cents
	TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"`
	// The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days
	TrialInterval *int `json:"trial_interval,omitempty"`
	// A string representing the trial interval unit for this product price point, either month or day
	TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"`
	TrialType         *string       `json:"trial_type,omitempty"`
	// The product price point initial charge, in integer cents
	InitialChargeInCents    *int64 `json:"initial_charge_in_cents,omitempty"`
	InitialChargeAfterTrial *bool  `json:"initial_charge_after_trial,omitempty"`
	// The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire every 30 days
	ExpirationInterval *int `json:"expiration_interval,omitempty"`
	// A string representing the expiration interval unit for this product price point, either month or day
	ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"`
	// Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.
	UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"`
}

CreateProductPricePoint represents a CreateProductPricePoint struct.

func (*CreateProductPricePoint) MarshalJSON

func (c *CreateProductPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductPricePoint. It customizes the JSON marshaling process for CreateProductPricePoint objects.

func (*CreateProductPricePoint) UnmarshalJSON

func (c *CreateProductPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePoint. It customizes the JSON unmarshaling process for CreateProductPricePoint objects.

type CreateProductPricePointRequest

type CreateProductPricePointRequest struct {
	PricePoint CreateProductPricePoint `json:"price_point"`
}

CreateProductPricePointRequest represents a CreateProductPricePointRequest struct.

func (*CreateProductPricePointRequest) MarshalJSON

func (c *CreateProductPricePointRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateProductPricePointRequest. It customizes the JSON marshaling process for CreateProductPricePointRequest objects.

func (*CreateProductPricePointRequest) UnmarshalJSON

func (c *CreateProductPricePointRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateProductPricePointRequest. It customizes the JSON unmarshaling process for CreateProductPricePointRequest objects.

type CreateQuantityBasedComponent added in v0.1.0

type CreateQuantityBasedComponent struct {
	QuantityBasedComponent QuantityBasedComponent `json:"quantity_based_component"`
}

CreateQuantityBasedComponent represents a CreateQuantityBasedComponent struct.

func (*CreateQuantityBasedComponent) MarshalJSON added in v0.1.0

func (c *CreateQuantityBasedComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateQuantityBasedComponent. It customizes the JSON marshaling process for CreateQuantityBasedComponent objects.

func (*CreateQuantityBasedComponent) UnmarshalJSON added in v0.1.0

func (c *CreateQuantityBasedComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateQuantityBasedComponent. It customizes the JSON unmarshaling process for CreateQuantityBasedComponent objects.

type CreateReasonCode

type CreateReasonCode struct {
	// The unique identifier for the ReasonCode
	Code string `json:"code"`
	// The friendly summary of what the code signifies
	Description string `json:"description"`
	// The order that code appears in lists
	Position *int `json:"position,omitempty"`
}

CreateReasonCode represents a CreateReasonCode struct.

func (*CreateReasonCode) MarshalJSON

func (c *CreateReasonCode) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateReasonCode. It customizes the JSON marshaling process for CreateReasonCode objects.

func (*CreateReasonCode) UnmarshalJSON

func (c *CreateReasonCode) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCode. It customizes the JSON unmarshaling process for CreateReasonCode objects.

type CreateReasonCodeRequest

type CreateReasonCodeRequest struct {
	ReasonCode CreateReasonCode `json:"reason_code"`
}

CreateReasonCodeRequest represents a CreateReasonCodeRequest struct.

func (*CreateReasonCodeRequest) MarshalJSON

func (c *CreateReasonCodeRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateReasonCodeRequest. It customizes the JSON marshaling process for CreateReasonCodeRequest objects.

func (*CreateReasonCodeRequest) UnmarshalJSON

func (c *CreateReasonCodeRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateReasonCodeRequest. It customizes the JSON unmarshaling process for CreateReasonCodeRequest objects.

type CreateSegment

type CreateSegment struct {
	// A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric.
	SegmentProperty1Value *interface{} `json:"segment_property_1_value,omitempty"`
	// A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric.
	SegmentProperty2Value *interface{} `json:"segment_property_2_value,omitempty"`
	// A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric.
	SegmentProperty3Value *interface{} `json:"segment_property_3_value,omitempty"`
	// A value that will occur in your events that you want to bill upon. The type of the value depends on the property type in the related event based billing metric.
	SegmentProperty4Value *interface{} `json:"segment_property_4_value,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme                `json:"pricing_scheme"`
	Prices        []CreateOrUpdateSegmentPrice `json:"prices,omitempty"`
}

CreateSegment represents a CreateSegment struct.

func (*CreateSegment) MarshalJSON

func (c *CreateSegment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSegment. It customizes the JSON marshaling process for CreateSegment objects.

func (*CreateSegment) UnmarshalJSON

func (c *CreateSegment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSegment. It customizes the JSON unmarshaling process for CreateSegment objects.

type CreateSegmentRequest

type CreateSegmentRequest struct {
	Segment CreateSegment `json:"segment"`
}

CreateSegmentRequest represents a CreateSegmentRequest struct.

func (*CreateSegmentRequest) MarshalJSON

func (c *CreateSegmentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSegmentRequest. It customizes the JSON marshaling process for CreateSegmentRequest objects.

func (*CreateSegmentRequest) UnmarshalJSON

func (c *CreateSegmentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSegmentRequest. It customizes the JSON unmarshaling process for CreateSegmentRequest objects.

type CreateSubscription

type CreateSubscription struct {
	// The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead.
	ProductHandle *string `json:"product_handle,omitempty"`
	// The Product ID of the product for which you are creating a subscription. The product ID is not currently published, so we recommend using the API Handle instead.
	ProductId *int `json:"product_id,omitempty"`
	// The user-friendly API handle of a product's particular price point.
	ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"`
	// The ID of the particular price point on the product.
	ProductPricePointId *int `json:"product_price_point_id,omitempty"`
	// (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription
	CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"`
	// (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon.
	CouponCode *string `json:"coupon_code,omitempty"`
	// An array for all the coupons attached to the subscription.
	CouponCodes []string `json:"coupon_codes,omitempty"`
	// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
	PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"`
	// (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription.
	ReceivesInvoiceEmails *string `json:"receives_invoice_emails,omitempty"`
	// (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180.
	NetTerms *string `json:"net_terms,omitempty"`
	// The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given.
	CustomerId *int `json:"customer_id,omitempty"`
	// (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions.
	NextBillingAt *time.Time `json:"next_billing_at,omitempty"`
	// (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups.
	InitialBillingAt *time.Time `json:"initial_billing_at,omitempty"`
	// For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal.
	StoredCredentialTransactionId *int `json:"stored_credential_transaction_id,omitempty"`
	SalesRepId                    *int `json:"sales_rep_id,omitempty"`
	// The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id)
	PaymentProfileId *int `json:"payment_profile_id,omitempty"`
	// The reference value (provided by your app) for the subscription itelf.
	Reference          *string             `json:"reference,omitempty"`
	CustomerAttributes *CustomerAttributes `json:"customer_attributes,omitempty"`
	// alias to credit_card_attributes
	PaymentProfileAttributes *PaymentProfileAttributes `json:"payment_profile_attributes,omitempty"`
	// Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property.
	CreditCardAttributes  *PaymentProfileAttributes `json:"credit_card_attributes,omitempty"`
	BankAccountAttributes *BankAccountAttributes    `json:"bank_account_attributes,omitempty"`
	// (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677) for more information.
	Components []CreateSubscriptionComponent `json:"components,omitempty"`
	// (Optional). Cannot be used when also specifying next_billing_at
	CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"`
	// (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet.
	Metafields map[string]string `json:"metafields,omitempty"`
	// The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given.
	CustomerReference *string        `json:"customer_reference,omitempty"`
	Group             *GroupSettings `json:"group,omitempty"`
	// A valid referral code. (optional, see [Referrals](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405420204045-Referrals-Reference#how-to-obtain-referral-codes) for more details). If supplied, must be valid, or else subscription creation will fail.
	Ref *string `json:"ref,omitempty"`
	// (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about the reason for cancellation.
	CancellationMessage *string `json:"cancellation_message,omitempty"`
	// (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to make a note about how the subscription was canceled.
	CancellationMethod *string `json:"cancellation_method,omitempty"`
	// (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription.
	Currency *string `json:"currency,omitempty"`
	// Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period.
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// (Optional, default false) When set to true, and when next_billing_at is present, if the subscription expires, the expires_at will be shifted by the same amount of time as the difference between the old and new “next billing” dates.
	ExpirationTracksNextBillingChange *string `json:"expiration_tracks_next_billing_change,omitempty"`
	// (Optional) The ACH authorization agreement terms. If enabled, an email will be sent to the customer with a copy of the terms.
	AgreementTerms *string `json:"agreement_terms,omitempty"`
	// (Optional) The first name of the person authorizing the ACH agreement.
	AuthorizerFirstName *string `json:"authorizer_first_name,omitempty"`
	// (Optional) The last name of the person authorizing the ACH agreement.
	AuthorizerLastName *string `json:"authorizer_last_name,omitempty"`
	// (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal).
	CalendarBillingFirstCharge *string `json:"calendar_billing_first_charge,omitempty"`
	// (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled.
	ReasonCode *string `json:"reason_code,omitempty"`
	// (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal.
	ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"`
	// Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify id of the offer or its handle prefixed with `handle:`.er
	OfferId              *interface{}                `json:"offer_id,omitempty"`
	PrepaidConfiguration *UpsertPrepaidConfiguration `json:"prepaid_configuration,omitempty"`
	// Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount.
	PreviousBillingAt *time.Time `json:"previous_billing_at,omitempty"`
	// Setting this attribute to true will cause the subscription's MRR to be added to your MRR analytics immediately. For this value to be honored, a next_billing_at must be present and set to a future date. This key/value will not be returned in the subscription response body.
	ImportMrr   *bool      `json:"import_mrr,omitempty"`
	CanceledAt  *string    `json:"canceled_at,omitempty"`
	ActivatedAt *time.Time `json:"activated_at,omitempty"`
	// Required when creating a subscription with Maxio Payments.
	AgreementAcceptance *AgreementAcceptance `json:"agreement_acceptance,omitempty"`
	// (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted.
	AchAgreement *ACHAgreement `json:"ach_agreement,omitempty"`
	// Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
	DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"`
	// Time zone for the Dunning Communication Delay feature.
	DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"`
	// Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
	SkipBillingManifestTaxes *bool `json:"skip_billing_manifest_taxes,omitempty"`
}

CreateSubscription represents a CreateSubscription struct.

func (*CreateSubscription) MarshalJSON

func (c *CreateSubscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSubscription. It customizes the JSON marshaling process for CreateSubscription objects.

func (*CreateSubscription) UnmarshalJSON

func (c *CreateSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscription. It customizes the JSON unmarshaling process for CreateSubscription objects.

type CreateSubscriptionComponent

type CreateSubscriptionComponent struct {
	ComponentId *interface{} `json:"component_id,omitempty"`
	// Used for on/off components only.
	Enabled *bool `json:"enabled,omitempty"`
	// Used for metered and events based components.
	UnitBalance *int `json:"unit_balance,omitempty"`
	// Used for quantity based components.
	AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"`
	// Deprecated. Use `allocated_quantity` instead.
	Quantity     *int         `json:"quantity,omitempty"` // Deprecated
	PricePointId *interface{} `json:"price_point_id,omitempty"`
	// Create or update custom pricing unique to the subscription. Used in place of `price_point_id`.
	CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"`
}

CreateSubscriptionComponent represents a CreateSubscriptionComponent struct.

func (*CreateSubscriptionComponent) MarshalJSON

func (c *CreateSubscriptionComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSubscriptionComponent. It customizes the JSON marshaling process for CreateSubscriptionComponent objects.

func (*CreateSubscriptionComponent) UnmarshalJSON

func (c *CreateSubscriptionComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionComponent. It customizes the JSON unmarshaling process for CreateSubscriptionComponent objects.

type CreateSubscriptionGroup

type CreateSubscriptionGroup struct {
	SubscriptionId interface{} `json:"subscription_id"`
	MemberIds      []int       `json:"member_ids,omitempty"`
}

CreateSubscriptionGroup represents a CreateSubscriptionGroup struct.

func (*CreateSubscriptionGroup) MarshalJSON

func (c *CreateSubscriptionGroup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroup. It customizes the JSON marshaling process for CreateSubscriptionGroup objects.

func (*CreateSubscriptionGroup) UnmarshalJSON

func (c *CreateSubscriptionGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroup. It customizes the JSON unmarshaling process for CreateSubscriptionGroup objects.

type CreateSubscriptionGroupRequest

type CreateSubscriptionGroupRequest struct {
	SubscriptionGroup CreateSubscriptionGroup `json:"subscription_group"`
}

CreateSubscriptionGroupRequest represents a CreateSubscriptionGroupRequest struct.

func (*CreateSubscriptionGroupRequest) MarshalJSON

func (c *CreateSubscriptionGroupRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSubscriptionGroupRequest. It customizes the JSON marshaling process for CreateSubscriptionGroupRequest objects.

func (*CreateSubscriptionGroupRequest) UnmarshalJSON

func (c *CreateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionGroupRequest. It customizes the JSON unmarshaling process for CreateSubscriptionGroupRequest objects.

type CreateSubscriptionRequest

type CreateSubscriptionRequest struct {
	Subscription CreateSubscription `json:"subscription"`
}

CreateSubscriptionRequest represents a CreateSubscriptionRequest struct.

func (*CreateSubscriptionRequest) MarshalJSON

func (c *CreateSubscriptionRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateSubscriptionRequest. It customizes the JSON marshaling process for CreateSubscriptionRequest objects.

func (*CreateSubscriptionRequest) UnmarshalJSON

func (c *CreateSubscriptionRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateSubscriptionRequest. It customizes the JSON unmarshaling process for CreateSubscriptionRequest objects.

type CreateUsage

type CreateUsage struct {
	// integer by default or decimal number if fractional quantities are enabled for the component
	Quantity     *float64 `json:"quantity,omitempty"`
	PricePointId *string  `json:"price_point_id,omitempty"`
	Memo         *string  `json:"memo,omitempty"`
	// This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled
	BillingSchedule *BillingSchedule `json:"billing_schedule,omitempty"`
}

CreateUsage represents a CreateUsage struct.

func (*CreateUsage) MarshalJSON

func (c *CreateUsage) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateUsage. It customizes the JSON marshaling process for CreateUsage objects.

func (*CreateUsage) UnmarshalJSON

func (c *CreateUsage) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateUsage. It customizes the JSON unmarshaling process for CreateUsage objects.

type CreateUsageRequest

type CreateUsageRequest struct {
	Usage CreateUsage `json:"usage"`
}

CreateUsageRequest represents a CreateUsageRequest struct.

func (*CreateUsageRequest) MarshalJSON

func (c *CreateUsageRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreateUsageRequest. It customizes the JSON marshaling process for CreateUsageRequest objects.

func (*CreateUsageRequest) UnmarshalJSON

func (c *CreateUsageRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreateUsageRequest. It customizes the JSON unmarshaling process for CreateUsageRequest objects.

type CreatedPrepayment

type CreatedPrepayment struct {
	Id                     *int    `json:"id,omitempty"`
	SubscriptionId         *int    `json:"subscription_id,omitempty"`
	AmountInCents          *int64  `json:"amount_in_cents,omitempty"`
	Memo                   *string `json:"memo,omitempty"`
	CreatedAt              *string `json:"created_at,omitempty"`
	StartingBalanceInCents *int64  `json:"starting_balance_in_cents,omitempty"`
	EndingBalanceInCents   *int64  `json:"ending_balance_in_cents,omitempty"`
}

CreatedPrepayment represents a CreatedPrepayment struct.

func (*CreatedPrepayment) MarshalJSON

func (c *CreatedPrepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreatedPrepayment. It customizes the JSON marshaling process for CreatedPrepayment objects.

func (*CreatedPrepayment) UnmarshalJSON

func (c *CreatedPrepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreatedPrepayment. It customizes the JSON unmarshaling process for CreatedPrepayment objects.

type CreditCardAttributes

type CreditCardAttributes struct {
	FullNumber      *string `json:"full_number,omitempty"`
	ExpirationMonth *string `json:"expiration_month,omitempty"`
	ExpirationYear  *string `json:"expiration_year,omitempty"`
}

CreditCardAttributes represents a CreditCardAttributes struct.

func (*CreditCardAttributes) MarshalJSON

func (c *CreditCardAttributes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditCardAttributes. It customizes the JSON marshaling process for CreditCardAttributes objects.

func (*CreditCardAttributes) UnmarshalJSON

func (c *CreditCardAttributes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditCardAttributes. It customizes the JSON unmarshaling process for CreditCardAttributes objects.

type CreditCardPaymentProfile

type CreditCardPaymentProfile struct {
	// The Chargify-assigned ID of the stored card. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer.
	Id *int `json:"id,omitempty"`
	// The first name of the card holder.
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the card holder.
	LastName *string `json:"last_name,omitempty"`
	// A string representation of the credit card number with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’).
	MaskedCardNumber string `json:"masked_card_number"`
	// The type of card used.
	CardType *CardType `json:"card_type,omitempty"`
	// An integer representing the expiration month of the card(1 – 12).
	ExpirationMonth *int `json:"expiration_month,omitempty"`
	// An integer representing the 4-digit expiration year of the card(i.e. ‘2012’).
	ExpirationYear *int `json:"expiration_year,omitempty"`
	// The Chargify-assigned id for the customer record to which the card belongs.
	CustomerId *int `json:"customer_id,omitempty"`
	// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
	CurrentVault *CurrentVault `json:"current_vault,omitempty"`
	// The “token” provided by your vault storage for an already stored payment profile.
	VaultToken Optional[string] `json:"vault_token"`
	// The current billing street address for the card.
	BillingAddress Optional[string] `json:"billing_address"`
	// The current billing address city for the card.
	BillingCity Optional[string] `json:"billing_city"`
	// The current billing address state for the card.
	BillingState Optional[string] `json:"billing_state"`
	// The current billing address zip code for the card.
	BillingZip Optional[string] `json:"billing_zip"`
	// The current billing address country for the card.
	BillingCountry Optional[string] `json:"billing_country"`
	// (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token.
	CustomerVaultToken Optional[string] `json:"customer_vault_token"`
	// The current billing street address, second line, for the card.
	BillingAddress2 Optional[string] `json:"billing_address_2"`
	PaymentType     *PaymentType     `json:"payment_type,omitempty"`
	Disabled        *bool            `json:"disabled,omitempty"`
	// Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
	ChargifyToken        *string       `json:"chargify_token,omitempty"`
	SiteGatewaySettingId Optional[int] `json:"site_gateway_setting_id"`
	// An identifier of connected gateway.
	GatewayHandle Optional[string] `json:"gateway_handle"`
}

CreditCardPaymentProfile represents a CreditCardPaymentProfile struct.

func (*CreditCardPaymentProfile) MarshalJSON

func (c *CreditCardPaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditCardPaymentProfile. It customizes the JSON marshaling process for CreditCardPaymentProfile objects.

func (*CreditCardPaymentProfile) UnmarshalJSON

func (c *CreditCardPaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditCardPaymentProfile. It customizes the JSON unmarshaling process for CreditCardPaymentProfile objects.

type CreditNote

type CreditNote struct {
	// Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.
	Uid *string `json:"uid,omitempty"`
	// ID of the site to which the credit note belongs.
	SiteId *int `json:"site_id,omitempty"`
	// ID of the customer to which the credit note belongs.
	CustomerId *int `json:"customer_id,omitempty"`
	// ID of the subscription that generated the credit note.
	SubscriptionId *int `json:"subscription_id,omitempty"`
	// A unique, identifying string that appears on the credit note and in places it is referenced.
	// While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike.
	Number *string `json:"number,omitempty"`
	// A monotonically increasing number assigned to credit notes as they are created.  This number is unique within a site and can be used to sort and order credit notes.
	SequenceNumber *int `json:"sequence_number,omitempty"`
	// Date the credit note was issued to the customer.  This is the date that the credit was made available for application, and may come before it is fully applied.
	// The format is `"YYYY-MM-DD"`.
	IssueDate *time.Time `json:"issue_date,omitempty"`
	// Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.
	// If the credit note has been partially applied, this field will not have a value until it has been fully applied.
	// The format is `"YYYY-MM-DD"`.
	AppliedDate *time.Time `json:"applied_date,omitempty"`
	// Current status of the credit note.
	Status *CreditNoteStatus `json:"status,omitempty"`
	// The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields.
	Currency *string `json:"currency,omitempty"`
	// The memo printed on credit note, which is a description of the reason for the credit.
	Memo *string `json:"memo,omitempty"`
	// Information about the seller (merchant) listed on the masthead of the credit note.
	Seller *InvoiceSeller `json:"seller,omitempty"`
	// Information about the customer who is owner or recipient the credited subscription.
	Customer *InvoiceCustomer `json:"customer,omitempty"`
	// The billing address of the credit subscription.
	BillingAddress *InvoiceAddress `json:"billing_address,omitempty"`
	// The shipping address of the credited subscription.
	ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"`
	// Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer.
	SubtotalAmount *string `json:"subtotal_amount,omitempty"`
	// Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half).
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half).
	TaxAmount *string `json:"tax_amount,omitempty"`
	// The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.'
	TotalAmount *string `json:"total_amount,omitempty"`
	// The amount of the credit note that has already been applied to invoices.
	AppliedAmount *string `json:"applied_amount,omitempty"`
	// The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`.
	RemainingAmount *string `json:"remaining_amount,omitempty"`
	// Line items on the credit note.
	LineItems    []CreditNoteLineItem    `json:"line_items,omitempty"`
	Discounts    []InvoiceDiscount       `json:"discounts,omitempty"`
	Taxes        []InvoiceTax            `json:"taxes,omitempty"`
	Applications []CreditNoteApplication `json:"applications,omitempty"`
	Refunds      []InvoiceRefund         `json:"refunds,omitempty"`
	// An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices)
	OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"`
}

CreditNote represents a CreditNote struct.

func (*CreditNote) MarshalJSON

func (c *CreditNote) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditNote. It customizes the JSON marshaling process for CreditNote objects.

func (*CreditNote) UnmarshalJSON

func (c *CreditNote) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditNote. It customizes the JSON unmarshaling process for CreditNote objects.

type CreditNote1

type CreditNote1 struct {
	// Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.
	Uid *string `json:"uid,omitempty"`
	// ID of the site to which the credit note belongs.
	SiteId *int `json:"site_id,omitempty"`
	// ID of the customer to which the credit note belongs.
	CustomerId *int `json:"customer_id,omitempty"`
	// ID of the subscription that generated the credit note.
	SubscriptionId *int `json:"subscription_id,omitempty"`
	// A unique, identifying string that appears on the credit note and in places it is referenced.
	// While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike.
	Number *string `json:"number,omitempty"`
	// A monotonically increasing number assigned to credit notes as they are created.  This number is unique within a site and can be used to sort and order credit notes.
	SequenceNumber *int `json:"sequence_number,omitempty"`
	// Date the credit note was issued to the customer.  This is the date that the credit was made available for application, and may come before it is fully applied.
	// The format is `"YYYY-MM-DD"`.
	IssueDate *time.Time `json:"issue_date,omitempty"`
	// Credit notes are applied to invoices to offset invoiced amounts - they reduce the amount due. This field is the date the credit note became fully applied to invoices.
	// If the credit note has been partially applied, this field will not have a value until it has been fully applied.
	// The format is `"YYYY-MM-DD"`.
	AppliedDate *time.Time `json:"applied_date,omitempty"`
	// Current status of the credit note.
	Status *CreditNoteStatus `json:"status,omitempty"`
	// The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields.
	Currency *string `json:"currency,omitempty"`
	// The memo printed on credit note, which is a description of the reason for the credit.
	Memo            *string          `json:"memo,omitempty"`
	Seller          *Seller          `json:"seller,omitempty"`
	Customer        *Customer1       `json:"customer,omitempty"`
	BillingAddress  *BillingAddress  `json:"billing_address,omitempty"`
	ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
	// Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer.
	SubtotalAmount *string `json:"subtotal_amount,omitempty"`
	// Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half).
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half).
	TaxAmount *string `json:"tax_amount,omitempty"`
	// The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.'
	TotalAmount *string `json:"total_amount,omitempty"`
	// The amount of the credit note that has already been applied to invoices.
	AppliedAmount *string `json:"applied_amount,omitempty"`
	// The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`.
	RemainingAmount *string `json:"remaining_amount,omitempty"`
	// Line items on the credit note.
	LineItems    []CreditNoteLineItem    `json:"line_items,omitempty"`
	Discounts    []InvoiceDiscount       `json:"discounts,omitempty"`
	Taxes        []InvoiceTax            `json:"taxes,omitempty"`
	Applications []CreditNoteApplication `json:"applications,omitempty"`
	Refunds      []InvoiceRefund         `json:"refunds,omitempty"`
	// An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices)
	OriginInvoices []OriginInvoice `json:"origin_invoices,omitempty"`
}

CreditNote1 represents a CreditNote1 struct.

func (*CreditNote1) MarshalJSON

func (c *CreditNote1) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditNote1. It customizes the JSON marshaling process for CreditNote1 objects.

func (*CreditNote1) UnmarshalJSON

func (c *CreditNote1) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditNote1. It customizes the JSON unmarshaling process for CreditNote1 objects.

type CreditNoteApplication

type CreditNoteApplication struct {
	Uid             *string `json:"uid,omitempty"`
	TransactionTime *string `json:"transaction_time,omitempty"`
	InvoiceUid      *string `json:"invoice_uid,omitempty"`
	Memo            *string `json:"memo,omitempty"`
	AppliedAmount   *string `json:"applied_amount,omitempty"`
}

CreditNoteApplication represents a CreditNoteApplication struct.

func (*CreditNoteApplication) MarshalJSON

func (c *CreditNoteApplication) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditNoteApplication. It customizes the JSON marshaling process for CreditNoteApplication objects.

func (*CreditNoteApplication) UnmarshalJSON

func (c *CreditNoteApplication) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteApplication. It customizes the JSON unmarshaling process for CreditNoteApplication objects.

type CreditNoteLineItem

type CreditNoteLineItem struct {
	// Unique identifier for the line item.  Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists.
	Uid *string `json:"uid,omitempty"`
	// A short descriptor for the credit given by this line.
	Title *string `json:"title,omitempty"`
	// Detailed description for the credit given by this line.  May include proration details in plain text.
	// Note: this string may contain line breaks that are hints for the best display format on the credit note.
	Description *string `json:"description,omitempty"`
	// The quantity or count of units credited by the line item.
	// This is a decimal number represented as a string. (See "About Decimal Numbers".)
	Quantity *string `json:"quantity,omitempty"`
	// The price per unit for the line item.
	// When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`.
	UnitPrice *string `json:"unit_price,omitempty"`
	// The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount).
	SubtotalAmount *string `json:"subtotal_amount,omitempty"`
	// The approximate discount of just this line.
	// The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors.
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// The approximate tax of just this line.
	// The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors.
	TaxAmount *string `json:"tax_amount,omitempty"`
	// The non-canonical total amount for the line.
	// `subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter.  Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`.
	TotalAmount *string `json:"total_amount,omitempty"`
	// When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units.
	TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"`
	// Start date for the period credited by this line. The format is `"YYYY-MM-DD"`.
	PeriodRangeStart *string `json:"period_range_start,omitempty"`
	// End date for the period credited by this line. The format is `"YYYY-MM-DD"`.
	PeriodRangeEnd *string `json:"period_range_end,omitempty"`
	// The ID of the product being credited.
	// This may be set even for component credits, so true product-only (non-component) credits will also have a nil `component_id`.
	ProductId *int `json:"product_id,omitempty"`
	// The version of the product being credited.
	ProductVersion *int `json:"product_version,omitempty"`
	// The ID of the component being credited. Will be `nil` for non-component credits.
	ComponentId Optional[int] `json:"component_id"`
	// The price point ID of the component being credited. Will be `nil` for non-component credits.
	PricePointId Optional[int] `json:"price_point_id"`
}

CreditNoteLineItem represents a CreditNoteLineItem struct.

func (*CreditNoteLineItem) MarshalJSON

func (c *CreditNoteLineItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditNoteLineItem. It customizes the JSON marshaling process for CreditNoteLineItem objects.

func (*CreditNoteLineItem) UnmarshalJSON

func (c *CreditNoteLineItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditNoteLineItem. It customizes the JSON unmarshaling process for CreditNoteLineItem objects.

type CreditNoteStatus added in v0.1.0

type CreditNoteStatus string

CreditNoteStatus is a string enum. Current status of the credit note.

const (
	CreditNoteStatus_OPEN    CreditNoteStatus = "open"
	CreditNoteStatus_APPLIED CreditNoteStatus = "applied"
)

type CreditScheme

type CreditScheme string

CreditScheme is a string enum.

const (
	CreditScheme_NONE   CreditScheme = "none"
	CreditScheme_CREDIT CreditScheme = "credit"
	CreditScheme_REFUND CreditScheme = "refund"
)

type CreditSchemeRequest

type CreditSchemeRequest struct {
	CreditScheme CreditScheme `json:"credit_scheme"`
}

CreditSchemeRequest represents a CreditSchemeRequest struct.

func (*CreditSchemeRequest) MarshalJSON

func (c *CreditSchemeRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CreditSchemeRequest. It customizes the JSON marshaling process for CreditSchemeRequest objects.

func (*CreditSchemeRequest) UnmarshalJSON

func (c *CreditSchemeRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CreditSchemeRequest. It customizes the JSON unmarshaling process for CreditSchemeRequest objects.

type CreditType

type CreditType string

CreditType is a string enum. The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: `full`, `prorated`, `none`.

const (
	CreditType_FULL     CreditType = "full"
	CreditType_PRORATED CreditType = "prorated"
	CreditType_NONE     CreditType = "none"
)

type CurrencyPrice

type CurrencyPrice struct {
	Id                  *int     `json:"id,omitempty"`
	Currency            *string  `json:"currency,omitempty"`
	Price               *float64 `json:"price,omitempty"`
	FormattedPrice      *string  `json:"formatted_price,omitempty"`
	ProductPricePointId *int     `json:"product_price_point_id,omitempty"`
	// Role for the price.
	Role *CurrencyPriceRole `json:"role,omitempty"`
}

CurrencyPrice represents a CurrencyPrice struct.

func (*CurrencyPrice) MarshalJSON

func (c *CurrencyPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CurrencyPrice. It customizes the JSON marshaling process for CurrencyPrice objects.

func (*CurrencyPrice) UnmarshalJSON

func (c *CurrencyPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPrice. It customizes the JSON unmarshaling process for CurrencyPrice objects.

type CurrencyPriceRole

type CurrencyPriceRole string

CurrencyPriceRole is a string enum. Role for the price.

const (
	CurrencyPriceRole_BASELINE CurrencyPriceRole = "baseline"
	CurrencyPriceRole_TRIAL    CurrencyPriceRole = "trial"
	CurrencyPriceRole_INITIAL  CurrencyPriceRole = "initial"
)

type CurrencyPricesResponse added in v0.1.0

type CurrencyPricesResponse struct {
	CurrencyPrices []CurrencyPrice `json:"currency_prices"`
}

CurrencyPricesResponse represents a CurrencyPricesResponse struct.

func (*CurrencyPricesResponse) MarshalJSON added in v0.1.0

func (c *CurrencyPricesResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CurrencyPricesResponse. It customizes the JSON marshaling process for CurrencyPricesResponse objects.

func (*CurrencyPricesResponse) UnmarshalJSON added in v0.1.0

func (c *CurrencyPricesResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CurrencyPricesResponse. It customizes the JSON unmarshaling process for CurrencyPricesResponse objects.

type CurrentVault

type CurrentVault string

CurrentVault is a string enum. The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.

const (
	CurrentVault_ADYEN          CurrentVault = "adyen"
	CurrentVault_AUTHORIZENET   CurrentVault = "authorizenet"
	CurrentVault_AVALARA        CurrentVault = "avalara"
	CurrentVault_BEANSTREAM     CurrentVault = "beanstream"
	CurrentVault_BLUESNAP       CurrentVault = "blue_snap"
	CurrentVault_BOGUS          CurrentVault = "bogus"
	CurrentVault_BRAINTREEBLUE  CurrentVault = "braintree_blue"
	CurrentVault_CHECKOUT       CurrentVault = "checkout"
	CurrentVault_CYBERSOURCE    CurrentVault = "cybersource"
	CurrentVault_ELAVON         CurrentVault = "elavon"
	CurrentVault_EWAY           CurrentVault = "eway"
	CurrentVault_EWAYRAPIDSTD   CurrentVault = "eway_rapid_std"
	CurrentVault_FIRSTDATA      CurrentVault = "firstdata"
	CurrentVault_FORTE          CurrentVault = "forte"
	CurrentVault_GOCARDLESS     CurrentVault = "gocardless"
	CurrentVault_LITLE          CurrentVault = "litle"
	CurrentVault_MAXIOPAYMENTS  CurrentVault = "maxio_payments"
	CurrentVault_MODUSLINK      CurrentVault = "moduslink"
	CurrentVault_MONERIS        CurrentVault = "moneris"
	CurrentVault_NMI            CurrentVault = "nmi"
	CurrentVault_ORBITAL        CurrentVault = "orbital"
	CurrentVault_PAYMENTEXPRESS CurrentVault = "payment_express"
	CurrentVault_PIN            CurrentVault = "pin"
	CurrentVault_SQUARE         CurrentVault = "square"
	CurrentVault_STRIPECONNECT  CurrentVault = "stripe_connect"
	CurrentVault_TRUSTCOMMERCE  CurrentVault = "trust_commerce"
	CurrentVault_UNIPAAS        CurrentVault = "unipaas"
)

type CustomFieldOwner added in v0.1.0

type CustomFieldOwner string

CustomFieldOwner is a string enum.

const (
	CustomFieldOwner_CUSTOMER     CustomFieldOwner = "Customer"
	CustomFieldOwner_SUBSCRIPTION CustomFieldOwner = "Subscription"
)

type Customer

type Customer struct {
	// The first name of the customer
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the customer
	LastName *string `json:"last_name,omitempty"`
	// The email address of the customer
	Email *string `json:"email,omitempty"`
	// A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”)
	CcEmails Optional[string] `json:"cc_emails"`
	// The organization of the customer
	Organization Optional[string] `json:"organization"`
	// The unique identifier used within your own application for this customer
	Reference Optional[string] `json:"reference"`
	// The customer ID in Chargify
	Id *int `json:"id,omitempty"`
	// The timestamp in which the customer object was created in Chargify
	CreatedAt *string `json:"created_at,omitempty"`
	// The timestamp in which the customer object was last edited
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The customer’s shipping street address (i.e. “123 Main St.”)
	Address Optional[string] `json:"address"`
	// Second line of the customer’s shipping address i.e. “Apt. 100”
	Address2 Optional[string] `json:"address_2"`
	// The customer’s shipping address city (i.e. “Boston”)
	City Optional[string] `json:"city"`
	// The customer’s shipping address state (i.e. “MA”)
	State Optional[string] `json:"state"`
	// The customer's full name of state
	StateName Optional[string] `json:"state_name"`
	// The customer’s shipping address zip code (i.e. “12345”)
	Zip Optional[string] `json:"zip"`
	// The customer shipping address country
	Country Optional[string] `json:"country"`
	// The customer's full name of country
	CountryName Optional[string] `json:"country_name"`
	// The phone number of the customer
	Phone Optional[string] `json:"phone"`
	// Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway
	Verified Optional[bool] `json:"verified"`
	// The timestamp of when the Billing Portal entry was created at for the customer
	PortalCustomerCreatedAt Optional[string] `json:"portal_customer_created_at"`
	// The timestamp of when the Billing Portal invite was last sent at
	PortalInviteLastSentAt Optional[string] `json:"portal_invite_last_sent_at"`
	// The timestamp of when the Billing Portal invite was last accepted
	PortalInviteLastAcceptedAt Optional[string] `json:"portal_invite_last_accepted_at"`
	// The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false.
	TaxExempt *bool `json:"tax_exempt,omitempty"`
	// The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out.
	VatNumber Optional[string] `json:"vat_number"`
	// The parent ID in Chargify if applicable. Parent is another Customer object.
	ParentId Optional[int] `json:"parent_id"`
	// The locale for the customer to identify language-region
	Locale                      Optional[string] `json:"locale"`
	DefaultSubscriptionGroupUid Optional[string] `json:"default_subscription_group_uid"`
}

Customer represents a Customer struct.

func (*Customer) MarshalJSON

func (c *Customer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Customer. It customizes the JSON marshaling process for Customer objects.

func (*Customer) UnmarshalJSON

func (c *Customer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Customer. It customizes the JSON unmarshaling process for Customer objects.

type Customer1

type Customer1 struct {
	ChargifyId   *int             `json:"chargify_id,omitempty"`
	FirstName    *string          `json:"first_name,omitempty"`
	LastName     *string          `json:"last_name,omitempty"`
	Organization Optional[string] `json:"organization"`
	Email        *string          `json:"email,omitempty"`
	VatNumber    Optional[string] `json:"vat_number"`
	Reference    Optional[string] `json:"reference"`
}

Customer1 represents a Customer1 struct.

func (*Customer1) MarshalJSON

func (c *Customer1) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Customer1. It customizes the JSON marshaling process for Customer1 objects.

func (*Customer1) UnmarshalJSON

func (c *Customer1) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Customer1. It customizes the JSON unmarshaling process for Customer1 objects.

type CustomerAttributes

type CustomerAttributes struct {
	// The first name of the customer. Required when creating a customer via attributes.
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the customer. Required when creating a customer via attributes.
	LastName *string `json:"last_name,omitempty"`
	// The email address of the customer. Required when creating a customer via attributes.
	Email *string `json:"email,omitempty"`
	// A list of emails that should be cc’d on all customer communications. Optional.
	CcEmails *string `json:"cc_emails,omitempty"`
	// The organization/company of the customer. Optional.
	Organization *string `json:"organization,omitempty"`
	// A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional.
	Reference *string `json:"reference,omitempty"`
	// (Optional) The customer’s shipping street address (i.e. “123 Main St.”).
	Address *string `json:"address,omitempty"`
	// (Optional) Second line of the customer’s shipping address i.e. “Apt. 100”
	Address2 Optional[string] `json:"address_2"`
	// (Optional) The customer’s shipping address city (i.e. “Boston”).
	City *string `json:"city,omitempty"`
	// (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.
	State *string `json:"state,omitempty"`
	// (Optional) The customer’s shipping address zip code (i.e. “12345”).
	Zip *string `json:"zip,omitempty"`
	// (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”).
	Country *string `json:"country,omitempty"`
	// (Optional) The phone number of the customer.
	Phone    *string `json:"phone,omitempty"`
	Verified *bool   `json:"verified,omitempty"`
	// (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false.
	TaxExempt *bool `json:"tax_exempt,omitempty"`
	// (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase.
	VatNumber *string `json:"vat_number,omitempty"`
	// (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet.
	Metafields map[string]string `json:"metafields,omitempty"`
	// The parent ID in Chargify if applicable. Parent is another Customer object.
	ParentId Optional[int] `json:"parent_id"`
}

CustomerAttributes represents a CustomerAttributes struct.

func (*CustomerAttributes) MarshalJSON

func (c *CustomerAttributes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerAttributes. It customizes the JSON marshaling process for CustomerAttributes objects.

func (*CustomerAttributes) UnmarshalJSON

func (c *CustomerAttributes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerAttributes. It customizes the JSON unmarshaling process for CustomerAttributes objects.

type CustomerChange

type CustomerChange struct {
	Payer           Optional[CustomerPayerChange]        `json:"payer"`
	ShippingAddress Optional[AddressChange]              `json:"shipping_address"`
	BillingAddress  Optional[AddressChange]              `json:"billing_address"`
	CustomFields    Optional[CustomerCustomFieldsChange] `json:"custom_fields"`
}

CustomerChange represents a CustomerChange struct.

func (*CustomerChange) MarshalJSON

func (c *CustomerChange) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerChange. It customizes the JSON marshaling process for CustomerChange objects.

func (*CustomerChange) UnmarshalJSON

func (c *CustomerChange) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerChange. It customizes the JSON unmarshaling process for CustomerChange objects.

type CustomerChangesPreviewResponse

type CustomerChangesPreviewResponse struct {
	Changes CustomerChange `json:"changes"`
}

CustomerChangesPreviewResponse represents a CustomerChangesPreviewResponse struct.

func (*CustomerChangesPreviewResponse) MarshalJSON

func (c *CustomerChangesPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerChangesPreviewResponse. It customizes the JSON marshaling process for CustomerChangesPreviewResponse objects.

func (*CustomerChangesPreviewResponse) UnmarshalJSON

func (c *CustomerChangesPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerChangesPreviewResponse. It customizes the JSON unmarshaling process for CustomerChangesPreviewResponse objects.

type CustomerCustomFieldsChange

type CustomerCustomFieldsChange struct {
	Before []InvoiceCustomField `json:"before"`
	After  []InvoiceCustomField `json:"after"`
}

CustomerCustomFieldsChange represents a CustomerCustomFieldsChange struct.

func (*CustomerCustomFieldsChange) MarshalJSON

func (c *CustomerCustomFieldsChange) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerCustomFieldsChange. It customizes the JSON marshaling process for CustomerCustomFieldsChange objects.

func (*CustomerCustomFieldsChange) UnmarshalJSON

func (c *CustomerCustomFieldsChange) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerCustomFieldsChange. It customizes the JSON unmarshaling process for CustomerCustomFieldsChange objects.

type CustomerPayerChange

type CustomerPayerChange struct {
	Before InvoicePayerChange `json:"before"`
	After  InvoicePayerChange `json:"after"`
}

CustomerPayerChange represents a CustomerPayerChange struct.

func (*CustomerPayerChange) MarshalJSON

func (c *CustomerPayerChange) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerPayerChange. It customizes the JSON marshaling process for CustomerPayerChange objects.

func (*CustomerPayerChange) UnmarshalJSON

func (c *CustomerPayerChange) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerPayerChange. It customizes the JSON unmarshaling process for CustomerPayerChange objects.

type CustomerResponse

type CustomerResponse struct {
	Customer Customer `json:"customer"`
}

CustomerResponse represents a CustomerResponse struct.

func (*CustomerResponse) MarshalJSON

func (c *CustomerResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for CustomerResponse. It customizes the JSON marshaling process for CustomerResponse objects.

func (*CustomerResponse) UnmarshalJSON

func (c *CustomerResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerResponse. It customizes the JSON unmarshaling process for CustomerResponse objects.

type DeductServiceCredit

type DeductServiceCredit struct {
	Amount interface{} `json:"amount"`
	Memo   string      `json:"memo"`
}

DeductServiceCredit represents a DeductServiceCredit struct.

func (*DeductServiceCredit) MarshalJSON

func (d *DeductServiceCredit) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for DeductServiceCredit. It customizes the JSON marshaling process for DeductServiceCredit objects.

func (*DeductServiceCredit) UnmarshalJSON

func (d *DeductServiceCredit) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCredit. It customizes the JSON unmarshaling process for DeductServiceCredit objects.

type DeductServiceCreditRequest

type DeductServiceCreditRequest struct {
	Deduction DeductServiceCredit `json:"deduction"`
}

DeductServiceCreditRequest represents a DeductServiceCreditRequest struct.

func (*DeductServiceCreditRequest) MarshalJSON

func (d *DeductServiceCreditRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for DeductServiceCreditRequest. It customizes the JSON marshaling process for DeductServiceCreditRequest objects.

func (*DeductServiceCreditRequest) UnmarshalJSON

func (d *DeductServiceCreditRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for DeductServiceCreditRequest. It customizes the JSON unmarshaling process for DeductServiceCreditRequest objects.

type DelayedCancellationResponse

type DelayedCancellationResponse struct {
	Message *string `json:"message,omitempty"`
}

DelayedCancellationResponse represents a DelayedCancellationResponse struct.

func (*DelayedCancellationResponse) MarshalJSON

func (d *DelayedCancellationResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for DelayedCancellationResponse. It customizes the JSON marshaling process for DelayedCancellationResponse objects.

func (*DelayedCancellationResponse) UnmarshalJSON

func (d *DelayedCancellationResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for DelayedCancellationResponse. It customizes the JSON unmarshaling process for DelayedCancellationResponse objects.

type DeleteSubscriptionGroupResponse

type DeleteSubscriptionGroupResponse struct {
	Uid     *string `json:"uid,omitempty"`
	Deleted *bool   `json:"deleted,omitempty"`
}

DeleteSubscriptionGroupResponse represents a DeleteSubscriptionGroupResponse struct.

func (*DeleteSubscriptionGroupResponse) MarshalJSON

func (d *DeleteSubscriptionGroupResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for DeleteSubscriptionGroupResponse. It customizes the JSON marshaling process for DeleteSubscriptionGroupResponse objects.

func (*DeleteSubscriptionGroupResponse) UnmarshalJSON

func (d *DeleteSubscriptionGroupResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for DeleteSubscriptionGroupResponse. It customizes the JSON unmarshaling process for DeleteSubscriptionGroupResponse objects.

type Direction

type Direction string

Direction is a string enum.

const (
	Direction_ASC  Direction = "asc"
	Direction_DESC Direction = "desc"
)

type DiscountType

type DiscountType string

DiscountType is a string enum.

const (
	DiscountType_AMOUNT  DiscountType = "amount"
	DiscountType_PERCENT DiscountType = "percent"
)

type EBBComponent added in v0.1.0

type EBBComponent struct {
	// A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes".
	Name string `json:"name"`
	// The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item
	UnitName string `json:"unit_name"`
	// A description for the component that will be displayed to the user on the hosted signup page.
	Description *string `json:"description,omitempty"`
	// A unique identifier for your use that can be used to retrieve this component is subsequent requests.  Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
	Handle *string `json:"handle,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme `json:"pricing_scheme"`
	// (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes.
	Prices []Price `json:"prices,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]      `json:"downgrade_credit"`
	PricePoints     []ComponentPricePointItem `json:"price_points,omitempty"`
	// The amount the customer will be charged per unit when the pricing scheme is “per_unit”. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"`
	// deprecated May 2011 - use unit_price instead
	PriceInCents *string `json:"price_in_cents,omitempty"`
	// The ID of an event based billing metric that will be attached to this component.
	EventBasedBillingMetricId int `json:"event_based_billing_metric_id"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

EBBComponent represents a EBBComponent struct.

func (*EBBComponent) MarshalJSON added in v0.1.0

func (e *EBBComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EBBComponent. It customizes the JSON marshaling process for EBBComponent objects.

func (*EBBComponent) UnmarshalJSON added in v0.1.0

func (e *EBBComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EBBComponent. It customizes the JSON unmarshaling process for EBBComponent objects.

type EBBEvent

type EBBEvent struct {
	Chargify *ChargifyEBB `json:"chargify,omitempty"`
}

EBBEvent represents a EBBEvent struct.

func (*EBBEvent) MarshalJSON

func (e *EBBEvent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EBBEvent. It customizes the JSON marshaling process for EBBEvent objects.

func (*EBBEvent) UnmarshalJSON

func (e *EBBEvent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EBBEvent. It customizes the JSON unmarshaling process for EBBEvent objects.

type EnableWebhooksRequest

type EnableWebhooksRequest struct {
	WebhooksEnabled bool `json:"webhooks_enabled"`
}

EnableWebhooksRequest represents a EnableWebhooksRequest struct.

func (*EnableWebhooksRequest) MarshalJSON

func (e *EnableWebhooksRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EnableWebhooksRequest. It customizes the JSON marshaling process for EnableWebhooksRequest objects.

func (*EnableWebhooksRequest) UnmarshalJSON

func (e *EnableWebhooksRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksRequest. It customizes the JSON unmarshaling process for EnableWebhooksRequest objects.

type EnableWebhooksResponse

type EnableWebhooksResponse struct {
	WebhooksEnabled *bool `json:"webhooks_enabled,omitempty"`
}

EnableWebhooksResponse represents a EnableWebhooksResponse struct.

func (*EnableWebhooksResponse) MarshalJSON

func (e *EnableWebhooksResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EnableWebhooksResponse. It customizes the JSON marshaling process for EnableWebhooksResponse objects.

func (*EnableWebhooksResponse) UnmarshalJSON

func (e *EnableWebhooksResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EnableWebhooksResponse. It customizes the JSON unmarshaling process for EnableWebhooksResponse objects.

type Endpoint

type Endpoint struct {
	Id                   *int     `json:"id,omitempty"`
	Url                  *string  `json:"url,omitempty"`
	SiteId               *int     `json:"site_id,omitempty"`
	Status               *string  `json:"status,omitempty"`
	WebhookSubscriptions []string `json:"webhook_subscriptions,omitempty"`
}

Endpoint represents a Endpoint struct.

func (*Endpoint) MarshalJSON

func (e *Endpoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Endpoint. It customizes the JSON marshaling process for Endpoint objects.

func (*Endpoint) UnmarshalJSON

func (e *Endpoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Endpoint. It customizes the JSON unmarshaling process for Endpoint objects.

type EndpointResponse

type EndpointResponse struct {
	Endpoint *Endpoint `json:"endpoint,omitempty"`
}

EndpointResponse represents a EndpointResponse struct.

func (*EndpointResponse) MarshalJSON

func (e *EndpointResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EndpointResponse. It customizes the JSON marshaling process for EndpointResponse objects.

func (*EndpointResponse) UnmarshalJSON

func (e *EndpointResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EndpointResponse. It customizes the JSON unmarshaling process for EndpointResponse objects.

type Errors

type Errors struct {
	PerPage    []string `json:"per_page,omitempty"`
	PricePoint []string `json:"price_point,omitempty"`
}

Errors represents a Errors struct.

func (*Errors) MarshalJSON

func (e *Errors) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Errors. It customizes the JSON marshaling process for Errors objects.

func (*Errors) UnmarshalJSON

func (e *Errors) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Errors. It customizes the JSON unmarshaling process for Errors objects.

type Event

type Event struct {
	Id                int         `json:"id"`
	Key               string      `json:"key"`
	Message           string      `json:"message"`
	SubscriptionId    *int        `json:"subscription_id"`
	CustomerId        int         `json:"customer_id"`
	CreatedAt         string      `json:"created_at"`
	EventSpecificData interface{} `json:"event_specific_data"`
}

Event represents a Event struct.

func (*Event) MarshalJSON

func (e *Event) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Event. It customizes the JSON marshaling process for Event objects.

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Event. It customizes the JSON unmarshaling process for Event objects.

type EventBasedBillingSegmentError

type EventBasedBillingSegmentError struct {
	// The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key.
	Segments map[string]interface{} `json:"segments"`
}

EventBasedBillingSegmentError represents a EventBasedBillingSegmentError struct.

func (*EventBasedBillingSegmentError) MarshalJSON

func (e *EventBasedBillingSegmentError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EventBasedBillingSegmentError. It customizes the JSON marshaling process for EventBasedBillingSegmentError objects.

func (*EventBasedBillingSegmentError) UnmarshalJSON

func (e *EventBasedBillingSegmentError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EventBasedBillingSegmentError. It customizes the JSON unmarshaling process for EventBasedBillingSegmentError objects.

type EventResponse

type EventResponse struct {
	Event Event `json:"event"`
}

EventResponse represents a EventResponse struct.

func (*EventResponse) MarshalJSON

func (e *EventResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for EventResponse. It customizes the JSON marshaling process for EventResponse objects.

func (*EventResponse) UnmarshalJSON

func (e *EventResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EventResponse. It customizes the JSON unmarshaling process for EventResponse objects.

type EventType

type EventType string

EventType is a string enum.

const (
	EventType_ACCOUNTTRANSACTIONCHANGED                      EventType = "account_transaction_changed"
	EventType_BILLINGDATECHANGE                              EventType = "billing_date_change"
	EventType_COMPONENTALLOCATIONCHANGE                      EventType = "component_allocation_change"
	EventType_CUSTOMERUPDATE                                 EventType = "customer_update"
	EventType_CUSTOMERCREATE                                 EventType = "customer_create"
	EventType_DUNNINGSTEPREACHED                             EventType = "dunning_step_reached"
	EventType_EXPIRATIONDATECHANGE                           EventType = "expiration_date_change"
	EventType_EXPIRINGCARD                                   EventType = "expiring_card"
	EventType_METEREDUSAGE                                   EventType = "metered_usage"
	EventType_PAYMENTSUCCESS                                 EventType = "payment_success"
	EventType_PAYMENTSUCCESSRECREATED                        EventType = "payment_success_recreated"
	EventType_PAYMENTFAILURE                                 EventType = "payment_failure"
	EventType_PAYMENTFAILURERECREATED                        EventType = "payment_failure_recreated"
	EventType_REFUNDFAILURE                                  EventType = "refund_failure"
	EventType_REFUNDSUCCESS                                  EventType = "refund_success"
	EventType_RENEWALSUCCESS                                 EventType = "renewal_success"
	EventType_RENEWALSUCCESSRECREATED                        EventType = "renewal_success_recreated"
	EventType_RENEWALFAILURE                                 EventType = "renewal_failure"
	EventType_SIGNUPSUCCESS                                  EventType = "signup_success"
	EventType_SIGNUPFAILURE                                  EventType = "signup_failure"
	EventType_STATEMENTCLOSED                                EventType = "statement_closed"
	EventType_STATEMENTSETTLED                               EventType = "statement_settled"
	EventType_SUBSCRIPTIONBANKACCOUNTUPDATE                  EventType = "subscription_bank_account_update"
	EventType_SUBSCRIPTIONDELETION                           EventType = "subscription_deletion"
	EventType_SUBSCRIPTIONPAYPALACCOUNTUPDATE                EventType = "subscription_paypal_account_update"
	EventType_SUBSCRIPTIONPRODUCTCHANGE                      EventType = "subscription_product_change"
	EventType_SUBSCRIPTIONSTATECHANGE                        EventType = "subscription_state_change"
	EventType_TRIALENDNOTICE                                 EventType = "trial_end_notice"
	EventType_UPGRADEDOWNGRADESUCCESS                        EventType = "upgrade_downgrade_success"
	EventType_UPGRADEDOWNGRADEFAILURE                        EventType = "upgrade_downgrade_failure"
	EventType_UPCOMINGRENEWALNOTICE                          EventType = "upcoming_renewal_notice"
	EventType_CUSTOMFIELDVALUECHANGE                         EventType = "custom_field_value_change"
	EventType_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED    EventType = "subscription_prepayment_account_balance_changed"
	EventType_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED EventType = "subscription_service_credit_account_balance_changed"
)

type ExtendedIntervalUnit

type ExtendedIntervalUnit string

ExtendedIntervalUnit is a string enum.

const (
	ExtendedIntervalUnit_DAY   ExtendedIntervalUnit = "day"
	ExtendedIntervalUnit_MONTH ExtendedIntervalUnit = "month"
	ExtendedIntervalUnit_NEVER ExtendedIntervalUnit = "never"
)

type FailedPaymentAction

type FailedPaymentAction string

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

const (
	FailedPaymentAction_LEAVEOPENINVOICE  FailedPaymentAction = "leave_open_invoice"
	FailedPaymentAction_ROLLBACKTOPENDING FailedPaymentAction = "rollback_to_pending"
	FailedPaymentAction_INITIATEDUNNING   FailedPaymentAction = "initiate_dunning"
)

type FileWrapper

type FileWrapper = https.FileWrapper

FileWrapper is a struct that represents a file along with its metadata such as the file content, file name, and file headers.

type FirstChargeType

type FirstChargeType string

FirstChargeType is a string enum.

const (
	FirstChargeType_PRORATED  FirstChargeType = "prorated"
	FirstChargeType_IMMEDIATE FirstChargeType = "immediate"
	FirstChargeType_DELAYED   FirstChargeType = "delayed"
)

type FullSubscriptionGroupResponse

type FullSubscriptionGroupResponse struct {
	Uid                         *string                    `json:"uid,omitempty"`
	Scheme                      *int                       `json:"scheme,omitempty"`
	CustomerId                  *int                       `json:"customer_id,omitempty"`
	PaymentProfileId            *int                       `json:"payment_profile_id,omitempty"`
	SubscriptionIds             []int                      `json:"subscription_ids,omitempty"`
	PrimarySubscriptionId       *int                       `json:"primary_subscription_id,omitempty"`
	NextAssessmentAt            *string                    `json:"next_assessment_at,omitempty"`
	State                       *string                    `json:"state,omitempty"`
	CancelAtEndOfPeriod         *bool                      `json:"cancel_at_end_of_period,omitempty"`
	CurrentBillingAmountInCents *int64                     `json:"current_billing_amount_in_cents,omitempty"`
	Customer                    *SubscriptionGroupCustomer `json:"customer,omitempty"`
	AccountBalances             *SubscriptionGroupBalances `json:"account_balances,omitempty"`
}

FullSubscriptionGroupResponse represents a FullSubscriptionGroupResponse struct.

func (*FullSubscriptionGroupResponse) MarshalJSON

func (f *FullSubscriptionGroupResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for FullSubscriptionGroupResponse. It customizes the JSON marshaling process for FullSubscriptionGroupResponse objects.

func (*FullSubscriptionGroupResponse) UnmarshalJSON

func (f *FullSubscriptionGroupResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for FullSubscriptionGroupResponse. It customizes the JSON unmarshaling process for FullSubscriptionGroupResponse objects.

type GetOneTimeTokenPaymentProfile

type GetOneTimeTokenPaymentProfile struct {
	Id               Optional[string] `json:"id"`
	FirstName        string           `json:"first_name"`
	LastName         string           `json:"last_name"`
	MaskedCardNumber string           `json:"masked_card_number"`
	// The type of card used.
	CardType        CardType         `json:"card_type"`
	ExpirationMonth float64          `json:"expiration_month"`
	ExpirationYear  float64          `json:"expiration_year"`
	CustomerId      Optional[string] `json:"customer_id"`
	// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
	CurrentVault         CurrentVault     `json:"current_vault"`
	VaultToken           string           `json:"vault_token"`
	BillingAddress       string           `json:"billing_address"`
	BillingAddress2      *string          `json:"billing_address_2,omitempty"`
	BillingCity          string           `json:"billing_city"`
	BillingCountry       string           `json:"billing_country"`
	BillingState         string           `json:"billing_state"`
	BillingZip           string           `json:"billing_zip"`
	PaymentType          string           `json:"payment_type"`
	Disabled             bool             `json:"disabled"`
	SiteGatewaySettingId int              `json:"site_gateway_setting_id"`
	CustomerVaultToken   Optional[string] `json:"customer_vault_token"`
	GatewayHandle        Optional[string] `json:"gateway_handle"`
}

GetOneTimeTokenPaymentProfile represents a GetOneTimeTokenPaymentProfile struct.

func (*GetOneTimeTokenPaymentProfile) MarshalJSON

func (g *GetOneTimeTokenPaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenPaymentProfile. It customizes the JSON marshaling process for GetOneTimeTokenPaymentProfile objects.

func (*GetOneTimeTokenPaymentProfile) UnmarshalJSON

func (g *GetOneTimeTokenPaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenPaymentProfile. It customizes the JSON unmarshaling process for GetOneTimeTokenPaymentProfile objects.

type GetOneTimeTokenRequest

type GetOneTimeTokenRequest struct {
	PaymentProfile GetOneTimeTokenPaymentProfile `json:"payment_profile"`
}

GetOneTimeTokenRequest represents a GetOneTimeTokenRequest struct.

func (*GetOneTimeTokenRequest) MarshalJSON

func (g *GetOneTimeTokenRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for GetOneTimeTokenRequest. It customizes the JSON marshaling process for GetOneTimeTokenRequest objects.

func (*GetOneTimeTokenRequest) UnmarshalJSON

func (g *GetOneTimeTokenRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for GetOneTimeTokenRequest. It customizes the JSON unmarshaling process for GetOneTimeTokenRequest objects.

type GroupBilling

type GroupBilling struct {
	// A flag indicating whether or not to accrue charges on the new subscription.
	Accrue *bool `json:"accrue,omitempty"`
	// A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.
	AlignDate *bool `json:"align_date,omitempty"`
	// A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.
	Prorate *bool `json:"prorate,omitempty"`
}

GroupBilling represents a GroupBilling struct. Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions.

func (*GroupBilling) MarshalJSON

func (g *GroupBilling) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for GroupBilling. It customizes the JSON marshaling process for GroupBilling objects.

func (*GroupBilling) UnmarshalJSON

func (g *GroupBilling) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for GroupBilling. It customizes the JSON unmarshaling process for GroupBilling objects.

type GroupSettings

type GroupSettings struct {
	// Attributes of the target customer who will be the responsible payer of the created subscription. Required.
	Target GroupTarget `json:"target"`
	// Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions.
	Billing *GroupBilling `json:"billing,omitempty"`
}

GroupSettings represents a GroupSettings struct.

func (*GroupSettings) MarshalJSON

func (g *GroupSettings) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for GroupSettings. It customizes the JSON marshaling process for GroupSettings objects.

func (*GroupSettings) UnmarshalJSON

func (g *GroupSettings) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for GroupSettings. It customizes the JSON unmarshaling process for GroupSettings objects.

type GroupTarget

type GroupTarget struct {
	// The type of object indicated by the id attribute.
	Type GroupTargetType `json:"type"`
	// The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest"
	Id *int `json:"id,omitempty"`
}

GroupTarget represents a GroupTarget struct. Attributes of the target customer who will be the responsible payer of the created subscription. Required.

func (*GroupTarget) MarshalJSON

func (g *GroupTarget) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for GroupTarget. It customizes the JSON marshaling process for GroupTarget objects.

func (*GroupTarget) UnmarshalJSON

func (g *GroupTarget) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for GroupTarget. It customizes the JSON unmarshaling process for GroupTarget objects.

type GroupTargetType

type GroupTargetType string

GroupTargetType is a string enum. The type of object indicated by the id attribute.

const (
	GroupTargetType_CUSTOMER     GroupTargetType = "customer"
	GroupTargetType_SUBSCRIPTION GroupTargetType = "subscription"
	GroupTargetType_SELF         GroupTargetType = "self"
	GroupTargetType_PARENT       GroupTargetType = "parent"
	GroupTargetType_ELDEST       GroupTargetType = "eldest"
)

type IncludeNotNull

type IncludeNotNull string

IncludeNotNull is a string enum. Passed as a parameter to list methods to return only non null values.

const (
	IncludeNotNull_NOTNULL IncludeNotNull = "not_null"
)

type IncludeOption

type IncludeOption string

IncludeOption is a string enum.

const (
	IncludeOption_EXCLUDE IncludeOption = "0"
	IncludeOption_INCLUDE IncludeOption = "1"
)

type IntervalUnit

type IntervalUnit string

IntervalUnit is a string enum.

const (
	IntervalUnit_DAY   IntervalUnit = "day"
	IntervalUnit_MONTH IntervalUnit = "month"
)

type Invoice

type Invoice struct {
	Id *int64 `json:"id,omitempty"`
	// Unique identifier for the invoice. It is generated automatically by Chargify and has the prefix "inv_" followed by alphanumeric characters.
	Uid *string `json:"uid,omitempty"`
	// ID of the site to which the invoice belongs.
	SiteId *int `json:"site_id,omitempty"`
	// ID of the customer to which the invoice belongs.
	CustomerId *int `json:"customer_id,omitempty"`
	// ID of the subscription that generated the invoice.
	SubscriptionId *int `json:"subscription_id,omitempty"`
	// A unique, identifying string that appears on the invoice and in places the invoice is referenced.
	// While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike.
	Number *string `json:"number,omitempty"`
	// A monotonically increasing number assigned to invoices as they are created.  This number is unique within a site and can be used to sort and order invoices.
	SequenceNumber  *int       `json:"sequence_number,omitempty"`
	TransactionTime *time.Time `json:"transaction_time,omitempty"`
	CreatedAt       *time.Time `json:"created_at,omitempty"`
	UpdatedAt       *time.Time `json:"updated_at,omitempty"`
	// Date the invoice was issued to the customer.  This is the date that the invoice was made available for payment.
	// The format is `"YYYY-MM-DD"`.
	IssueDate *time.Time `json:"issue_date,omitempty"`
	// Date the invoice is due.
	// The format is `"YYYY-MM-DD"`.
	DueDate *time.Time `json:"due_date,omitempty"`
	// Date the invoice became fully paid.
	// If partial payments are applied to the invoice, this date will not be present until payment has been made in full.
	// The format is `"YYYY-MM-DD"`.
	PaidDate Optional[time.Time] `json:"paid_date"`
	// The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more.
	Status          *InvoiceStatus `json:"status,omitempty"`
	Role            *InvoiceRole   `json:"role,omitempty"`
	ParentInvoiceId Optional[int]  `json:"parent_invoice_id"`
	// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
	CollectionMethod *CollectionMethod `json:"collection_method,omitempty"`
	// A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant.
	PaymentInstructions *string `json:"payment_instructions,omitempty"`
	// The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
	Currency *string `json:"currency,omitempty"`
	// Consolidation level of the invoice, which is applicable to invoice consolidation.  It will hold one of the following values:
	// * "none": A normal invoice with no consolidation.
	// * "child": An invoice segment which has been combined into a consolidated invoice.
	// * "parent": A consolidated invoice, whose contents are composed of invoice segments.
	// "Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.
	// See also the [invoice consolidation documentation](https://chargify.zendesk.com/hc/en-us/articles/4407746391835).
	ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"`
	// For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice.
	ParentInvoiceUid    Optional[string] `json:"parent_invoice_uid"`
	SubscriptionGroupId Optional[int]    `json:"subscription_group_id"`
	// For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice.
	ParentInvoiceNumber Optional[int] `json:"parent_invoice_number"`
	// For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice.
	GroupPrimarySubscriptionId Optional[int] `json:"group_primary_subscription_id"`
	// The name of the product subscribed when the invoice was generated.
	ProductName *string `json:"product_name,omitempty"`
	// The name of the product family subscribed when the invoice was generated.
	ProductFamilyName *string `json:"product_family_name,omitempty"`
	// Information about the seller (merchant) listed on the masthead of the invoice.
	Seller *InvoiceSeller `json:"seller,omitempty"`
	// Information about the customer who is owner or recipient the invoiced subscription.
	Customer        *InvoiceCustomer `json:"customer,omitempty"`
	Payer           *InvoicePayer    `json:"payer,omitempty"`
	RecipientEmails []string         `json:"recipient_emails,omitempty"`
	NetTerms        *int             `json:"net_terms,omitempty"`
	// The memo printed on invoices of any collection type.  This message is in control of the merchant.
	Memo *string `json:"memo,omitempty"`
	// The invoice billing address.
	BillingAddress *InvoiceAddress `json:"billing_address,omitempty"`
	// The invoice shipping address.
	ShippingAddress *InvoiceAddress `json:"shipping_address,omitempty"`
	// Subtotal of the invoice, which is the sum of all line items before discounts or taxes.
	SubtotalAmount *string `json:"subtotal_amount,omitempty"`
	// Total discount applied to the invoice.
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// Total tax on the invoice.
	TaxAmount *string `json:"tax_amount,omitempty"`
	// The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.'
	TotalAmount *string `json:"total_amount,omitempty"`
	// The amount of credit (from credit notes) applied to this invoice.
	// Credits offset the amount due from the customer.
	CreditAmount *string `json:"credit_amount,omitempty"`
	RefundAmount *string `json:"refund_amount,omitempty"`
	// The amount paid on the invoice by the customer.
	PaidAmount *string `json:"paid_amount,omitempty"`
	// Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`.
	DueAmount *string `json:"due_amount,omitempty"`
	// Line items on the invoice.
	LineItems       []InvoiceLineItem       `json:"line_items,omitempty"`
	Discounts       []InvoiceDiscount       `json:"discounts,omitempty"`
	Taxes           []InvoiceTax            `json:"taxes,omitempty"`
	Credits         []InvoiceCredit         `json:"credits,omitempty"`
	Refunds         []InvoiceRefund         `json:"refunds,omitempty"`
	Payments        []InvoicePayment        `json:"payments,omitempty"`
	CustomFields    []InvoiceCustomField    `json:"custom_fields,omitempty"`
	DisplaySettings *InvoiceDisplaySettings `json:"display_settings,omitempty"`
	// The public URL of the invoice
	PublicUrl           *string                 `json:"public_url,omitempty"`
	PreviousBalanceData *InvoicePreviousBalance `json:"previous_balance_data,omitempty"`
}

Invoice represents a Invoice struct.

func (*Invoice) MarshalJSON

func (i *Invoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Invoice. It customizes the JSON marshaling process for Invoice objects.

func (*Invoice) UnmarshalJSON

func (i *Invoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Invoice. It customizes the JSON unmarshaling process for Invoice objects.

type InvoiceAddress

type InvoiceAddress struct {
	Street  Optional[string] `json:"street"`
	Line2   Optional[string] `json:"line2"`
	City    Optional[string] `json:"city"`
	State   Optional[string] `json:"state"`
	Zip     Optional[string] `json:"zip"`
	Country Optional[string] `json:"country"`
}

InvoiceAddress represents a InvoiceAddress struct.

func (*InvoiceAddress) MarshalJSON

func (i *InvoiceAddress) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceAddress. It customizes the JSON marshaling process for InvoiceAddress objects.

func (*InvoiceAddress) UnmarshalJSON

func (i *InvoiceAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceAddress. It customizes the JSON unmarshaling process for InvoiceAddress objects.

type InvoiceBalanceItem

type InvoiceBalanceItem struct {
	Uid               *string `json:"uid,omitempty"`
	Number            *string `json:"number,omitempty"`
	OutstandingAmount *string `json:"outstanding_amount,omitempty"`
}

InvoiceBalanceItem represents a InvoiceBalanceItem struct.

func (*InvoiceBalanceItem) MarshalJSON

func (i *InvoiceBalanceItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceBalanceItem. It customizes the JSON marshaling process for InvoiceBalanceItem objects.

func (*InvoiceBalanceItem) UnmarshalJSON

func (i *InvoiceBalanceItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceBalanceItem. It customizes the JSON unmarshaling process for InvoiceBalanceItem objects.

type InvoiceConsolidationLevel

type InvoiceConsolidationLevel string

InvoiceConsolidationLevel is a string enum. Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * "none": A normal invoice with no consolidation. * "child": An invoice segment which has been combined into a consolidated invoice. * "parent": A consolidated invoice, whose contents are composed of invoice segments. "Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments. See also the [invoice consolidation documentation](https://chargify.zendesk.com/hc/en-us/articles/4407746391835).

const (
	InvoiceConsolidationLevel_NONE   InvoiceConsolidationLevel = "none"
	InvoiceConsolidationLevel_CHILD  InvoiceConsolidationLevel = "child"
	InvoiceConsolidationLevel_PARENT InvoiceConsolidationLevel = "parent"
)

type InvoiceCredit

type InvoiceCredit struct {
	Uid              *string    `json:"uid,omitempty"`
	CreditNoteNumber *string    `json:"credit_note_number,omitempty"`
	CreditNoteUid    *string    `json:"credit_note_uid,omitempty"`
	TransactionTime  *time.Time `json:"transaction_time,omitempty"`
	Memo             *string    `json:"memo,omitempty"`
	OriginalAmount   *string    `json:"original_amount,omitempty"`
	AppliedAmount    *string    `json:"applied_amount,omitempty"`
}

InvoiceCredit represents a InvoiceCredit struct.

func (*InvoiceCredit) MarshalJSON

func (i *InvoiceCredit) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceCredit. It customizes the JSON marshaling process for InvoiceCredit objects.

func (*InvoiceCredit) UnmarshalJSON

func (i *InvoiceCredit) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCredit. It customizes the JSON unmarshaling process for InvoiceCredit objects.

type InvoiceCustomField

type InvoiceCustomField struct {
	OwnerId     *int              `json:"owner_id,omitempty"`
	OwnerType   *CustomFieldOwner `json:"owner_type,omitempty"`
	Name        *string           `json:"name,omitempty"`
	Value       *string           `json:"value,omitempty"`
	MetadatumId *int              `json:"metadatum_id,omitempty"`
}

InvoiceCustomField represents a InvoiceCustomField struct.

func (*InvoiceCustomField) MarshalJSON

func (i *InvoiceCustomField) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceCustomField. It customizes the JSON marshaling process for InvoiceCustomField objects.

func (*InvoiceCustomField) UnmarshalJSON

func (i *InvoiceCustomField) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomField. It customizes the JSON unmarshaling process for InvoiceCustomField objects.

type InvoiceCustomer

type InvoiceCustomer struct {
	ChargifyId   *int             `json:"chargify_id,omitempty"`
	FirstName    *string          `json:"first_name,omitempty"`
	LastName     *string          `json:"last_name,omitempty"`
	Organization Optional[string] `json:"organization"`
	Email        *string          `json:"email,omitempty"`
	VatNumber    Optional[string] `json:"vat_number"`
	Reference    Optional[string] `json:"reference"`
}

InvoiceCustomer represents a InvoiceCustomer struct. Information about the customer who is owner or recipient the invoiced subscription.

func (*InvoiceCustomer) MarshalJSON

func (i *InvoiceCustomer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceCustomer. It customizes the JSON marshaling process for InvoiceCustomer objects.

func (*InvoiceCustomer) UnmarshalJSON

func (i *InvoiceCustomer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceCustomer. It customizes the JSON unmarshaling process for InvoiceCustomer objects.

type InvoiceDateField

type InvoiceDateField string

InvoiceDateField is a string enum.

const (
	InvoiceDateField_CREATEDAT InvoiceDateField = "created_at"
	InvoiceDateField_DUEDATE   InvoiceDateField = "due_date"
	InvoiceDateField_ISSUEDATE InvoiceDateField = "issue_date"
	InvoiceDateField_UPDATEDAT InvoiceDateField = "updated_at"
	InvoiceDateField_PAIDDATE  InvoiceDateField = "paid_date"
)

type InvoiceDiscount

type InvoiceDiscount struct {
	Uid               *string                   `json:"uid,omitempty"`
	Title             *string                   `json:"title,omitempty"`
	Description       Optional[string]          `json:"description"`
	Code              *string                   `json:"code,omitempty"`
	SourceType        *string                   `json:"source_type,omitempty"`
	SourceId          *int                      `json:"source_id,omitempty"`
	DiscountType      *string                   `json:"discount_type,omitempty"`
	Percentage        *string                   `json:"percentage,omitempty"`
	EligibleAmount    *string                   `json:"eligible_amount,omitempty"`
	DiscountAmount    *string                   `json:"discount_amount,omitempty"`
	TransactionId     *int                      `json:"transaction_id,omitempty"`
	LineItemBreakouts []InvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"`
}

InvoiceDiscount represents a InvoiceDiscount struct.

func (*InvoiceDiscount) MarshalJSON

func (i *InvoiceDiscount) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceDiscount. It customizes the JSON marshaling process for InvoiceDiscount objects.

func (*InvoiceDiscount) UnmarshalJSON

func (i *InvoiceDiscount) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscount. It customizes the JSON unmarshaling process for InvoiceDiscount objects.

type InvoiceDiscountBreakout

type InvoiceDiscountBreakout struct {
	Uid            *string `json:"uid,omitempty"`
	EligibleAmount *string `json:"eligible_amount,omitempty"`
	DiscountAmount *string `json:"discount_amount,omitempty"`
}

InvoiceDiscountBreakout represents a InvoiceDiscountBreakout struct.

func (*InvoiceDiscountBreakout) MarshalJSON

func (i *InvoiceDiscountBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceDiscountBreakout. It customizes the JSON marshaling process for InvoiceDiscountBreakout objects.

func (*InvoiceDiscountBreakout) UnmarshalJSON

func (i *InvoiceDiscountBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDiscountBreakout. It customizes the JSON unmarshaling process for InvoiceDiscountBreakout objects.

type InvoiceDisplaySettings

type InvoiceDisplaySettings struct {
	HideZeroSubtotalLines   *bool `json:"hide_zero_subtotal_lines,omitempty"`
	IncludeDiscountsOnLines *bool `json:"include_discounts_on_lines,omitempty"`
}

InvoiceDisplaySettings represents a InvoiceDisplaySettings struct.

func (*InvoiceDisplaySettings) MarshalJSON

func (i *InvoiceDisplaySettings) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceDisplaySettings. It customizes the JSON marshaling process for InvoiceDisplaySettings objects.

func (*InvoiceDisplaySettings) UnmarshalJSON

func (i *InvoiceDisplaySettings) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceDisplaySettings. It customizes the JSON unmarshaling process for InvoiceDisplaySettings objects.

type InvoiceEvent

type InvoiceEvent struct {
	Id *int `json:"id,omitempty"`
	// Invoice Event Type
	EventType *InvoiceEventType `json:"event_type,omitempty"`
	// The event data is the data that, when combined with the command, results in the output invoice found in the invoice field.
	EventData *InvoiceEventData `json:"event_data,omitempty"`
	Timestamp *string           `json:"timestamp,omitempty"`
	Invoice   *Invoice          `json:"invoice,omitempty"`
}

InvoiceEvent represents a InvoiceEvent struct.

func (*InvoiceEvent) MarshalJSON

func (i *InvoiceEvent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceEvent. It customizes the JSON marshaling process for InvoiceEvent objects.

func (*InvoiceEvent) UnmarshalJSON

func (i *InvoiceEvent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEvent. It customizes the JSON unmarshaling process for InvoiceEvent objects.

type InvoiceEventData added in v0.1.0

type InvoiceEventData struct {
	// Unique identifier for the credit note application. It is generated automatically by Chargify and has the prefix "cdt_" followed by alphanumeric characters.
	Uid *string `json:"uid,omitempty"`
	// A unique, identifying string that appears on the credit note and in places it is referenced.
	CreditNoteNumber *string `json:"credit_note_number,omitempty"`
	// Unique identifier for the credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.
	CreditNoteUid *string `json:"credit_note_uid,omitempty"`
	// The full, original amount of the credit note.
	OriginalAmount *string `json:"original_amount,omitempty"`
	// The amount of the credit note applied to invoice.
	AppliedAmount *string `json:"applied_amount,omitempty"`
	// The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z"
	TransactionTime *time.Time `json:"transaction_time,omitempty"`
	// The credit note memo.
	Memo *string `json:"memo,omitempty"`
	// The role of the credit note (e.g. 'general')
	Role *string `json:"role,omitempty"`
	// Shows whether it was applied to consolidated invoice or not
	ConsolidatedInvoice *bool `json:"consolidated_invoice,omitempty"`
	// List of credit notes applied to children invoices (if consolidated invoice)
	AppliedCreditNotes []AppliedCreditNoteData `json:"applied_credit_notes,omitempty"`
	// A unique, identifying string that appears on the debit note and in places it is referenced.
	DebitNoteNumber *string `json:"debit_note_number,omitempty"`
	// Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters.
	DebitNoteUid *string `json:"debit_note_uid,omitempty"`
	// A nested data structure detailing the method of payment
	PaymentMethod *InvoiceEventPayment1 `json:"payment_method,omitempty"`
	// The Chargify id of the original payment
	TransactionId             *int             `json:"transaction_id,omitempty"`
	ParentInvoiceNumber       Optional[int]    `json:"parent_invoice_number"`
	RemainingPrepaymentAmount Optional[string] `json:"remaining_prepayment_amount"`
	// The flag that shows whether the original payment was a prepayment or not
	Prepayment *bool `json:"prepayment,omitempty"`
	External   *bool `json:"external,omitempty"`
	// The previous collection method of the invoice.
	FromCollectionMethod *string `json:"from_collection_method,omitempty"`
	// The new collection method of the invoice.
	ToCollectionMethod *string `json:"to_collection_method,omitempty"`
	// Consolidation level of the invoice, which is applicable to invoice consolidation.  It will hold one of the following values:
	// * "none": A normal invoice with no consolidation.
	// * "child": An invoice segment which has been combined into a consolidated invoice.
	// * "parent": A consolidated invoice, whose contents are composed of invoice segments.
	// "Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.
	// See also the [invoice consolidation documentation](https://chargify.zendesk.com/hc/en-us/articles/4407746391835).
	ConsolidationLevel *InvoiceConsolidationLevel `json:"consolidation_level,omitempty"`
	// The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more.
	FromStatus *InvoiceStatus `json:"from_status,omitempty"`
	// The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more.
	ToStatus *InvoiceStatus `json:"to_status,omitempty"`
	// Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`.
	DueAmount *string `json:"due_amount,omitempty"`
	// The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.'
	TotalAmount *string `json:"total_amount,omitempty"`
	// If true, credit was created and applied it to the invoice.
	ApplyCredit          *bool        `json:"apply_credit,omitempty"`
	CreditNoteAttributes *CreditNote1 `json:"credit_note_attributes,omitempty"`
	// The ID of the payment transaction to be refunded.
	PaymentId *int `json:"payment_id,omitempty"`
	// The amount of the refund.
	RefundAmount *string `json:"refund_amount,omitempty"`
	// The ID of the refund transaction.
	RefundId *int `json:"refund_id,omitempty"`
	// If true, the invoice is an advance invoice.
	IsAdvanceInvoice *bool `json:"is_advance_invoice,omitempty"`
	// The reason for the void.
	Reason *string `json:"reason,omitempty"`
}

InvoiceEventData represents a InvoiceEventData struct. The event data is the data that, when combined with the command, results in the output invoice found in the invoice field.

func (*InvoiceEventData) MarshalJSON added in v0.1.0

func (i *InvoiceEventData) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceEventData. It customizes the JSON marshaling process for InvoiceEventData objects.

func (*InvoiceEventData) UnmarshalJSON added in v0.1.0

func (i *InvoiceEventData) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventData. It customizes the JSON unmarshaling process for InvoiceEventData objects.

type InvoiceEventPayment added in v0.1.0

type InvoiceEventPayment struct {
	Type                *string          `json:"type,omitempty"`
	MaskedAccountNumber *string          `json:"masked_account_number,omitempty"`
	MaskedRoutingNumber *string          `json:"masked_routing_number,omitempty"`
	CardBrand           *string          `json:"card_brand,omitempty"`
	CardExpiration      *string          `json:"card_expiration,omitempty"`
	LastFour            Optional[string] `json:"last_four"`
	MaskedCardNumber    *string          `json:"masked_card_number,omitempty"`
	Details             Optional[string] `json:"details"`
	Kind                *string          `json:"kind,omitempty"`
	Memo                Optional[string] `json:"memo"`
	Email               *string          `json:"email,omitempty"`
}

InvoiceEventPayment represents a InvoiceEventPayment struct. A nested data structure detailing the method of payment

func (*InvoiceEventPayment) MarshalJSON added in v0.1.0

func (i *InvoiceEventPayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceEventPayment. It customizes the JSON marshaling process for InvoiceEventPayment objects.

func (*InvoiceEventPayment) UnmarshalJSON added in v0.1.0

func (i *InvoiceEventPayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventPayment. It customizes the JSON unmarshaling process for InvoiceEventPayment objects.

type InvoiceEventPayment1 added in v0.1.0

type InvoiceEventPayment1 struct {
	Type                *string          `json:"type,omitempty"`
	MaskedAccountNumber string           `json:"masked_account_number"`
	MaskedRoutingNumber string           `json:"masked_routing_number"`
	CardBrand           string           `json:"card_brand"`
	CardExpiration      *string          `json:"card_expiration,omitempty"`
	LastFour            Optional[string] `json:"last_four"`
	MaskedCardNumber    string           `json:"masked_card_number"`
	Details             *string          `json:"details"`
	Kind                string           `json:"kind"`
	Memo                *string          `json:"memo"`
	Email               string           `json:"email"`
}

InvoiceEventPayment1 represents a InvoiceEventPayment1 struct. A nested data structure detailing the method of payment

func (*InvoiceEventPayment1) MarshalJSON added in v0.1.0

func (i *InvoiceEventPayment1) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceEventPayment1. It customizes the JSON marshaling process for InvoiceEventPayment1 objects.

func (*InvoiceEventPayment1) UnmarshalJSON added in v0.1.0

func (i *InvoiceEventPayment1) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceEventPayment1. It customizes the JSON unmarshaling process for InvoiceEventPayment1 objects.

type InvoiceEventPaymentMethod added in v0.1.0

type InvoiceEventPaymentMethod string

InvoiceEventPaymentMethod is a string enum.

const (
	InvoiceEventPaymentMethod_APPLEPAY      InvoiceEventPaymentMethod = "apple_pay"
	InvoiceEventPaymentMethod_BANKACCOUNT   InvoiceEventPaymentMethod = "bank_account"
	InvoiceEventPaymentMethod_CREDITCARD    InvoiceEventPaymentMethod = "credit_card"
	InvoiceEventPaymentMethod_EXTERNAL      InvoiceEventPaymentMethod = "external"
	InvoiceEventPaymentMethod_PAYPALACCOUNT InvoiceEventPaymentMethod = "paypal_account"
)

type InvoiceEventType

type InvoiceEventType string

InvoiceEventType is a string enum. Invoice Event Type

const (
	InvoiceEventType_ISSUEINVOICE                  InvoiceEventType = "issue_invoice"
	InvoiceEventType_APPLYCREDITNOTE               InvoiceEventType = "apply_credit_note"
	InvoiceEventType_CREATECREDITNOTE              InvoiceEventType = "create_credit_note"
	InvoiceEventType_APPLYPAYMENT                  InvoiceEventType = "apply_payment"
	InvoiceEventType_APPLYDEBITNOTE                InvoiceEventType = "apply_debit_note"
	InvoiceEventType_REFUNDINVOICE                 InvoiceEventType = "refund_invoice"
	InvoiceEventType_VOIDINVOICE                   InvoiceEventType = "void_invoice"
	InvoiceEventType_VOIDREMAINDER                 InvoiceEventType = "void_remainder"
	InvoiceEventType_BACKPORTINVOICE               InvoiceEventType = "backport_invoice"
	InvoiceEventType_CHANGEINVOICESTATUS           InvoiceEventType = "change_invoice_status"
	InvoiceEventType_CHANGEINVOICECOLLECTIONMETHOD InvoiceEventType = "change_invoice_collection_method"
	InvoiceEventType_REMOVEPAYMENT                 InvoiceEventType = "remove_payment"
	InvoiceEventType_FAILEDPAYMENT                 InvoiceEventType = "failed_payment"
	InvoiceEventType_CHANGECHARGEBACKSTATUS        InvoiceEventType = "change_chargeback_status"
)

type InvoiceLineItem

type InvoiceLineItem struct {
	// Unique identifier for the line item.  Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists.
	Uid *string `json:"uid,omitempty"`
	// A short descriptor for the charge or item represented by this line.
	Title *string `json:"title,omitempty"`
	// Detailed description for the charge or item represented by this line.  May include proration details in plain text.
	// Note: this string may contain line breaks that are hints for the best display format on the invoice.
	Description *string `json:"description,omitempty"`
	// The quantity or count of units billed by the line item.
	// This is a decimal number represented as a string. (See "About Decimal Numbers".)
	Quantity *string `json:"quantity,omitempty"`
	// The price per unit for the line item.
	// When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`.
	UnitPrice *string `json:"unit_price,omitempty"`
	// The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount).
	SubtotalAmount *string `json:"subtotal_amount,omitempty"`
	// The approximate discount applied to just this line.
	// The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors.
	DiscountAmount *string `json:"discount_amount,omitempty"`
	// The approximate tax applied to just this line.
	// The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors.
	TaxAmount *string `json:"tax_amount,omitempty"`
	// The non-canonical total amount for the line.
	// `subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter.  Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`.
	TotalAmount *string `json:"total_amount,omitempty"`
	// When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units.
	TieredUnitPrice *bool `json:"tiered_unit_price,omitempty"`
	// Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.
	// * For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
	// * For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
	// * For non-periodic charges, this date and the end date will match.
	PeriodRangeStart *time.Time `json:"period_range_start,omitempty"`
	// End date for the period covered by this line. The format is `"YYYY-MM-DD"`.
	// * For periodic charges paid in advance, this date will match the next (future) billing date.
	// * For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date.
	// * For non-periodic charges, this date and the start date will match.
	PeriodRangeEnd *time.Time `json:"period_range_end,omitempty"`
	TransactionId  *int       `json:"transaction_id,omitempty"`
	// The ID of the product subscribed when the charge was made.
	// This may be set even for component charges, so true product-only (non-component) charges will also have a nil `component_id`.
	ProductId Optional[int] `json:"product_id"`
	// The version of the product subscribed when the charge was made.
	ProductVersion Optional[int] `json:"product_version"`
	// The ID of the component being billed. Will be `nil` for non-component charges.
	ComponentId Optional[int] `json:"component_id"`
	// The price point ID of the component being billed. Will be `nil` for non-component charges.
	PricePointId      Optional[int]                              `json:"price_point_id"`
	Hide              *bool                                      `json:"hide,omitempty"`
	ComponentCostData Optional[InvoiceLineItemComponentCostData] `json:"component_cost_data"`
	// The price point ID of the line item's product
	ProductPricePointId Optional[int] `json:"product_price_point_id"`
	CustomItem          *bool         `json:"custom_item,omitempty"`
}

InvoiceLineItem represents a InvoiceLineItem struct.

func (*InvoiceLineItem) MarshalJSON

func (i *InvoiceLineItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceLineItem. It customizes the JSON marshaling process for InvoiceLineItem objects.

func (*InvoiceLineItem) UnmarshalJSON

func (i *InvoiceLineItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItem. It customizes the JSON unmarshaling process for InvoiceLineItem objects.

type InvoiceLineItemComponentCostData

type InvoiceLineItemComponentCostData struct {
	Rates []ComponentCostData `json:"rates,omitempty"`
}

InvoiceLineItemComponentCostData represents a InvoiceLineItemComponentCostData struct.

func (*InvoiceLineItemComponentCostData) MarshalJSON

func (i *InvoiceLineItemComponentCostData) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceLineItemComponentCostData. It customizes the JSON marshaling process for InvoiceLineItemComponentCostData objects.

func (*InvoiceLineItemComponentCostData) UnmarshalJSON

func (i *InvoiceLineItemComponentCostData) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceLineItemComponentCostData. It customizes the JSON unmarshaling process for InvoiceLineItemComponentCostData objects.

type InvoicePayer

type InvoicePayer struct {
	ChargifyId   *int             `json:"chargify_id,omitempty"`
	FirstName    *string          `json:"first_name,omitempty"`
	LastName     *string          `json:"last_name,omitempty"`
	Organization Optional[string] `json:"organization"`
	Email        *string          `json:"email,omitempty"`
	VatNumber    Optional[string] `json:"vat_number"`
}

InvoicePayer represents a InvoicePayer struct.

func (*InvoicePayer) MarshalJSON

func (i *InvoicePayer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePayer. It customizes the JSON marshaling process for InvoicePayer objects.

func (*InvoicePayer) UnmarshalJSON

func (i *InvoicePayer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayer. It customizes the JSON unmarshaling process for InvoicePayer objects.

type InvoicePayerChange added in v0.1.0

type InvoicePayerChange struct {
	FirstName    *string `json:"first_name,omitempty"`
	LastName     *string `json:"last_name,omitempty"`
	Organization *string `json:"organization,omitempty"`
	Email        *string `json:"email,omitempty"`
}

InvoicePayerChange represents a InvoicePayerChange struct.

func (*InvoicePayerChange) MarshalJSON added in v0.1.0

func (i *InvoicePayerChange) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePayerChange. It customizes the JSON marshaling process for InvoicePayerChange objects.

func (*InvoicePayerChange) UnmarshalJSON added in v0.1.0

func (i *InvoicePayerChange) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayerChange. It customizes the JSON unmarshaling process for InvoicePayerChange objects.

type InvoicePayment

type InvoicePayment struct {
	TransactionTime *time.Time            `json:"transaction_time,omitempty"`
	Memo            *string               `json:"memo,omitempty"`
	OriginalAmount  *string               `json:"original_amount,omitempty"`
	AppliedAmount   *string               `json:"applied_amount,omitempty"`
	PaymentMethod   *InvoicePaymentMethod `json:"payment_method,omitempty"`
	TransactionId   *int                  `json:"transaction_id,omitempty"`
	Prepayment      *bool                 `json:"prepayment,omitempty"`
	GatewayHandle   Optional[string]      `json:"gateway_handle"`
	GatewayUsed     *string               `json:"gateway_used,omitempty"`
	// The transaction ID for the payment as returned from the payment gateway
	GatewayTransactionId Optional[string] `json:"gateway_transaction_id"`
}

InvoicePayment represents a InvoicePayment struct.

func (*InvoicePayment) MarshalJSON

func (i *InvoicePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePayment. It customizes the JSON marshaling process for InvoicePayment objects.

func (*InvoicePayment) UnmarshalJSON

func (i *InvoicePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePayment. It customizes the JSON unmarshaling process for InvoicePayment objects.

type InvoicePaymentApplication

type InvoicePaymentApplication struct {
	// Unique identifier for the paid invoice. It has the prefix "inv_" followed by alphanumeric characters.
	InvoiceUid *string `json:"invoice_uid,omitempty"`
	// Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters.
	ApplicationUid *string `json:"application_uid,omitempty"`
	// Dollar amount of the paid invoice.
	AppliedAmount *string `json:"applied_amount,omitempty"`
}

InvoicePaymentApplication represents a InvoicePaymentApplication struct.

func (*InvoicePaymentApplication) MarshalJSON

func (i *InvoicePaymentApplication) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePaymentApplication. It customizes the JSON marshaling process for InvoicePaymentApplication objects.

func (*InvoicePaymentApplication) UnmarshalJSON

func (i *InvoicePaymentApplication) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentApplication. It customizes the JSON unmarshaling process for InvoicePaymentApplication objects.

type InvoicePaymentMethod

type InvoicePaymentMethod struct {
	Details          *string          `json:"details,omitempty"`
	Kind             *string          `json:"kind,omitempty"`
	Memo             *string          `json:"memo,omitempty"`
	Type             *string          `json:"type,omitempty"`
	CardBrand        *string          `json:"card_brand,omitempty"`
	CardExpiration   *string          `json:"card_expiration,omitempty"`
	LastFour         Optional[string] `json:"last_four"`
	MaskedCardNumber *string          `json:"masked_card_number,omitempty"`
}

InvoicePaymentMethod represents a InvoicePaymentMethod struct.

func (*InvoicePaymentMethod) MarshalJSON

func (i *InvoicePaymentMethod) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePaymentMethod. It customizes the JSON marshaling process for InvoicePaymentMethod objects.

func (*InvoicePaymentMethod) UnmarshalJSON

func (i *InvoicePaymentMethod) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePaymentMethod. It customizes the JSON unmarshaling process for InvoicePaymentMethod objects.

type InvoicePaymentMethodType

type InvoicePaymentMethodType string

InvoicePaymentMethodType is a string enum. The type of payment method used. Defaults to other.

const (
	InvoicePaymentMethodType_CREDITCARD InvoicePaymentMethodType = "credit_card"
	InvoicePaymentMethodType_CHECK      InvoicePaymentMethodType = "check"
	InvoicePaymentMethodType_CASH       InvoicePaymentMethodType = "cash"
	InvoicePaymentMethodType_MONEYORDER InvoicePaymentMethodType = "money_order"
	InvoicePaymentMethodType_ACH        InvoicePaymentMethodType = "ach"
	InvoicePaymentMethodType_OTHER      InvoicePaymentMethodType = "other"
)

type InvoicePaymentType

type InvoicePaymentType string

InvoicePaymentType is a string enum. The type of payment to be applied to an Invoice. Defaults to external.

const (
	InvoicePaymentType_EXTERNAL      InvoicePaymentType = "external"
	InvoicePaymentType_PREPAYMENT    InvoicePaymentType = "prepayment"
	InvoicePaymentType_SERVICECREDIT InvoicePaymentType = "service_credit"
	InvoicePaymentType_PAYMENT       InvoicePaymentType = "payment"
)

type InvoicePrePayment

type InvoicePrePayment struct {
	// The subscription id for the prepayment account
	SubscriptionId *string `json:"subscription_id,omitempty"`
	// The amount in cents of the prepayment that was created as a result of this payment.
	AmountInCents *string `json:"amount_in_cents,omitempty"`
	// The total balance of the prepayment account for this subscription including any prior prepayments
	EndingBalanceInCents *string `json:"ending_balance_in_cents,omitempty"`
}

InvoicePrePayment represents a InvoicePrePayment struct.

func (*InvoicePrePayment) MarshalJSON

func (i *InvoicePrePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePrePayment. It customizes the JSON marshaling process for InvoicePrePayment objects.

func (*InvoicePrePayment) UnmarshalJSON

func (i *InvoicePrePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePrePayment. It customizes the JSON unmarshaling process for InvoicePrePayment objects.

type InvoicePreviousBalance

type InvoicePreviousBalance struct {
	CapturedAt *time.Time           `json:"captured_at,omitempty"`
	Invoices   []InvoiceBalanceItem `json:"invoices,omitempty"`
}

InvoicePreviousBalance represents a InvoicePreviousBalance struct.

func (*InvoicePreviousBalance) MarshalJSON

func (i *InvoicePreviousBalance) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoicePreviousBalance. It customizes the JSON marshaling process for InvoicePreviousBalance objects.

func (*InvoicePreviousBalance) UnmarshalJSON

func (i *InvoicePreviousBalance) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoicePreviousBalance. It customizes the JSON unmarshaling process for InvoicePreviousBalance objects.

type InvoiceRefund

type InvoiceRefund struct {
	TransactionId  *int    `json:"transaction_id,omitempty"`
	PaymentId      *int    `json:"payment_id,omitempty"`
	Memo           *string `json:"memo,omitempty"`
	OriginalAmount *string `json:"original_amount,omitempty"`
	AppliedAmount  *string `json:"applied_amount,omitempty"`
	// The transaction ID for the refund as returned from the payment gateway
	GatewayTransactionId Optional[string] `json:"gateway_transaction_id"`
}

InvoiceRefund represents a InvoiceRefund struct.

func (*InvoiceRefund) MarshalJSON

func (i *InvoiceRefund) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceRefund. It customizes the JSON marshaling process for InvoiceRefund objects.

func (*InvoiceRefund) UnmarshalJSON

func (i *InvoiceRefund) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceRefund. It customizes the JSON unmarshaling process for InvoiceRefund objects.

type InvoiceResponse

type InvoiceResponse struct {
	Invoice Invoice `json:"invoice"`
}

InvoiceResponse represents a InvoiceResponse struct.

func (*InvoiceResponse) MarshalJSON

func (i *InvoiceResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceResponse. It customizes the JSON marshaling process for InvoiceResponse objects.

func (*InvoiceResponse) UnmarshalJSON

func (i *InvoiceResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceResponse. It customizes the JSON unmarshaling process for InvoiceResponse objects.

type InvoiceRole added in v0.1.0

type InvoiceRole string

InvoiceRole is a string enum.

const (
	InvoiceRole_UNSET                         InvoiceRole = "unset"
	InvoiceRole_SIGNUP                        InvoiceRole = "signup"
	InvoiceRole_RENEWAL                       InvoiceRole = "renewal"
	InvoiceRole_USAGE                         InvoiceRole = "usage"
	InvoiceRole_REACTIVATION                  InvoiceRole = "reactivation"
	InvoiceRole_PRORATION                     InvoiceRole = "proration"
	InvoiceRole_MIGRATION                     InvoiceRole = "migration"
	InvoiceRole_ADHOC                         InvoiceRole = "adhoc"
	InvoiceRole_BACKPORT                      InvoiceRole = "backport"
	InvoiceRole_BACKPORTBALANCERECONCILIATION InvoiceRole = "backport-balance-reconciliation"
)

type InvoiceSeller

type InvoiceSeller struct {
	Name    *string          `json:"name,omitempty"`
	Address *InvoiceAddress  `json:"address,omitempty"`
	Phone   *string          `json:"phone,omitempty"`
	LogoUrl Optional[string] `json:"logo_url"`
}

InvoiceSeller represents a InvoiceSeller struct. Information about the seller (merchant) listed on the masthead of the invoice.

func (*InvoiceSeller) MarshalJSON

func (i *InvoiceSeller) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceSeller. It customizes the JSON marshaling process for InvoiceSeller objects.

func (*InvoiceSeller) UnmarshalJSON

func (i *InvoiceSeller) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceSeller. It customizes the JSON unmarshaling process for InvoiceSeller objects.

type InvoiceSortField

type InvoiceSortField string

InvoiceSortField is a string enum.

const (
	InvoiceSortField_STATUS      InvoiceSortField = "status"
	InvoiceSortField_TOTALAMOUNT InvoiceSortField = "total_amount"
	InvoiceSortField_DUEAMOUNT   InvoiceSortField = "due_amount"
	InvoiceSortField_CREATEDAT   InvoiceSortField = "created_at"
	InvoiceSortField_UPDATEDAT   InvoiceSortField = "updated_at"
	InvoiceSortField_ISSUEDATE   InvoiceSortField = "issue_date"
	InvoiceSortField_DUEDATE     InvoiceSortField = "due_date"
	InvoiceSortField_NUMBER      InvoiceSortField = "number"
)

type InvoiceStatus

type InvoiceStatus string

InvoiceStatus is a string enum. The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more.

const (
	InvoiceStatus_DRAFT    InvoiceStatus = "draft"
	InvoiceStatus_OPEN     InvoiceStatus = "open"
	InvoiceStatus_PAID     InvoiceStatus = "paid"
	InvoiceStatus_PENDING  InvoiceStatus = "pending"
	InvoiceStatus_VOIDED   InvoiceStatus = "voided"
	InvoiceStatus_CANCELED InvoiceStatus = "canceled"
)

type InvoiceTax

type InvoiceTax struct {
	Uid                   *string                       `json:"uid,omitempty"`
	Title                 *string                       `json:"title,omitempty"`
	Description           Optional[string]              `json:"description"`
	SourceType            *string                       `json:"source_type,omitempty"`
	SourceId              *int                          `json:"source_id,omitempty"`
	Percentage            *string                       `json:"percentage,omitempty"`
	TaxableAmount         *string                       `json:"taxable_amount,omitempty"`
	TaxAmount             *string                       `json:"tax_amount,omitempty"`
	TransactionId         *int                          `json:"transaction_id,omitempty"`
	LineItemBreakouts     []InvoiceTaxBreakout          `json:"line_item_breakouts,omitempty"`
	TaxComponentBreakouts []InvoiceTaxComponentBreakout `json:"tax_component_breakouts,omitempty"`
}

InvoiceTax represents a InvoiceTax struct.

func (*InvoiceTax) MarshalJSON

func (i *InvoiceTax) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceTax. It customizes the JSON marshaling process for InvoiceTax objects.

func (*InvoiceTax) UnmarshalJSON

func (i *InvoiceTax) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTax. It customizes the JSON unmarshaling process for InvoiceTax objects.

type InvoiceTaxBreakout

type InvoiceTaxBreakout struct {
	Uid           *string `json:"uid,omitempty"`
	TaxableAmount *string `json:"taxable_amount,omitempty"`
	TaxAmount     *string `json:"tax_amount,omitempty"`
}

InvoiceTaxBreakout represents a InvoiceTaxBreakout struct.

func (*InvoiceTaxBreakout) MarshalJSON

func (i *InvoiceTaxBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceTaxBreakout. It customizes the JSON marshaling process for InvoiceTaxBreakout objects.

func (*InvoiceTaxBreakout) UnmarshalJSON

func (i *InvoiceTaxBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxBreakout. It customizes the JSON unmarshaling process for InvoiceTaxBreakout objects.

type InvoiceTaxComponentBreakout

type InvoiceTaxComponentBreakout struct {
	TaxRuleId       *int    `json:"tax_rule_id,omitempty"`
	Percentage      *string `json:"percentage,omitempty"`
	CountryCode     *string `json:"country_code,omitempty"`
	SubdivisionCode *string `json:"subdivision_code,omitempty"`
}

InvoiceTaxComponentBreakout represents a InvoiceTaxComponentBreakout struct.

func (*InvoiceTaxComponentBreakout) MarshalJSON

func (i *InvoiceTaxComponentBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for InvoiceTaxComponentBreakout. It customizes the JSON marshaling process for InvoiceTaxComponentBreakout objects.

func (*InvoiceTaxComponentBreakout) UnmarshalJSON

func (i *InvoiceTaxComponentBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for InvoiceTaxComponentBreakout. It customizes the JSON unmarshaling process for InvoiceTaxComponentBreakout objects.

type IssueAdvanceInvoiceRequest

type IssueAdvanceInvoiceRequest struct {
	Force *bool `json:"force,omitempty"`
}

IssueAdvanceInvoiceRequest represents a IssueAdvanceInvoiceRequest struct.

func (*IssueAdvanceInvoiceRequest) MarshalJSON

func (i *IssueAdvanceInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for IssueAdvanceInvoiceRequest. It customizes the JSON marshaling process for IssueAdvanceInvoiceRequest objects.

func (*IssueAdvanceInvoiceRequest) UnmarshalJSON

func (i *IssueAdvanceInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IssueAdvanceInvoiceRequest. It customizes the JSON unmarshaling process for IssueAdvanceInvoiceRequest objects.

type IssueInvoiceRequest

type IssueInvoiceRequest struct {
	// Action taken when payment for an invoice fails:
	// - `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
	// - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
	// - `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will  most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).
	OnFailedPayment *FailedPaymentAction `json:"on_failed_payment,omitempty"`
}

IssueInvoiceRequest represents a IssueInvoiceRequest struct.

func (*IssueInvoiceRequest) MarshalJSON

func (i *IssueInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for IssueInvoiceRequest. It customizes the JSON marshaling process for IssueInvoiceRequest objects.

func (*IssueInvoiceRequest) UnmarshalJSON

func (i *IssueInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IssueInvoiceRequest. It customizes the JSON unmarshaling process for IssueInvoiceRequest objects.

type IssueServiceCredit

type IssueServiceCredit struct {
	Amount interface{} `json:"amount"`
	Memo   string      `json:"memo"`
}

IssueServiceCredit represents a IssueServiceCredit struct.

func (*IssueServiceCredit) MarshalJSON

func (i *IssueServiceCredit) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for IssueServiceCredit. It customizes the JSON marshaling process for IssueServiceCredit objects.

func (*IssueServiceCredit) UnmarshalJSON

func (i *IssueServiceCredit) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCredit. It customizes the JSON unmarshaling process for IssueServiceCredit objects.

type IssueServiceCreditRequest

type IssueServiceCreditRequest struct {
	ServiceCredit IssueServiceCredit `json:"service_credit"`
}

IssueServiceCreditRequest represents a IssueServiceCreditRequest struct.

func (*IssueServiceCreditRequest) MarshalJSON

func (i *IssueServiceCreditRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for IssueServiceCreditRequest. It customizes the JSON marshaling process for IssueServiceCreditRequest objects.

func (*IssueServiceCreditRequest) UnmarshalJSON

func (i *IssueServiceCreditRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for IssueServiceCreditRequest. It customizes the JSON unmarshaling process for IssueServiceCreditRequest objects.

type ItemCategory

type ItemCategory string

ItemCategory is a string enum. One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other

const (
	ItemCategory_ENUMBUSINESSSOFTWARE ItemCategory = "Business Software"
	ItemCategory_ENUMCONSUMERSOFTWARE ItemCategory = "Consumer Software"
	ItemCategory_ENUMDIGITALSERVICES  ItemCategory = "Digital Services"
	ItemCategory_ENUMPHYSICALGOODS    ItemCategory = "Physical Goods"
	ItemCategory_OTHER                ItemCategory = "Other"
)

type LineItemKind

type LineItemKind string

LineItemKind is a string enum. A handle for the line item kind

const (
	LineItemKind_BASELINE               LineItemKind = "baseline"
	LineItemKind_INITIAL                LineItemKind = "initial"
	LineItemKind_TRIAL                  LineItemKind = "trial"
	LineItemKind_QUANTITYBASEDCOMPONENT LineItemKind = "quantity_based_component"
	LineItemKind_PREPAIDUSAGECOMPONENT  LineItemKind = "prepaid_usage_component"
	LineItemKind_ONOFFCOMPONENT         LineItemKind = "on_off_component"
	LineItemKind_METEREDCOMPONENT       LineItemKind = "metered_component"
	LineItemKind_EVENTBASEDCOMPONENT    LineItemKind = "event_based_component"
	LineItemKind_COUPON                 LineItemKind = "coupon"
	LineItemKind_TAX                    LineItemKind = "tax"
)

type LineItemTransactionType

type LineItemTransactionType string

LineItemTransactionType is a string enum. A handle for the line item transaction type

const (
	LineItemTransactionType_CHARGE               LineItemTransactionType = "charge"
	LineItemTransactionType_CREDIT               LineItemTransactionType = "credit"
	LineItemTransactionType_ADJUSTMENT           LineItemTransactionType = "adjustment"
	LineItemTransactionType_PAYMENT              LineItemTransactionType = "payment"
	LineItemTransactionType_REFUND               LineItemTransactionType = "refund"
	LineItemTransactionType_INFOTRANSACTION      LineItemTransactionType = "info_transaction"
	LineItemTransactionType_PAYMENTAUTHORIZATION LineItemTransactionType = "payment_authorization"
)

type ListComponentsPricePointsInclude

type ListComponentsPricePointsInclude string

ListComponentsPricePointsInclude is a string enum.

const (
	ListComponentsPricePointsInclude_CURRENCYPRICES ListComponentsPricePointsInclude = "currency_prices"
)

type ListComponentsPricePointsResponse

type ListComponentsPricePointsResponse struct {
	PricePoints []ComponentPricePoint `json:"price_points"`
}

ListComponentsPricePointsResponse represents a ListComponentsPricePointsResponse struct.

func (*ListComponentsPricePointsResponse) MarshalJSON

func (l *ListComponentsPricePointsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListComponentsPricePointsResponse. It customizes the JSON marshaling process for ListComponentsPricePointsResponse objects.

func (*ListComponentsPricePointsResponse) UnmarshalJSON

func (l *ListComponentsPricePointsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListComponentsPricePointsResponse. It customizes the JSON unmarshaling process for ListComponentsPricePointsResponse objects.

type ListCreditNotesResponse

type ListCreditNotesResponse struct {
	CreditNotes []CreditNote `json:"credit_notes"`
}

ListCreditNotesResponse represents a ListCreditNotesResponse struct.

func (*ListCreditNotesResponse) MarshalJSON

func (l *ListCreditNotesResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListCreditNotesResponse. It customizes the JSON marshaling process for ListCreditNotesResponse objects.

func (*ListCreditNotesResponse) UnmarshalJSON

func (l *ListCreditNotesResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListCreditNotesResponse. It customizes the JSON unmarshaling process for ListCreditNotesResponse objects.

type ListEventsDateField

type ListEventsDateField string

ListEventsDateField is a string enum.

const (
	ListEventsDateField_CREATEDAT ListEventsDateField = "created_at"
)

type ListInvoiceEventsResponse

type ListInvoiceEventsResponse struct {
	Events     []InvoiceEvent `json:"events,omitempty"`
	Page       *int           `json:"page,omitempty"`
	PerPage    *int           `json:"per_page,omitempty"`
	TotalPages *int           `json:"total_pages,omitempty"`
}

ListInvoiceEventsResponse represents a ListInvoiceEventsResponse struct.

func (*ListInvoiceEventsResponse) MarshalJSON

func (l *ListInvoiceEventsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListInvoiceEventsResponse. It customizes the JSON marshaling process for ListInvoiceEventsResponse objects.

func (*ListInvoiceEventsResponse) UnmarshalJSON

func (l *ListInvoiceEventsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListInvoiceEventsResponse. It customizes the JSON unmarshaling process for ListInvoiceEventsResponse objects.

type ListInvoicesResponse

type ListInvoicesResponse struct {
	Invoices []Invoice `json:"invoices"`
}

ListInvoicesResponse represents a ListInvoicesResponse struct.

func (*ListInvoicesResponse) MarshalJSON

func (l *ListInvoicesResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListInvoicesResponse. It customizes the JSON marshaling process for ListInvoicesResponse objects.

func (*ListInvoicesResponse) UnmarshalJSON

func (l *ListInvoicesResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListInvoicesResponse. It customizes the JSON unmarshaling process for ListInvoicesResponse objects.

type ListMRRResponse

type ListMRRResponse struct {
	Mrr ListMRRResponseResult `json:"mrr"`
}

ListMRRResponse represents a ListMRRResponse struct.

func (*ListMRRResponse) MarshalJSON

func (l *ListMRRResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListMRRResponse. It customizes the JSON marshaling process for ListMRRResponse objects.

func (*ListMRRResponse) UnmarshalJSON

func (l *ListMRRResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponse. It customizes the JSON unmarshaling process for ListMRRResponse objects.

type ListMRRResponseResult

type ListMRRResponseResult struct {
	Page           *int       `json:"page,omitempty"`
	PerPage        *int       `json:"per_page,omitempty"`
	TotalPages     *int       `json:"total_pages,omitempty"`
	TotalEntries   *int       `json:"total_entries,omitempty"`
	Currency       *string    `json:"currency,omitempty"`
	CurrencySymbol *string    `json:"currency_symbol,omitempty"`
	Movements      []Movement `json:"movements,omitempty"`
}

ListMRRResponseResult represents a ListMRRResponseResult struct.

func (*ListMRRResponseResult) MarshalJSON

func (l *ListMRRResponseResult) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListMRRResponseResult. It customizes the JSON marshaling process for ListMRRResponseResult objects.

func (*ListMRRResponseResult) UnmarshalJSON

func (l *ListMRRResponseResult) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListMRRResponseResult. It customizes the JSON unmarshaling process for ListMRRResponseResult objects.

type ListMetafieldsResponse

type ListMetafieldsResponse struct {
	TotalCount  *int        `json:"total_count,omitempty"`
	CurrentPage *int        `json:"current_page,omitempty"`
	TotalPages  *int        `json:"total_pages,omitempty"`
	PerPage     *int        `json:"per_page,omitempty"`
	Metafields  []Metafield `json:"metafields,omitempty"`
}

ListMetafieldsResponse represents a ListMetafieldsResponse struct.

func (*ListMetafieldsResponse) MarshalJSON

func (l *ListMetafieldsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListMetafieldsResponse. It customizes the JSON marshaling process for ListMetafieldsResponse objects.

func (*ListMetafieldsResponse) UnmarshalJSON

func (l *ListMetafieldsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListMetafieldsResponse. It customizes the JSON unmarshaling process for ListMetafieldsResponse objects.

type ListOffersResponse

type ListOffersResponse struct {
	Offers []Offer `json:"offers,omitempty"`
}

ListOffersResponse represents a ListOffersResponse struct.

func (*ListOffersResponse) MarshalJSON

func (l *ListOffersResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListOffersResponse. It customizes the JSON marshaling process for ListOffersResponse objects.

func (*ListOffersResponse) UnmarshalJSON

func (l *ListOffersResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListOffersResponse. It customizes the JSON unmarshaling process for ListOffersResponse objects.

type ListProductPricePointsResponse

type ListProductPricePointsResponse struct {
	PricePoints []ProductPricePoint `json:"price_points"`
}

ListProductPricePointsResponse represents a ListProductPricePointsResponse struct.

func (*ListProductPricePointsResponse) MarshalJSON

func (l *ListProductPricePointsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListProductPricePointsResponse. It customizes the JSON marshaling process for ListProductPricePointsResponse objects.

func (*ListProductPricePointsResponse) UnmarshalJSON

func (l *ListProductPricePointsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListProductPricePointsResponse. It customizes the JSON unmarshaling process for ListProductPricePointsResponse objects.

type ListProductsInclude

type ListProductsInclude string

ListProductsInclude is a string enum.

const (
	ListProductsInclude_PREPAIDPRODUCTPRICEPOINT ListProductsInclude = "prepaid_product_price_point"
)

type ListProductsPricePointsInclude

type ListProductsPricePointsInclude string

ListProductsPricePointsInclude is a string enum.

const (
	ListProductsPricePointsInclude_CURRENCYPRICES ListProductsPricePointsInclude = "currency_prices"
)

type ListPublicKeysMeta

type ListPublicKeysMeta struct {
	TotalCount  *int `json:"total_count,omitempty"`
	CurrentPage *int `json:"current_page,omitempty"`
	TotalPages  *int `json:"total_pages,omitempty"`
	PerPage     *int `json:"per_page,omitempty"`
}

ListPublicKeysMeta represents a ListPublicKeysMeta struct.

func (*ListPublicKeysMeta) MarshalJSON

func (l *ListPublicKeysMeta) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListPublicKeysMeta. It customizes the JSON marshaling process for ListPublicKeysMeta objects.

func (*ListPublicKeysMeta) UnmarshalJSON

func (l *ListPublicKeysMeta) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysMeta. It customizes the JSON unmarshaling process for ListPublicKeysMeta objects.

type ListPublicKeysResponse

type ListPublicKeysResponse struct {
	ChargifyJsKeys []PublicKey         `json:"chargify_js_keys,omitempty"`
	Meta           *ListPublicKeysMeta `json:"meta,omitempty"`
}

ListPublicKeysResponse represents a ListPublicKeysResponse struct.

func (*ListPublicKeysResponse) MarshalJSON

func (l *ListPublicKeysResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListPublicKeysResponse. It customizes the JSON marshaling process for ListPublicKeysResponse objects.

func (*ListPublicKeysResponse) UnmarshalJSON

func (l *ListPublicKeysResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListPublicKeysResponse. It customizes the JSON unmarshaling process for ListPublicKeysResponse objects.

type ListSaleRepItem

type ListSaleRepItem struct {
	Id                 *int                      `json:"id,omitempty"`
	FullName           *string                   `json:"full_name,omitempty"`
	SubscriptionsCount *int                      `json:"subscriptions_count,omitempty"`
	MrrData            map[string]SaleRepItemMrr `json:"mrr_data,omitempty"`
	TestMode           *bool                     `json:"test_mode,omitempty"`
}

ListSaleRepItem represents a ListSaleRepItem struct.

func (*ListSaleRepItem) MarshalJSON

func (l *ListSaleRepItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSaleRepItem. It customizes the JSON marshaling process for ListSaleRepItem objects.

func (*ListSaleRepItem) UnmarshalJSON

func (l *ListSaleRepItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSaleRepItem. It customizes the JSON unmarshaling process for ListSaleRepItem objects.

type ListSegmentsResponse

type ListSegmentsResponse struct {
	Segments []Segment `json:"segments,omitempty"`
}

ListSegmentsResponse represents a ListSegmentsResponse struct.

func (*ListSegmentsResponse) MarshalJSON

func (l *ListSegmentsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSegmentsResponse. It customizes the JSON marshaling process for ListSegmentsResponse objects.

func (*ListSegmentsResponse) UnmarshalJSON

func (l *ListSegmentsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSegmentsResponse. It customizes the JSON unmarshaling process for ListSegmentsResponse objects.

type ListSubcriptionGroupPrepaymentItem

type ListSubcriptionGroupPrepaymentItem struct {
	Id                     *int    `json:"id,omitempty"`
	SubscriptionGroupUid   *string `json:"subscription_group_uid,omitempty"`
	AmountInCents          *int64  `json:"amount_in_cents,omitempty"`
	RemainingAmountInCents *int64  `json:"remaining_amount_in_cents,omitempty"`
	Details                *string `json:"details,omitempty"`
	External               *bool   `json:"external,omitempty"`
	Memo                   *string `json:"memo,omitempty"`
	// :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions.
	PaymentType *PrepaymentMethod `json:"payment_type,omitempty"`
	CreatedAt   *string           `json:"created_at,omitempty"`
}

ListSubcriptionGroupPrepaymentItem represents a ListSubcriptionGroupPrepaymentItem struct.

func (*ListSubcriptionGroupPrepaymentItem) MarshalJSON

func (l *ListSubcriptionGroupPrepaymentItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubcriptionGroupPrepaymentItem. It customizes the JSON marshaling process for ListSubcriptionGroupPrepaymentItem objects.

func (*ListSubcriptionGroupPrepaymentItem) UnmarshalJSON

func (l *ListSubcriptionGroupPrepaymentItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubcriptionGroupPrepaymentItem. It customizes the JSON unmarshaling process for ListSubcriptionGroupPrepaymentItem objects.

type ListSubscriptionComponentsInclude

type ListSubscriptionComponentsInclude string

ListSubscriptionComponentsInclude is a string enum.

const (
	ListSubscriptionComponentsInclude_SUBSCRIPTION ListSubscriptionComponentsInclude = "subscription"
)

type ListSubscriptionComponentsResponse

type ListSubscriptionComponentsResponse struct {
	SubscriptionsComponents []SubscriptionComponent `json:"subscriptions_components"`
}

ListSubscriptionComponentsResponse represents a ListSubscriptionComponentsResponse struct.

func (*ListSubscriptionComponentsResponse) MarshalJSON

func (l *ListSubscriptionComponentsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionComponentsResponse. It customizes the JSON marshaling process for ListSubscriptionComponentsResponse objects.

func (*ListSubscriptionComponentsResponse) UnmarshalJSON

func (l *ListSubscriptionComponentsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionComponentsResponse. It customizes the JSON unmarshaling process for ListSubscriptionComponentsResponse objects.

type ListSubscriptionComponentsSort

type ListSubscriptionComponentsSort string

ListSubscriptionComponentsSort is a string enum.

const (
	ListSubscriptionComponentsSort_ID        ListSubscriptionComponentsSort = "id"
	ListSubscriptionComponentsSort_UPDATEDAT ListSubscriptionComponentsSort = "updated_at"
)

type ListSubscriptionGroupPrepayment

type ListSubscriptionGroupPrepayment struct {
	Prepayment ListSubcriptionGroupPrepaymentItem `json:"prepayment"`
}

ListSubscriptionGroupPrepayment represents a ListSubscriptionGroupPrepayment struct.

func (*ListSubscriptionGroupPrepayment) MarshalJSON

func (l *ListSubscriptionGroupPrepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepayment. It customizes the JSON marshaling process for ListSubscriptionGroupPrepayment objects.

func (*ListSubscriptionGroupPrepayment) UnmarshalJSON

func (l *ListSubscriptionGroupPrepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepayment. It customizes the JSON unmarshaling process for ListSubscriptionGroupPrepayment objects.

type ListSubscriptionGroupPrepaymentDateField

type ListSubscriptionGroupPrepaymentDateField string

ListSubscriptionGroupPrepaymentDateField is a string enum.

const (
	ListSubscriptionGroupPrepaymentDateField_CREATEDAT     ListSubscriptionGroupPrepaymentDateField = "created_at"
	ListSubscriptionGroupPrepaymentDateField_APPLICATIONAT ListSubscriptionGroupPrepaymentDateField = "application_at"
)

type ListSubscriptionGroupPrepaymentResponse

type ListSubscriptionGroupPrepaymentResponse struct {
	Prepayments []ListSubscriptionGroupPrepayment `json:"prepayments"`
}

ListSubscriptionGroupPrepaymentResponse represents a ListSubscriptionGroupPrepaymentResponse struct.

func (*ListSubscriptionGroupPrepaymentResponse) MarshalJSON

func (l *ListSubscriptionGroupPrepaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupPrepaymentResponse. It customizes the JSON marshaling process for ListSubscriptionGroupPrepaymentResponse objects.

func (*ListSubscriptionGroupPrepaymentResponse) UnmarshalJSON

func (l *ListSubscriptionGroupPrepaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupPrepaymentResponse. It customizes the JSON unmarshaling process for ListSubscriptionGroupPrepaymentResponse objects.

type ListSubscriptionGroupsItem

type ListSubscriptionGroupsItem struct {
	Uid                   *string                    `json:"uid,omitempty"`
	Scheme                *int                       `json:"scheme,omitempty"`
	CustomerId            *int                       `json:"customer_id,omitempty"`
	PaymentProfileId      *int                       `json:"payment_profile_id,omitempty"`
	SubscriptionIds       []int                      `json:"subscription_ids,omitempty"`
	PrimarySubscriptionId *int                       `json:"primary_subscription_id,omitempty"`
	NextAssessmentAt      *string                    `json:"next_assessment_at,omitempty"`
	State                 *string                    `json:"state,omitempty"`
	CancelAtEndOfPeriod   *bool                      `json:"cancel_at_end_of_period,omitempty"`
	AccountBalances       *SubscriptionGroupBalances `json:"account_balances,omitempty"`
}

ListSubscriptionGroupsItem represents a ListSubscriptionGroupsItem struct.

func (*ListSubscriptionGroupsItem) MarshalJSON

func (l *ListSubscriptionGroupsItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsItem. It customizes the JSON marshaling process for ListSubscriptionGroupsItem objects.

func (*ListSubscriptionGroupsItem) UnmarshalJSON

func (l *ListSubscriptionGroupsItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsItem. It customizes the JSON unmarshaling process for ListSubscriptionGroupsItem objects.

type ListSubscriptionGroupsMeta

type ListSubscriptionGroupsMeta struct {
	CurrentPage *int `json:"current_page,omitempty"`
	TotalCount  *int `json:"total_count,omitempty"`
}

ListSubscriptionGroupsMeta represents a ListSubscriptionGroupsMeta struct.

func (*ListSubscriptionGroupsMeta) MarshalJSON

func (l *ListSubscriptionGroupsMeta) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsMeta. It customizes the JSON marshaling process for ListSubscriptionGroupsMeta objects.

func (*ListSubscriptionGroupsMeta) UnmarshalJSON

func (l *ListSubscriptionGroupsMeta) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsMeta. It customizes the JSON unmarshaling process for ListSubscriptionGroupsMeta objects.

type ListSubscriptionGroupsResponse

type ListSubscriptionGroupsResponse struct {
	SubscriptionGroups []ListSubscriptionGroupsItem `json:"subscription_groups,omitempty"`
	Meta               *ListSubscriptionGroupsMeta  `json:"meta,omitempty"`
}

ListSubscriptionGroupsResponse represents a ListSubscriptionGroupsResponse struct.

func (*ListSubscriptionGroupsResponse) MarshalJSON

func (l *ListSubscriptionGroupsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ListSubscriptionGroupsResponse. It customizes the JSON marshaling process for ListSubscriptionGroupsResponse objects.

func (*ListSubscriptionGroupsResponse) UnmarshalJSON

func (l *ListSubscriptionGroupsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ListSubscriptionGroupsResponse. It customizes the JSON unmarshaling process for ListSubscriptionGroupsResponse objects.

type MRR

type MRR struct {
	AmountInCents   *int64     `json:"amount_in_cents,omitempty"`
	AmountFormatted *string    `json:"amount_formatted,omitempty"`
	Currency        *string    `json:"currency,omitempty"`
	CurrencySymbol  *string    `json:"currency_symbol,omitempty"`
	Breakouts       *Breakouts `json:"breakouts,omitempty"`
	// ISO8601 timestamp
	AtTime *string `json:"at_time,omitempty"`
}

MRR represents a MRR struct.

func (*MRR) MarshalJSON

func (m *MRR) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MRR. It customizes the JSON marshaling process for MRR objects.

func (*MRR) UnmarshalJSON

func (m *MRR) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MRR. It customizes the JSON unmarshaling process for MRR objects.

type MRRMovement

type MRRMovement struct {
	Amount          *int    `json:"amount,omitempty"`
	Category        *string `json:"category,omitempty"`
	SubscriberDelta *int    `json:"subscriber_delta,omitempty"`
	LeadDelta       *int    `json:"lead_delta,omitempty"`
}

MRRMovement represents a MRRMovement struct.

func (*MRRMovement) MarshalJSON

func (m *MRRMovement) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MRRMovement. It customizes the JSON marshaling process for MRRMovement objects.

func (*MRRMovement) UnmarshalJSON

func (m *MRRMovement) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MRRMovement. It customizes the JSON unmarshaling process for MRRMovement objects.

type MRRResponse

type MRRResponse struct {
	Mrr MRR `json:"mrr"`
}

MRRResponse represents a MRRResponse struct.

func (*MRRResponse) MarshalJSON

func (m *MRRResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MRRResponse. It customizes the JSON marshaling process for MRRResponse objects.

func (*MRRResponse) UnmarshalJSON

func (m *MRRResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MRRResponse. It customizes the JSON unmarshaling process for MRRResponse objects.

type Metadata

type Metadata struct {
	Id          Optional[int]    `json:"id"`
	Value       Optional[string] `json:"value"`
	ResourceId  Optional[int]    `json:"resource_id"`
	Name        *string          `json:"name,omitempty"`
	DeletedAt   Optional[string] `json:"deleted_at"`
	MetafieldId Optional[int]    `json:"metafield_id"`
}

Metadata represents a Metadata struct.

func (*Metadata) MarshalJSON

func (m *Metadata) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Metadata. It customizes the JSON marshaling process for Metadata objects.

func (*Metadata) UnmarshalJSON

func (m *Metadata) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Metadata. It customizes the JSON unmarshaling process for Metadata objects.

type Metafield

type Metafield struct {
	Id   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
	// Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings.
	Scope *MetafieldScope `json:"scope,omitempty"`
	// the amount of subscriptions this metafield has been applied to in Chargify
	DataCount *int `json:"data_count,omitempty"`
	// Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text'
	InputType *MetafieldInput       `json:"input_type,omitempty"`
	Enum      Optional[interface{}] `json:"enum"`
}

Metafield represents a Metafield struct.

func (*Metafield) MarshalJSON

func (m *Metafield) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Metafield. It customizes the JSON marshaling process for Metafield objects.

func (*Metafield) UnmarshalJSON

func (m *Metafield) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Metafield. It customizes the JSON unmarshaling process for Metafield objects.

type MetafieldInput added in v0.1.0

type MetafieldInput string

MetafieldInput is a string enum. Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to 'text'

const (
	MetafieldInput_BALANCETRACKER MetafieldInput = "balance_tracker"
	MetafieldInput_TEXT           MetafieldInput = "text"
	MetafieldInput_RADIO          MetafieldInput = "radio"
	MetafieldInput_DROPDOWN       MetafieldInput = "dropdown"
)

type MetafieldScope

type MetafieldScope struct {
	// Include (1) or exclude (0) metafields from the csv export.
	Csv *IncludeOption `json:"csv,omitempty"`
	// Include (1) or exclude (0) metafields from invoices.
	Invoices *IncludeOption `json:"invoices,omitempty"`
	// Include (1) or exclude (0) metafields from statements.
	Statements *IncludeOption `json:"statements,omitempty"`
	// Include (1) or exclude (0) metafields from the portal.
	Portal *IncludeOption `json:"portal,omitempty"`
	// Include (1) or exclude (0) metafields from being viewable by your ecosystem.
	PublicShow *IncludeOption `json:"public_show,omitempty"`
	// Include (1) or exclude (0) metafields from being edited by your ecosystem.
	PublicEdit *IncludeOption `json:"public_edit,omitempty"`
	Hosted     []string       `json:"hosted,omitempty"`
}

MetafieldScope represents a MetafieldScope struct. Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings.

func (*MetafieldScope) MarshalJSON

func (m *MetafieldScope) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MetafieldScope. It customizes the JSON marshaling process for MetafieldScope objects.

func (*MetafieldScope) UnmarshalJSON

func (m *MetafieldScope) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MetafieldScope. It customizes the JSON unmarshaling process for MetafieldScope objects.

type MeteredComponent added in v0.1.0

type MeteredComponent struct {
	// A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes".
	Name string `json:"name"`
	// The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item
	UnitName string `json:"unit_name"`
	// A description for the component that will be displayed to the user on the hosted signup page.
	Description *string `json:"description,omitempty"`
	// A unique identifier for your use that can be used to retrieve this component is subsequent requests.  Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
	Handle *string `json:"handle,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme `json:"pricing_scheme"`
	// (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes.
	Prices []Price `json:"prices,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]      `json:"downgrade_credit"`
	PricePoints     []ComponentPricePointItem `json:"price_points,omitempty"`
	// The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"`
	// deprecated May 2011 - use unit_price instead
	PriceInCents              *string `json:"price_in_cents,omitempty"`
	DisplayOnHostedPage       *bool   `json:"display_on_hosted_page,omitempty"`
	AllowFractionalQuantities *bool   `json:"allow_fractional_quantities,omitempty"`
	PublicSignupPageIds       []int   `json:"public_signup_page_ids,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

MeteredComponent represents a MeteredComponent struct.

func (*MeteredComponent) MarshalJSON added in v0.1.0

func (m *MeteredComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MeteredComponent. It customizes the JSON marshaling process for MeteredComponent objects.

func (*MeteredComponent) UnmarshalJSON added in v0.1.0

func (m *MeteredComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MeteredComponent. It customizes the JSON unmarshaling process for MeteredComponent objects.

type Movement

type Movement struct {
	Timestamp       *string            `json:"timestamp,omitempty"`
	AmountInCents   *int64             `json:"amount_in_cents,omitempty"`
	AmountFormatted *string            `json:"amount_formatted,omitempty"`
	Description     *string            `json:"description,omitempty"`
	Category        *string            `json:"category,omitempty"`
	Breakouts       *Breakouts         `json:"breakouts,omitempty"`
	LineItems       []MovementLineItem `json:"line_items,omitempty"`
	SubscriptionId  *int               `json:"subscription_id,omitempty"`
	SubscriberName  *string            `json:"subscriber_name,omitempty"`
}

Movement represents a Movement struct.

func (*Movement) MarshalJSON

func (m *Movement) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Movement. It customizes the JSON marshaling process for Movement objects.

func (*Movement) UnmarshalJSON

func (m *Movement) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Movement. It customizes the JSON unmarshaling process for Movement objects.

type MovementLineItem

type MovementLineItem struct {
	ProductId *int `json:"product_id,omitempty"`
	// For Product (or "baseline") line items, this field will have a value of `0`.
	ComponentId  *int          `json:"component_id,omitempty"`
	PricePointId *int          `json:"price_point_id,omitempty"`
	Name         *string       `json:"name,omitempty"`
	Mrr          *int          `json:"mrr,omitempty"`
	MrrMovements []MRRMovement `json:"mrr_movements,omitempty"`
	Quantity     *int          `json:"quantity,omitempty"`
	PrevQuantity *int          `json:"prev_quantity,omitempty"`
	// When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout.
	Recurring *bool `json:"recurring,omitempty"`
}

MovementLineItem represents a MovementLineItem struct.

func (*MovementLineItem) MarshalJSON

func (m *MovementLineItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MovementLineItem. It customizes the JSON marshaling process for MovementLineItem objects.

func (*MovementLineItem) UnmarshalJSON

func (m *MovementLineItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MovementLineItem. It customizes the JSON unmarshaling process for MovementLineItem objects.

type MultiInvoicePayment

type MultiInvoicePayment struct {
	// The numeric ID of the transaction.
	TransactionId *int `json:"transaction_id,omitempty"`
	// Dollar amount of the sum of the paid invoices.
	TotalAmount *string `json:"total_amount,omitempty"`
	// The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
	CurrencyCode *string                     `json:"currency_code,omitempty"`
	Applications []InvoicePaymentApplication `json:"applications,omitempty"`
}

MultiInvoicePayment represents a MultiInvoicePayment struct.

func (*MultiInvoicePayment) MarshalJSON

func (m *MultiInvoicePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MultiInvoicePayment. It customizes the JSON marshaling process for MultiInvoicePayment objects.

func (*MultiInvoicePayment) UnmarshalJSON

func (m *MultiInvoicePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePayment. It customizes the JSON unmarshaling process for MultiInvoicePayment objects.

type MultiInvoicePaymentResponse

type MultiInvoicePaymentResponse struct {
	Payment MultiInvoicePayment `json:"payment"`
}

MultiInvoicePaymentResponse represents a MultiInvoicePaymentResponse struct.

func (*MultiInvoicePaymentResponse) MarshalJSON

func (m *MultiInvoicePaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for MultiInvoicePaymentResponse. It customizes the JSON marshaling process for MultiInvoicePaymentResponse objects.

func (*MultiInvoicePaymentResponse) UnmarshalJSON

func (m *MultiInvoicePaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MultiInvoicePaymentResponse. It customizes the JSON unmarshaling process for MultiInvoicePaymentResponse objects.

type NestedSubscriptionGroup

type NestedSubscriptionGroup struct {
	// The UID for the group
	Uid *string `json:"uid,omitempty"`
	// Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1.
	Scheme *int `json:"scheme,omitempty"`
	// The subscription ID of the primary within the group. Applicable to scheme 1.
	PrimarySubscriptionId *int `json:"primary_subscription_id,omitempty"`
	// A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1.
	Primary *bool `json:"primary,omitempty"`
}

NestedSubscriptionGroup represents a NestedSubscriptionGroup struct.

func (*NestedSubscriptionGroup) MarshalJSON

func (n *NestedSubscriptionGroup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for NestedSubscriptionGroup. It customizes the JSON marshaling process for NestedSubscriptionGroup objects.

func (*NestedSubscriptionGroup) UnmarshalJSON

func (n *NestedSubscriptionGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for NestedSubscriptionGroup. It customizes the JSON unmarshaling process for NestedSubscriptionGroup objects.

type NetTerms

type NetTerms struct {
	DefaultNetTerms                    *int  `json:"default_net_terms,omitempty"`
	AutomaticNetTerms                  *int  `json:"automatic_net_terms,omitempty"`
	RemittanceNetTerms                 *int  `json:"remittance_net_terms,omitempty"`
	NetTermsOnRemittanceSignupsEnabled *bool `json:"net_terms_on_remittance_signups_enabled,omitempty"`
	CustomNetTermsEnabled              *bool `json:"custom_net_terms_enabled,omitempty"`
}

NetTerms represents a NetTerms struct.

func (*NetTerms) MarshalJSON

func (n *NetTerms) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for NetTerms. It customizes the JSON marshaling process for NetTerms objects.

func (*NetTerms) UnmarshalJSON

func (n *NetTerms) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for NetTerms. It customizes the JSON unmarshaling process for NetTerms objects.

type Offer

type Offer struct {
	Id                     *int              `json:"id,omitempty"`
	SiteId                 *int              `json:"site_id,omitempty"`
	ProductFamilyId        *int              `json:"product_family_id,omitempty"`
	ProductId              *int              `json:"product_id,omitempty"`
	ProductPricePointId    *int              `json:"product_price_point_id,omitempty"`
	ProductRevisableNumber *int              `json:"product_revisable_number,omitempty"`
	Name                   *string           `json:"name,omitempty"`
	Handle                 *string           `json:"handle,omitempty"`
	Description            Optional[string]  `json:"description"`
	CreatedAt              *string           `json:"created_at,omitempty"`
	UpdatedAt              *string           `json:"updated_at,omitempty"`
	ArchivedAt             Optional[string]  `json:"archived_at"`
	OfferItems             []OfferItem       `json:"offer_items,omitempty"`
	OfferDiscounts         []OfferDiscount   `json:"offer_discounts,omitempty"`
	ProductFamilyName      *string           `json:"product_family_name,omitempty"`
	ProductName            *string           `json:"product_name,omitempty"`
	ProductPricePointName  *string           `json:"product_price_point_name,omitempty"`
	ProductPriceInCents    *int64            `json:"product_price_in_cents,omitempty"`
	OfferSignupPages       []OfferSignupPage `json:"offer_signup_pages,omitempty"`
}

Offer represents a Offer struct.

func (*Offer) MarshalJSON

func (o *Offer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Offer. It customizes the JSON marshaling process for Offer objects.

func (*Offer) UnmarshalJSON

func (o *Offer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Offer. It customizes the JSON unmarshaling process for Offer objects.

type OfferDiscount

type OfferDiscount struct {
	CouponCode *string `json:"coupon_code,omitempty"`
	CouponId   *int    `json:"coupon_id,omitempty"`
	CouponName *string `json:"coupon_name,omitempty"`
}

OfferDiscount represents a OfferDiscount struct.

func (*OfferDiscount) MarshalJSON

func (o *OfferDiscount) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OfferDiscount. It customizes the JSON marshaling process for OfferDiscount objects.

func (*OfferDiscount) UnmarshalJSON

func (o *OfferDiscount) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OfferDiscount. It customizes the JSON unmarshaling process for OfferDiscount objects.

type OfferItem

type OfferItem struct {
	ComponentId        *int            `json:"component_id,omitempty"`
	PricePointId       *int            `json:"price_point_id,omitempty"`
	StartingQuantity   *string         `json:"starting_quantity,omitempty"`
	Editable           *bool           `json:"editable,omitempty"`
	ComponentUnitPrice *string         `json:"component_unit_price,omitempty"`
	ComponentName      *string         `json:"component_name,omitempty"`
	PricePointName     *string         `json:"price_point_name,omitempty"`
	CurrencyPrices     []CurrencyPrice `json:"currency_prices,omitempty"`
	// The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

OfferItem represents a OfferItem struct.

func (*OfferItem) MarshalJSON

func (o *OfferItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OfferItem. It customizes the JSON marshaling process for OfferItem objects.

func (*OfferItem) UnmarshalJSON

func (o *OfferItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OfferItem. It customizes the JSON unmarshaling process for OfferItem objects.

type OfferResponse

type OfferResponse struct {
	Offer *Offer `json:"offer,omitempty"`
}

OfferResponse represents a OfferResponse struct.

func (*OfferResponse) MarshalJSON

func (o *OfferResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OfferResponse. It customizes the JSON marshaling process for OfferResponse objects.

func (*OfferResponse) UnmarshalJSON

func (o *OfferResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OfferResponse. It customizes the JSON unmarshaling process for OfferResponse objects.

type OfferSignupPage

type OfferSignupPage struct {
	Id           *int    `json:"id,omitempty"`
	Nickname     *string `json:"nickname,omitempty"`
	Enabled      *bool   `json:"enabled,omitempty"`
	ReturnUrl    *string `json:"return_url,omitempty"`
	ReturnParams *string `json:"return_params,omitempty"`
	Url          *string `json:"url,omitempty"`
}

OfferSignupPage represents a OfferSignupPage struct.

func (*OfferSignupPage) MarshalJSON

func (o *OfferSignupPage) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OfferSignupPage. It customizes the JSON marshaling process for OfferSignupPage objects.

func (*OfferSignupPage) UnmarshalJSON

func (o *OfferSignupPage) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OfferSignupPage. It customizes the JSON unmarshaling process for OfferSignupPage objects.

type OnOffComponent added in v0.1.0

type OnOffComponent struct {
	// A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes".
	Name string `json:"name"`
	// A description for the component that will be displayed to the user on the hosted signup page.
	Description *string `json:"description,omitempty"`
	// A unique identifier for your use that can be used to retrieve this component is subsequent requests.  Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
	Handle *string `json:"handle,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes.
	Prices []Price `json:"prices,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]      `json:"downgrade_credit"`
	PricePoints     []ComponentPricePointItem `json:"price_points,omitempty"`
	// The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"`
	// deprecated May 2011 - use unit_price instead
	PriceInCents              *string `json:"price_in_cents,omitempty"`
	DisplayOnHostedPage       *bool   `json:"display_on_hosted_page,omitempty"`
	AllowFractionalQuantities *bool   `json:"allow_fractional_quantities,omitempty"`
	PublicSignupPageIds       []int   `json:"public_signup_page_ids,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

OnOffComponent represents a OnOffComponent struct.

func (*OnOffComponent) MarshalJSON added in v0.1.0

func (o *OnOffComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OnOffComponent. It customizes the JSON marshaling process for OnOffComponent objects.

func (*OnOffComponent) UnmarshalJSON added in v0.1.0

func (o *OnOffComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OnOffComponent. It customizes the JSON unmarshaling process for OnOffComponent objects.

type Optional

type Optional[T any] struct {
	types.Optional[T]
}

Optional is a generic struct that allows any type to be used as optional and nullable. Optional.set is true when Optional.value is to be used.

func NewOptional

func NewOptional[T any](value *T) Optional[T]

NewOptional creates and returns an Optional instance with the given value set.

func (*Optional[T]) IsValueSet

func (o *Optional[T]) IsValueSet() bool

IsValueSet returns true if a value is set in the Optional, false otherwise.

func (*Optional[T]) SetValue

func (o *Optional[T]) SetValue(value *T)

SetValue sets the value of the Optional.

func (*Optional[T]) ShouldSetValue

func (o *Optional[T]) ShouldSetValue(set bool)

ShouldSetValue sets whether the value should be used or not.

func (*Optional[T]) Value

func (o *Optional[T]) Value() *T

Value returns the value stored in the Optional. It returns nil if no value is set.

type OrganizationAddress

type OrganizationAddress struct {
	Street  Optional[string] `json:"street"`
	Line2   Optional[string] `json:"line2"`
	City    Optional[string] `json:"city"`
	State   Optional[string] `json:"state"`
	Zip     Optional[string] `json:"zip"`
	Country Optional[string] `json:"country"`
	Name    Optional[string] `json:"name"`
	Phone   Optional[string] `json:"phone"`
}

OrganizationAddress represents a OrganizationAddress struct.

func (*OrganizationAddress) MarshalJSON

func (o *OrganizationAddress) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OrganizationAddress. It customizes the JSON marshaling process for OrganizationAddress objects.

func (*OrganizationAddress) UnmarshalJSON

func (o *OrganizationAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OrganizationAddress. It customizes the JSON unmarshaling process for OrganizationAddress objects.

type OriginInvoice

type OriginInvoice struct {
	// The UID of the invoice serving as an origin invoice.
	Uid *string `json:"uid,omitempty"`
	// The number of the invoice serving as an origin invoice.
	Number *string `json:"number,omitempty"`
}

OriginInvoice represents a OriginInvoice struct.

func (*OriginInvoice) MarshalJSON

func (o *OriginInvoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OriginInvoice. It customizes the JSON marshaling process for OriginInvoice objects.

func (*OriginInvoice) UnmarshalJSON

func (o *OriginInvoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OriginInvoice. It customizes the JSON unmarshaling process for OriginInvoice objects.

type OveragePricing

type OveragePricing struct {
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme `json:"pricing_scheme"`
	Prices        []Price       `json:"prices,omitempty"`
}

OveragePricing represents a OveragePricing struct.

func (*OveragePricing) MarshalJSON

func (o *OveragePricing) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OveragePricing. It customizes the JSON marshaling process for OveragePricing objects.

func (*OveragePricing) UnmarshalJSON

func (o *OveragePricing) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OveragePricing. It customizes the JSON unmarshaling process for OveragePricing objects.

type OverrideSubscription

type OverrideSubscription struct {
	// Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported.
	ActivatedAt *time.Time `json:"activated_at,omitempty"`
	// Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported.
	CanceledAt *time.Time `json:"canceled_at,omitempty"`
	// Can be used to record a reason for the original cancellation.
	CancellationMessage *string `json:"cancellation_message,omitempty"`
	// Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported.
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported.
	CurrentPeriodStartsAt *time.Time `json:"current_period_starts_at,omitempty"`
}

OverrideSubscription represents a OverrideSubscription struct.

func (*OverrideSubscription) MarshalJSON

func (o *OverrideSubscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OverrideSubscription. It customizes the JSON marshaling process for OverrideSubscription objects.

func (*OverrideSubscription) UnmarshalJSON

func (o *OverrideSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscription. It customizes the JSON unmarshaling process for OverrideSubscription objects.

type OverrideSubscriptionRequest

type OverrideSubscriptionRequest struct {
	Subscription OverrideSubscription `json:"subscription"`
}

OverrideSubscriptionRequest represents a OverrideSubscriptionRequest struct.

func (*OverrideSubscriptionRequest) MarshalJSON

func (o *OverrideSubscriptionRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for OverrideSubscriptionRequest. It customizes the JSON marshaling process for OverrideSubscriptionRequest objects.

func (*OverrideSubscriptionRequest) UnmarshalJSON

func (o *OverrideSubscriptionRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for OverrideSubscriptionRequest. It customizes the JSON unmarshaling process for OverrideSubscriptionRequest objects.

type PaginatedMetadata

type PaginatedMetadata struct {
	TotalCount  *int       `json:"total_count,omitempty"`
	CurrentPage *int       `json:"current_page,omitempty"`
	TotalPages  *int       `json:"total_pages,omitempty"`
	PerPage     *int       `json:"per_page,omitempty"`
	Metadata    []Metadata `json:"metadata,omitempty"`
}

PaginatedMetadata represents a PaginatedMetadata struct.

func (*PaginatedMetadata) MarshalJSON

func (p *PaginatedMetadata) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaginatedMetadata. It customizes the JSON marshaling process for PaginatedMetadata objects.

func (*PaginatedMetadata) UnmarshalJSON

func (p *PaginatedMetadata) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaginatedMetadata. It customizes the JSON unmarshaling process for PaginatedMetadata objects.

type PauseRequest

type PauseRequest struct {
	Hold *AutoResume `json:"hold,omitempty"`
}

PauseRequest represents a PauseRequest struct. Allows to pause a Subscription

func (*PauseRequest) MarshalJSON

func (p *PauseRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PauseRequest. It customizes the JSON marshaling process for PauseRequest objects.

func (*PauseRequest) UnmarshalJSON

func (p *PauseRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PauseRequest. It customizes the JSON unmarshaling process for PauseRequest objects.

type PayerAttributes

type PayerAttributes struct {
	FirstName       *string `json:"first_name,omitempty"`
	LastName        *string `json:"last_name,omitempty"`
	Email           *string `json:"email,omitempty"`
	CcEmails        *string `json:"cc_emails,omitempty"`
	Organization    *string `json:"organization,omitempty"`
	Reference       *string `json:"reference,omitempty"`
	Address         *string `json:"address,omitempty"`
	Address2        *string `json:"address_2,omitempty"`
	City            *string `json:"city,omitempty"`
	State           *string `json:"state,omitempty"`
	Zip             *string `json:"zip,omitempty"`
	Country         *string `json:"country,omitempty"`
	Phone           *string `json:"phone,omitempty"`
	Locale          *string `json:"locale,omitempty"`
	VatNumber       *string `json:"vat_number,omitempty"`
	TaxExempt       *string `json:"tax_exempt,omitempty"`
	TaxExemptReason *string `json:"tax_exempt_reason,omitempty"`
	// (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet.
	Metafields map[string]string `json:"metafields,omitempty"`
}

PayerAttributes represents a PayerAttributes struct.

func (*PayerAttributes) MarshalJSON

func (p *PayerAttributes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PayerAttributes. It customizes the JSON marshaling process for PayerAttributes objects.

func (*PayerAttributes) UnmarshalJSON

func (p *PayerAttributes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PayerAttributes. It customizes the JSON unmarshaling process for PayerAttributes objects.

type PayerError

type PayerError struct {
	LastName  []string `json:"last_name,omitempty"`
	FirstName []string `json:"first_name,omitempty"`
	Email     []string `json:"email,omitempty"`
}

PayerError represents a PayerError struct.

func (*PayerError) MarshalJSON

func (p *PayerError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PayerError. It customizes the JSON marshaling process for PayerError objects.

func (*PayerError) UnmarshalJSON

func (p *PayerError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PayerError. It customizes the JSON unmarshaling process for PayerError objects.

type Payment

type Payment struct {
	// The uid of the paid invoice
	InvoiceUid *string `json:"invoice_uid,omitempty"`
	// The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more.
	Status *InvoiceStatus `json:"status,omitempty"`
	// The remaining due amount on the invoice
	DueAmount *string `json:"due_amount,omitempty"`
	// The total amount paid on this invoice (including any prior payments)
	PaidAmount *string `json:"paid_amount,omitempty"`
}

Payment represents a Payment struct.

func (*Payment) MarshalJSON

func (p *Payment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Payment. It customizes the JSON marshaling process for Payment objects.

func (*Payment) UnmarshalJSON

func (p *Payment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Payment. It customizes the JSON unmarshaling process for Payment objects.

type PaymentForAllocation

type PaymentForAllocation struct {
	Id            *int    `json:"id,omitempty"`
	AmountInCents *int64  `json:"amount_in_cents,omitempty"`
	Success       *bool   `json:"success,omitempty"`
	Memo          *string `json:"memo,omitempty"`
}

PaymentForAllocation represents a PaymentForAllocation struct. Information for captured payment, if applicable

func (*PaymentForAllocation) MarshalJSON

func (p *PaymentForAllocation) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentForAllocation. It customizes the JSON marshaling process for PaymentForAllocation objects.

func (*PaymentForAllocation) UnmarshalJSON

func (p *PaymentForAllocation) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentForAllocation. It customizes the JSON unmarshaling process for PaymentForAllocation objects.

type PaymentMethodApplePay added in v0.1.0

type PaymentMethodApplePay struct {
	Type InvoiceEventPaymentMethod `json:"type"`
}

PaymentMethodApplePay represents a PaymentMethodApplePay struct.

func (*PaymentMethodApplePay) MarshalJSON added in v0.1.0

func (p *PaymentMethodApplePay) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentMethodApplePay. It customizes the JSON marshaling process for PaymentMethodApplePay objects.

func (*PaymentMethodApplePay) UnmarshalJSON added in v0.1.0

func (p *PaymentMethodApplePay) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodApplePay. It customizes the JSON unmarshaling process for PaymentMethodApplePay objects.

type PaymentMethodBankAccount added in v0.1.0

type PaymentMethodBankAccount struct {
	MaskedAccountNumber string                    `json:"masked_account_number"`
	MaskedRoutingNumber string                    `json:"masked_routing_number"`
	Type                InvoiceEventPaymentMethod `json:"type"`
}

PaymentMethodBankAccount represents a PaymentMethodBankAccount struct.

func (*PaymentMethodBankAccount) MarshalJSON added in v0.1.0

func (p *PaymentMethodBankAccount) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentMethodBankAccount. It customizes the JSON marshaling process for PaymentMethodBankAccount objects.

func (*PaymentMethodBankAccount) UnmarshalJSON added in v0.1.0

func (p *PaymentMethodBankAccount) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodBankAccount. It customizes the JSON unmarshaling process for PaymentMethodBankAccount objects.

type PaymentMethodCreditCard added in v0.1.0

type PaymentMethodCreditCard struct {
	CardBrand        string                    `json:"card_brand"`
	CardExpiration   *string                   `json:"card_expiration,omitempty"`
	LastFour         Optional[string]          `json:"last_four"`
	MaskedCardNumber string                    `json:"masked_card_number"`
	Type             InvoiceEventPaymentMethod `json:"type"`
}

PaymentMethodCreditCard represents a PaymentMethodCreditCard struct.

func (*PaymentMethodCreditCard) MarshalJSON added in v0.1.0

func (p *PaymentMethodCreditCard) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentMethodCreditCard. It customizes the JSON marshaling process for PaymentMethodCreditCard objects.

func (*PaymentMethodCreditCard) UnmarshalJSON added in v0.1.0

func (p *PaymentMethodCreditCard) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodCreditCard. It customizes the JSON unmarshaling process for PaymentMethodCreditCard objects.

type PaymentMethodExternal added in v0.1.0

type PaymentMethodExternal struct {
	Details *string                   `json:"details"`
	Kind    string                    `json:"kind"`
	Memo    *string                   `json:"memo"`
	Type    InvoiceEventPaymentMethod `json:"type"`
}

PaymentMethodExternal represents a PaymentMethodExternal struct.

func (*PaymentMethodExternal) MarshalJSON added in v0.1.0

func (p *PaymentMethodExternal) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentMethodExternal. It customizes the JSON marshaling process for PaymentMethodExternal objects.

func (*PaymentMethodExternal) UnmarshalJSON added in v0.1.0

func (p *PaymentMethodExternal) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodExternal. It customizes the JSON unmarshaling process for PaymentMethodExternal objects.

type PaymentMethodPaypal added in v0.1.0

type PaymentMethodPaypal struct {
	Email string                    `json:"email"`
	Type  InvoiceEventPaymentMethod `json:"type"`
}

PaymentMethodPaypal represents a PaymentMethodPaypal struct.

func (*PaymentMethodPaypal) MarshalJSON added in v0.1.0

func (p *PaymentMethodPaypal) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentMethodPaypal. It customizes the JSON marshaling process for PaymentMethodPaypal objects.

func (*PaymentMethodPaypal) UnmarshalJSON added in v0.1.0

func (p *PaymentMethodPaypal) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentMethodPaypal. It customizes the JSON unmarshaling process for PaymentMethodPaypal objects.

type PaymentProfileAttributes

type PaymentProfileAttributes struct {
	// (Optional) Token received after sending billing informations using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
	ChargifyToken *string `json:"chargify_token,omitempty"`
	Id            *int    `json:"id,omitempty"`
	PaymentType   *string `json:"payment_type,omitempty"`
	// (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used.
	FirstName *string `json:"first_name,omitempty"`
	// (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used.
	LastName         *string `json:"last_name,omitempty"`
	MaskedCardNumber *string `json:"masked_card_number,omitempty"`
	// The full credit card number (string representation, i.e. 5424000000000015)
	FullNumber *string `json:"full_number,omitempty"`
	// (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI.
	CardType *CardType `json:"card_type,omitempty"`
	// (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5
	ExpirationMonth *interface{} `json:"expiration_month,omitempty"`
	// (Optional when performing a Subscription Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012
	ExpirationYear *interface{} `json:"expiration_year,omitempty"`
	// (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway.
	BillingAddress *string `json:"billing_address,omitempty"`
	// (Optional) Second line of the customer’s billing address i.e. Apt. 100
	BillingAddress2 Optional[string] `json:"billing_address_2"`
	// (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway.
	BillingCity *string `json:"billing_city,omitempty"`
	// (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.
	BillingState *string `json:"billing_state,omitempty"`
	// (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.
	BillingCountry *string `json:"billing_country,omitempty"`
	// (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway.
	BillingZip *string `json:"billing_zip,omitempty"`
	// (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token.
	CurrentVault *CurrentVault `json:"current_vault,omitempty"`
	// (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile
	VaultToken *string `json:"vault_token,omitempty"`
	// (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token
	CustomerVaultToken *string `json:"customer_vault_token,omitempty"`
	CustomerId         *int    `json:"customer_id,omitempty"`
	PaypalEmail        *string `json:"paypal_email,omitempty"`
	// (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm)
	PaymentMethodNonce *string `json:"payment_method_nonce,omitempty"`
	// (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed.
	GatewayHandle *string `json:"gateway_handle,omitempty"`
	// (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway.
	Cvv *string `json:"cvv,omitempty"`
	// (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net.
	LastFour *string `json:"last_four,omitempty"`
}

PaymentProfileAttributes represents a PaymentProfileAttributes struct. alias to credit_card_attributes

func (*PaymentProfileAttributes) MarshalJSON

func (p *PaymentProfileAttributes) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentProfileAttributes. It customizes the JSON marshaling process for PaymentProfileAttributes objects.

func (*PaymentProfileAttributes) UnmarshalJSON

func (p *PaymentProfileAttributes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileAttributes. It customizes the JSON unmarshaling process for PaymentProfileAttributes objects.

type PaymentProfileResponse

type PaymentProfileResponse struct {
	PaymentProfile interface{} `json:"payment_profile"`
}

PaymentProfileResponse represents a PaymentProfileResponse struct.

func (*PaymentProfileResponse) MarshalJSON

func (p *PaymentProfileResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentProfileResponse. It customizes the JSON marshaling process for PaymentProfileResponse objects.

func (*PaymentProfileResponse) UnmarshalJSON

func (p *PaymentProfileResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentProfileResponse. It customizes the JSON unmarshaling process for PaymentProfileResponse objects.

type PaymentResponse

type PaymentResponse struct {
	PaidInvoices []Payment          `json:"paid_invoices,omitempty"`
	Prepayment   *InvoicePrePayment `json:"prepayment,omitempty"`
}

PaymentResponse represents a PaymentResponse struct.

func (*PaymentResponse) MarshalJSON

func (p *PaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PaymentResponse. It customizes the JSON marshaling process for PaymentResponse objects.

func (*PaymentResponse) UnmarshalJSON

func (p *PaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PaymentResponse. It customizes the JSON unmarshaling process for PaymentResponse objects.

type PaymentType

type PaymentType string

PaymentType is a string enum.

const (
	PaymentType_CREDITCARD    PaymentType = "credit_card"
	PaymentType_BANKACCOUNT   PaymentType = "bank_account"
	PaymentType_PAYPALACCOUNT PaymentType = "paypal_account"
)
type PortalManagementLink struct {
	Url                *string          `json:"url,omitempty"`
	FetchCount         *int             `json:"fetch_count,omitempty"`
	CreatedAt          *string          `json:"created_at,omitempty"`
	NewLinkAvailableAt *string          `json:"new_link_available_at,omitempty"`
	ExpiresAt          *string          `json:"expires_at,omitempty"`
	LastInviteSentAt   Optional[string] `json:"last_invite_sent_at"`
}

PortalManagementLink represents a PortalManagementLink struct.

func (*PortalManagementLink) MarshalJSON

func (p *PortalManagementLink) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PortalManagementLink. It customizes the JSON marshaling process for PortalManagementLink objects.

func (*PortalManagementLink) UnmarshalJSON

func (p *PortalManagementLink) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PortalManagementLink. It customizes the JSON unmarshaling process for PortalManagementLink objects.

type PrepaidComponentPricePoint added in v0.1.0

type PrepaidComponentPricePoint struct {
	Name   *string `json:"name,omitempty"`
	Handle *string `json:"handle,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme  *PricingScheme  `json:"pricing_scheme,omitempty"`
	Prices         []Price         `json:"prices,omitempty"`
	OveragePricing *OveragePricing `json:"overage_pricing,omitempty"`
}

PrepaidComponentPricePoint represents a PrepaidComponentPricePoint struct.

func (*PrepaidComponentPricePoint) MarshalJSON added in v0.1.0

func (p *PrepaidComponentPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaidComponentPricePoint. It customizes the JSON marshaling process for PrepaidComponentPricePoint objects.

func (*PrepaidComponentPricePoint) UnmarshalJSON added in v0.1.0

func (p *PrepaidComponentPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaidComponentPricePoint. It customizes the JSON unmarshaling process for PrepaidComponentPricePoint objects.

type PrepaidConfiguration

type PrepaidConfiguration struct {
	Id                              *int   `json:"id,omitempty"`
	InitialFundingAmountInCents     *int64 `json:"initial_funding_amount_in_cents,omitempty"`
	ReplenishToAmountInCents        *int64 `json:"replenish_to_amount_in_cents,omitempty"`
	AutoReplenish                   *bool  `json:"auto_replenish,omitempty"`
	ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"`
}

PrepaidConfiguration represents a PrepaidConfiguration struct.

func (*PrepaidConfiguration) MarshalJSON

func (p *PrepaidConfiguration) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaidConfiguration. It customizes the JSON marshaling process for PrepaidConfiguration objects.

func (*PrepaidConfiguration) UnmarshalJSON

func (p *PrepaidConfiguration) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfiguration. It customizes the JSON unmarshaling process for PrepaidConfiguration objects.

type PrepaidConfigurationResponse

type PrepaidConfigurationResponse struct {
	PrepaidConfiguration PrepaidConfiguration `json:"prepaid_configuration"`
}

PrepaidConfigurationResponse represents a PrepaidConfigurationResponse struct.

func (*PrepaidConfigurationResponse) MarshalJSON

func (p *PrepaidConfigurationResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaidConfigurationResponse. It customizes the JSON marshaling process for PrepaidConfigurationResponse objects.

func (*PrepaidConfigurationResponse) UnmarshalJSON

func (p *PrepaidConfigurationResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaidConfigurationResponse. It customizes the JSON unmarshaling process for PrepaidConfigurationResponse objects.

type PrepaidUsageComponent added in v0.1.0

type PrepaidUsageComponent struct {
	// A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes".
	Name string `json:"name"`
	// The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item
	UnitName *string `json:"unit_name,omitempty"`
	// A description for the component that will be displayed to the user on the hosted signup page.
	Description *string `json:"description,omitempty"`
	// A unique identifier for your use that can be used to retrieve this component is subsequent requests.  Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
	Handle *string `json:"handle,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"`
	// (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes.
	Prices []Price `json:"prices,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]         `json:"downgrade_credit"`
	PricePoints     []PrepaidComponentPricePoint `json:"price_points,omitempty"`
	// The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"`
	// deprecated May 2011 - use unit_price instead
	PriceInCents   *string         `json:"price_in_cents,omitempty"`
	OveragePricing *OveragePricing `json:"overage_pricing,omitempty"`
	// Boolean which controls whether or not remaining units should be rolled over to the next period
	RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"`
	// Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period
	RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"`
	// (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire
	ExpirationInterval        *float64      `json:"expiration_interval,omitempty"`
	ExpirationIntervalUnit    *IntervalUnit `json:"expiration_interval_unit,omitempty"`
	DisplayOnHostedPage       *bool         `json:"display_on_hosted_page,omitempty"`
	AllowFractionalQuantities *bool         `json:"allow_fractional_quantities,omitempty"`
	PublicSignupPageIds       []int         `json:"public_signup_page_ids,omitempty"`
}

PrepaidUsageComponent represents a PrepaidUsageComponent struct.

func (*PrepaidUsageComponent) MarshalJSON added in v0.1.0

func (p *PrepaidUsageComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaidUsageComponent. It customizes the JSON marshaling process for PrepaidUsageComponent objects.

func (*PrepaidUsageComponent) UnmarshalJSON added in v0.1.0

func (p *PrepaidUsageComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaidUsageComponent. It customizes the JSON unmarshaling process for PrepaidUsageComponent objects.

type Prepayment

type Prepayment struct {
	Id                     int     `json:"id"`
	SubscriptionId         int     `json:"subscription_id"`
	AmountInCents          int64   `json:"amount_in_cents"`
	RemainingAmountInCents int64   `json:"remaining_amount_in_cents"`
	RefundedAmountInCents  *int64  `json:"refunded_amount_in_cents,omitempty"`
	Details                *string `json:"details,omitempty"`
	External               bool    `json:"external"`
	Memo                   string  `json:"memo"`
	// The payment type of the prepayment.
	PaymentType *PrepaymentMethod `json:"payment_type,omitempty"`
	CreatedAt   string            `json:"created_at"`
}

Prepayment represents a Prepayment struct.

func (*Prepayment) MarshalJSON

func (p *Prepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Prepayment. It customizes the JSON marshaling process for Prepayment objects.

func (*Prepayment) UnmarshalJSON

func (p *Prepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Prepayment. It customizes the JSON unmarshaling process for Prepayment objects.

type PrepaymentAggregatedError

type PrepaymentAggregatedError struct {
	AmountInCents []string `json:"amount_in_cents,omitempty"`
	Base          []string `json:"base,omitempty"`
	External      []string `json:"external,omitempty"`
}

PrepaymentAggregatedError represents a PrepaymentAggregatedError struct.

func (*PrepaymentAggregatedError) MarshalJSON

func (p *PrepaymentAggregatedError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaymentAggregatedError. It customizes the JSON marshaling process for PrepaymentAggregatedError objects.

func (*PrepaymentAggregatedError) UnmarshalJSON

func (p *PrepaymentAggregatedError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentAggregatedError. It customizes the JSON unmarshaling process for PrepaymentAggregatedError objects.

type PrepaymentMethod

type PrepaymentMethod string

PrepaymentMethod is a string enum. :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions.

const (
	PrepaymentMethod_CHECK            PrepaymentMethod = "check"
	PrepaymentMethod_CASH             PrepaymentMethod = "cash"
	PrepaymentMethod_MONEYORDER       PrepaymentMethod = "money_order"
	PrepaymentMethod_ACH              PrepaymentMethod = "ach"
	PrepaymentMethod_PAYPALACCOUNT    PrepaymentMethod = "paypal_account"
	PrepaymentMethod_CREDITCARDONFILE PrepaymentMethod = "credit_card_on_file"
	PrepaymentMethod_OTHER            PrepaymentMethod = "other"
)

type PrepaymentResponse

type PrepaymentResponse struct {
	Prepayment Prepayment `json:"prepayment"`
}

PrepaymentResponse represents a PrepaymentResponse struct.

func (*PrepaymentResponse) MarshalJSON

func (p *PrepaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaymentResponse. It customizes the JSON marshaling process for PrepaymentResponse objects.

func (*PrepaymentResponse) UnmarshalJSON

func (p *PrepaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentResponse. It customizes the JSON unmarshaling process for PrepaymentResponse objects.

type PrepaymentsResponse

type PrepaymentsResponse struct {
	Prepayments []Prepayment `json:"prepayments,omitempty"`
}

PrepaymentsResponse represents a PrepaymentsResponse struct.

func (*PrepaymentsResponse) MarshalJSON

func (p *PrepaymentsResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PrepaymentsResponse. It customizes the JSON marshaling process for PrepaymentsResponse objects.

func (*PrepaymentsResponse) UnmarshalJSON

func (p *PrepaymentsResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PrepaymentsResponse. It customizes the JSON unmarshaling process for PrepaymentsResponse objects.

type PreviewAllocationsRequest

type PreviewAllocationsRequest struct {
	Allocations []CreateAllocation `json:"allocations"`
	// To calculate proration amounts for a future time. Only within a current subscription period. Only ISO8601 format is supported.
	EffectiveProrationDate *time.Time `json:"effective_proration_date,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType] `json:"downgrade_credit"`
}

PreviewAllocationsRequest represents a PreviewAllocationsRequest struct.

func (*PreviewAllocationsRequest) MarshalJSON

func (p *PreviewAllocationsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PreviewAllocationsRequest. It customizes the JSON marshaling process for PreviewAllocationsRequest objects.

func (*PreviewAllocationsRequest) UnmarshalJSON

func (p *PreviewAllocationsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PreviewAllocationsRequest. It customizes the JSON unmarshaling process for PreviewAllocationsRequest objects.

type Price

type Price struct {
	StartingQuantity interface{}           `json:"starting_quantity"`
	EndingQuantity   Optional[interface{}] `json:"ending_quantity"`
	// The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice interface{} `json:"unit_price"`
}

Price represents a Price struct.

func (*Price) MarshalJSON

func (p *Price) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Price. It customizes the JSON marshaling process for Price objects.

func (*Price) UnmarshalJSON

func (p *Price) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Price. It customizes the JSON unmarshaling process for Price objects.

type PricePoint

type PricePoint struct {
	Name   *string `json:"name,omitempty"`
	Handle *string `json:"handle,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"`
	Prices        []Price        `json:"prices,omitempty"`
	// Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
	UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"`
	// Whether or not the price point includes tax
	TaxIncluded *bool `json:"tax_included,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit   *IntervalUnit   `json:"interval_unit,omitempty"`
	OveragePricing *OveragePricing `json:"overage_pricing,omitempty"`
	// Boolean which controls whether or not remaining units should be rolled over to the next period
	RolloverPrepaidRemainder *bool `json:"rollover_prepaid_remainder,omitempty"`
	// Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period
	RenewPrepaidAllocation *bool `json:"renew_prepaid_allocation,omitempty"`
	// (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire
	ExpirationInterval     *float64      `json:"expiration_interval,omitempty"`
	ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"`
}

PricePoint represents a PricePoint struct.

func (*PricePoint) MarshalJSON

func (p *PricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PricePoint. It customizes the JSON marshaling process for PricePoint objects.

func (*PricePoint) UnmarshalJSON

func (p *PricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PricePoint. It customizes the JSON unmarshaling process for PricePoint objects.

type PricePointType

type PricePointType string

PricePointType is a string enum. Price point type. We expose the following types: 1. **default**: a price point that is marked as a default price for a certain product. 2. **custom**: a custom price point. 3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one.

const (
	PricePointType_CATALOG     PricePointType = "catalog"
	PricePointType_ENUMDEFAULT PricePointType = "default"
	PricePointType_CUSTOM      PricePointType = "custom"
)

type PricingScheme

type PricingScheme string

PricingScheme is a string enum. The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.

const (
	PricingScheme_STAIRSTEP PricingScheme = "stairstep"
	PricingScheme_VOLUME    PricingScheme = "volume"
	PricingScheme_PERUNIT   PricingScheme = "per_unit"
	PricingScheme_TIERED    PricingScheme = "tiered"
)

type Product

type Product struct {
	Id *int `json:"id,omitempty"`
	// The product name
	Name *string `json:"name,omitempty"`
	// The product API handle
	Handle Optional[string] `json:"handle"`
	// The product description
	Description Optional[string] `json:"description"`
	// E.g. Internal ID or SKU Number
	AccountingCode Optional[string] `json:"accounting_code"`
	// Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, please read this attribute from under the signup page.
	RequestCreditCard *bool `json:"request_credit_card,omitempty"`
	// A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval
	ExpirationInterval Optional[int] `json:"expiration_interval"`
	// A string representing the trial interval unit for this product, either month or day
	ExpirationIntervalUnit Optional[ExtendedIntervalUnit] `json:"expiration_interval_unit"`
	// Timestamp indicating when this product was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Timestamp indicating when this product was last updated
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// The product price, in integer cents
	PriceInCents *int64 `json:"price_in_cents,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this product, either month or day
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
	// The up front charge you have specified.
	InitialChargeInCents Optional[int64] `json:"initial_charge_in_cents"`
	// The price of the trial period for a subscription to this product, in integer cents.
	TrialPriceInCents Optional[int64] `json:"trial_price_in_cents"`
	// A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval
	TrialInterval Optional[int] `json:"trial_interval"`
	// A string representing the trial interval unit for this product, either month or day
	TrialIntervalUnit Optional[IntervalUnit] `json:"trial_interval_unit"`
	// Timestamp indicating when this product was archived
	ArchivedAt Optional[time.Time] `json:"archived_at"`
	// Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product.
	RequireCreditCard *bool            `json:"require_credit_card,omitempty"`
	ReturnParams      Optional[string] `json:"return_params"`
	Taxable           *bool            `json:"taxable,omitempty"`
	// The url to which a customer will be returned after a successful account update
	UpdateReturnUrl         Optional[string] `json:"update_return_url"`
	InitialChargeAfterTrial *bool            `json:"initial_charge_after_trial,omitempty"`
	// The version of the product
	VersionNumber *int `json:"version_number,omitempty"`
	// The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update)
	UpdateReturnParams    Optional[string]   `json:"update_return_params"`
	ProductFamily         *ProductFamily     `json:"product_family,omitempty"`
	PublicSignupPages     []PublicSignupPage `json:"public_signup_pages,omitempty"`
	ProductPricePointName *string            `json:"product_price_point_name,omitempty"`
	// A boolean indicating whether to request a billing address on any Self-Service Pages that are used by subscribers of this product.
	RequestBillingAddress *bool `json:"request_billing_address,omitempty"`
	// A boolean indicating whether a billing address is required to add a payment profile, especially at signup.
	RequireBillingAddress *bool `json:"require_billing_address,omitempty"`
	// A boolean indicating whether a shipping address is required for the customer, especially at signup.
	RequireShippingAddress *bool `json:"require_shipping_address,omitempty"`
	// A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode                    Optional[string] `json:"tax_code"`
	DefaultProductPricePointId *int             `json:"default_product_price_point_id,omitempty"`
	UseSiteExchangeRate        Optional[bool]   `json:"use_site_exchange_rate"`
	// One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
	ItemCategory            Optional[string] `json:"item_category"`
	ProductPricePointId     *int             `json:"product_price_point_id,omitempty"`
	ProductPricePointHandle Optional[string] `json:"product_price_point_handle"`
}

Product represents a Product struct.

func (*Product) MarshalJSON

func (p *Product) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Product. It customizes the JSON marshaling process for Product objects.

func (*Product) UnmarshalJSON

func (p *Product) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Product. It customizes the JSON unmarshaling process for Product objects.

type ProductFamily

type ProductFamily struct {
	Id             *int             `json:"id,omitempty"`
	Name           *string          `json:"name,omitempty"`
	Handle         *string          `json:"handle,omitempty"`
	AccountingCode Optional[string] `json:"accounting_code"`
	Description    Optional[string] `json:"description"`
	CreatedAt      *string          `json:"created_at,omitempty"`
	UpdatedAt      *string          `json:"updated_at,omitempty"`
}

ProductFamily represents a ProductFamily struct.

func (*ProductFamily) MarshalJSON

func (p *ProductFamily) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductFamily. It customizes the JSON marshaling process for ProductFamily objects.

func (*ProductFamily) UnmarshalJSON

func (p *ProductFamily) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductFamily. It customizes the JSON unmarshaling process for ProductFamily objects.

type ProductFamilyResponse

type ProductFamilyResponse struct {
	ProductFamily *ProductFamily `json:"product_family,omitempty"`
}

ProductFamilyResponse represents a ProductFamilyResponse struct.

func (*ProductFamilyResponse) MarshalJSON

func (p *ProductFamilyResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductFamilyResponse. It customizes the JSON marshaling process for ProductFamilyResponse objects.

func (*ProductFamilyResponse) UnmarshalJSON

func (p *ProductFamilyResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductFamilyResponse. It customizes the JSON unmarshaling process for ProductFamilyResponse objects.

type ProductPricePoint

type ProductPricePoint struct {
	Id *int `json:"id,omitempty"`
	// The product price point name
	Name *string `json:"name,omitempty"`
	// The product price point API handle
	Handle *string `json:"handle,omitempty"`
	// The product price point price, in integer cents
	PriceInCents *int64 `json:"price_in_cents,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this product price point, either month or day
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
	// The product price point trial price, in integer cents
	TrialPriceInCents *int64 `json:"trial_price_in_cents,omitempty"`
	// The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days
	TrialInterval *int `json:"trial_interval,omitempty"`
	// A string representing the trial interval unit for this product price point, either month or day
	TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"`
	TrialType         *string       `json:"trial_type,omitempty"`
	// reserved for future use
	IntroductoryOffer *bool `json:"introductory_offer,omitempty"`
	// The product price point initial charge, in integer cents
	InitialChargeInCents    *int64 `json:"initial_charge_in_cents,omitempty"`
	InitialChargeAfterTrial *bool  `json:"initial_charge_after_trial,omitempty"`
	// The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire every 30 days
	ExpirationInterval *int `json:"expiration_interval,omitempty"`
	// A string representing the expiration interval unit for this product price point, either month or day
	ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"`
	// The product id this price point belongs to
	ProductId *int `json:"product_id,omitempty"`
	// Timestamp indicating when this price point was archived
	ArchivedAt Optional[time.Time] `json:"archived_at"`
	// Timestamp indicating when this price point was created
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Timestamp indicating when this price point was last updated
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.
	UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"`
	// The type of price point
	Type *PricePointType `json:"type,omitempty"`
	// Whether or not the price point includes tax
	TaxIncluded *bool `json:"tax_included,omitempty"`
	// The subscription id this price point belongs to
	SubscriptionId Optional[int] `json:"subscription_id"`
	// An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter.
	CurrencyPrices []CurrencyPrice `json:"currency_prices,omitempty"`
}

ProductPricePoint represents a ProductPricePoint struct.

func (*ProductPricePoint) MarshalJSON

func (p *ProductPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductPricePoint. It customizes the JSON marshaling process for ProductPricePoint objects.

func (*ProductPricePoint) UnmarshalJSON

func (p *ProductPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePoint. It customizes the JSON unmarshaling process for ProductPricePoint objects.

type ProductPricePointErrors

type ProductPricePointErrors struct {
	PricePoint   *string  `json:"price_point,omitempty"`
	Interval     []string `json:"interval,omitempty"`
	IntervalUnit []string `json:"interval_unit,omitempty"`
	Name         []string `json:"name,omitempty"`
	Price        []string `json:"price,omitempty"`
	PriceInCents []string `json:"price_in_cents,omitempty"`
}

ProductPricePointErrors represents a ProductPricePointErrors struct.

func (*ProductPricePointErrors) MarshalJSON

func (p *ProductPricePointErrors) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductPricePointErrors. It customizes the JSON marshaling process for ProductPricePointErrors objects.

func (*ProductPricePointErrors) UnmarshalJSON

func (p *ProductPricePointErrors) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointErrors. It customizes the JSON unmarshaling process for ProductPricePointErrors objects.

type ProductPricePointResponse

type ProductPricePointResponse struct {
	PricePoint ProductPricePoint `json:"price_point"`
}

ProductPricePointResponse represents a ProductPricePointResponse struct.

func (*ProductPricePointResponse) MarshalJSON

func (p *ProductPricePointResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductPricePointResponse. It customizes the JSON marshaling process for ProductPricePointResponse objects.

func (*ProductPricePointResponse) UnmarshalJSON

func (p *ProductPricePointResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductPricePointResponse. It customizes the JSON unmarshaling process for ProductPricePointResponse objects.

type ProductResponse

type ProductResponse struct {
	Product Product `json:"product"`
}

ProductResponse represents a ProductResponse struct.

func (*ProductResponse) MarshalJSON

func (p *ProductResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProductResponse. It customizes the JSON marshaling process for ProductResponse objects.

func (*ProductResponse) UnmarshalJSON

func (p *ProductResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProductResponse. It customizes the JSON unmarshaling process for ProductResponse objects.

type ProformaError

type ProformaError struct {
	// The error is base if it is not directly associated with a single attribute.
	Subscription *BaseStringError `json:"subscription,omitempty"`
}

ProformaError represents a ProformaError struct.

func (*ProformaError) MarshalJSON

func (p *ProformaError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaError. It customizes the JSON marshaling process for ProformaError objects.

func (*ProformaError) UnmarshalJSON

func (p *ProformaError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaError. It customizes the JSON unmarshaling process for ProformaError objects.

type ProformaInvoice

type ProformaInvoice struct {
	Uid                 *string `json:"uid,omitempty"`
	SiteId              *int    `json:"site_id,omitempty"`
	CustomerId          *int    `json:"customer_id,omitempty"`
	SubscriptionId      *int    `json:"subscription_id,omitempty"`
	Number              *int    `json:"number,omitempty"`
	SequenceNumber      *int    `json:"sequence_number,omitempty"`
	CreatedAt           *string `json:"created_at,omitempty"`
	DeliveryDate        *string `json:"delivery_date,omitempty"`
	Status              *string `json:"status,omitempty"`
	CollectionMethod    *string `json:"collection_method,omitempty"`
	PaymentInstructions *string `json:"payment_instructions,omitempty"`
	Currency            *string `json:"currency,omitempty"`
	ConsolidationLevel  *string `json:"consolidation_level,omitempty"`
	ProductName         *string `json:"product_name,omitempty"`
	ProductFamilyName   *string `json:"product_family_name,omitempty"`
	Role                *string `json:"role,omitempty"`
	// Information about the seller (merchant) listed on the masthead of the invoice.
	Seller *InvoiceSeller `json:"seller,omitempty"`
	// Information about the customer who is owner or recipient the invoiced subscription.
	Customer        *InvoiceCustomer          `json:"customer,omitempty"`
	Memo            *string                   `json:"memo,omitempty"`
	BillingAddress  *InvoiceAddress           `json:"billing_address,omitempty"`
	ShippingAddress *InvoiceAddress           `json:"shipping_address,omitempty"`
	SubtotalAmount  *string                   `json:"subtotal_amount,omitempty"`
	DiscountAmount  *string                   `json:"discount_amount,omitempty"`
	TaxAmount       *string                   `json:"tax_amount,omitempty"`
	TotalAmount     *string                   `json:"total_amount,omitempty"`
	CreditAmount    *string                   `json:"credit_amount,omitempty"`
	PaidAmount      *string                   `json:"paid_amount,omitempty"`
	RefundAmount    *string                   `json:"refund_amount,omitempty"`
	DueAmount       *string                   `json:"due_amount,omitempty"`
	LineItems       []InvoiceLineItem         `json:"line_items,omitempty"`
	Discounts       []ProformaInvoiceDiscount `json:"discounts,omitempty"`
	Taxes           []ProformaInvoiceTax      `json:"taxes,omitempty"`
	Credits         []ProformaInvoiceCredit   `json:"credits,omitempty"`
	Payments        []ProformaInvoicePayment  `json:"payments,omitempty"`
	CustomFields    []InvoiceCustomField      `json:"custom_fields,omitempty"`
	PublicUrl       *string                   `json:"public_url,omitempty"`
}

ProformaInvoice represents a ProformaInvoice struct.

func (*ProformaInvoice) MarshalJSON

func (p *ProformaInvoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoice. It customizes the JSON marshaling process for ProformaInvoice objects.

func (*ProformaInvoice) UnmarshalJSON

func (p *ProformaInvoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoice. It customizes the JSON unmarshaling process for ProformaInvoice objects.

type ProformaInvoiceCredit

type ProformaInvoiceCredit struct {
	Uid            *string `json:"uid,omitempty"`
	Memo           *string `json:"memo,omitempty"`
	OriginalAmount *string `json:"original_amount,omitempty"`
	AppliedAmount  *string `json:"applied_amount,omitempty"`
}

ProformaInvoiceCredit represents a ProformaInvoiceCredit struct.

func (*ProformaInvoiceCredit) MarshalJSON

func (p *ProformaInvoiceCredit) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoiceCredit. It customizes the JSON marshaling process for ProformaInvoiceCredit objects.

func (*ProformaInvoiceCredit) UnmarshalJSON

func (p *ProformaInvoiceCredit) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceCredit. It customizes the JSON unmarshaling process for ProformaInvoiceCredit objects.

type ProformaInvoiceDiscount

type ProformaInvoiceDiscount struct {
	Title             *string                           `json:"title,omitempty"`
	SourceType        *string                           `json:"source_type,omitempty"`
	DiscountType      *string                           `json:"discount_type,omitempty"`
	EligibleAmount    *string                           `json:"eligible_amount,omitempty"`
	DiscountAmount    *string                           `json:"discount_amount,omitempty"`
	LineItemBreakouts []ProformaInvoiceDiscountBreakout `json:"line_item_breakouts,omitempty"`
}

ProformaInvoiceDiscount represents a ProformaInvoiceDiscount struct.

func (*ProformaInvoiceDiscount) MarshalJSON

func (p *ProformaInvoiceDiscount) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscount. It customizes the JSON marshaling process for ProformaInvoiceDiscount objects.

func (*ProformaInvoiceDiscount) UnmarshalJSON

func (p *ProformaInvoiceDiscount) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscount. It customizes the JSON unmarshaling process for ProformaInvoiceDiscount objects.

type ProformaInvoiceDiscountBreakout

type ProformaInvoiceDiscountBreakout struct {
	EligibleAmount *string `json:"eligible_amount,omitempty"`
	DiscountAmount *string `json:"discount_amount,omitempty"`
}

ProformaInvoiceDiscountBreakout represents a ProformaInvoiceDiscountBreakout struct.

func (*ProformaInvoiceDiscountBreakout) MarshalJSON

func (p *ProformaInvoiceDiscountBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoiceDiscountBreakout. It customizes the JSON marshaling process for ProformaInvoiceDiscountBreakout objects.

func (*ProformaInvoiceDiscountBreakout) UnmarshalJSON

func (p *ProformaInvoiceDiscountBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceDiscountBreakout. It customizes the JSON unmarshaling process for ProformaInvoiceDiscountBreakout objects.

type ProformaInvoicePayment

type ProformaInvoicePayment struct {
	Memo           *string `json:"memo,omitempty"`
	OriginalAmount *string `json:"original_amount,omitempty"`
	AppliedAmount  *string `json:"applied_amount,omitempty"`
	Prepayment     *bool   `json:"prepayment,omitempty"`
}

ProformaInvoicePayment represents a ProformaInvoicePayment struct.

func (*ProformaInvoicePayment) MarshalJSON

func (p *ProformaInvoicePayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoicePayment. It customizes the JSON marshaling process for ProformaInvoicePayment objects.

func (*ProformaInvoicePayment) UnmarshalJSON

func (p *ProformaInvoicePayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePayment. It customizes the JSON unmarshaling process for ProformaInvoicePayment objects.

type ProformaInvoicePreview

type ProformaInvoicePreview struct {
	Uid                 *string `json:"uid,omitempty"`
	SiteId              *int    `json:"site_id,omitempty"`
	CustomerId          *int    `json:"customer_id,omitempty"`
	SubscriptionId      *int    `json:"subscription_id,omitempty"`
	Number              *string `json:"number,omitempty"`
	SequenceNumber      *int    `json:"sequence_number,omitempty"`
	CreatedAt           *string `json:"created_at,omitempty"`
	DeliveryDate        *string `json:"delivery_date,omitempty"`
	Status              *string `json:"status,omitempty"`
	CollectionMethod    *string `json:"collection_method,omitempty"`
	PaymentInstructions *string `json:"payment_instructions,omitempty"`
	Currency            *string `json:"currency,omitempty"`
	ConsolidationLevel  *string `json:"consolidation_level,omitempty"`
	ProductName         *string `json:"product_name,omitempty"`
	ProductFamilyName   *string `json:"product_family_name,omitempty"`
	Role                *string `json:"role,omitempty"`
	// Information about the seller (merchant) listed on the masthead of the invoice.
	Seller *InvoiceSeller `json:"seller,omitempty"`
	// Information about the customer who is owner or recipient the invoiced subscription.
	Customer        *InvoiceCustomer          `json:"customer,omitempty"`
	Memo            *string                   `json:"memo,omitempty"`
	BillingAddress  *InvoiceAddress           `json:"billing_address,omitempty"`
	ShippingAddress *InvoiceAddress           `json:"shipping_address,omitempty"`
	SubtotalAmount  *string                   `json:"subtotal_amount,omitempty"`
	DiscountAmount  *string                   `json:"discount_amount,omitempty"`
	TaxAmount       *string                   `json:"tax_amount,omitempty"`
	TotalAmount     *string                   `json:"total_amount,omitempty"`
	CreditAmount    *string                   `json:"credit_amount,omitempty"`
	PaidAmount      *string                   `json:"paid_amount,omitempty"`
	RefundAmount    *string                   `json:"refund_amount,omitempty"`
	DueAmount       *string                   `json:"due_amount,omitempty"`
	LineItems       []InvoiceLineItem         `json:"line_items,omitempty"`
	Discounts       []ProformaInvoiceDiscount `json:"discounts,omitempty"`
	Taxes           []ProformaInvoiceTax      `json:"taxes,omitempty"`
	Credits         []ProformaInvoiceCredit   `json:"credits,omitempty"`
	Payments        []ProformaInvoicePayment  `json:"payments,omitempty"`
	CustomFields    []InvoiceCustomField      `json:"custom_fields,omitempty"`
	PublicUrl       *string                   `json:"public_url,omitempty"`
}

ProformaInvoicePreview represents a ProformaInvoicePreview struct.

func (*ProformaInvoicePreview) MarshalJSON

func (p *ProformaInvoicePreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoicePreview. It customizes the JSON marshaling process for ProformaInvoicePreview objects.

func (*ProformaInvoicePreview) UnmarshalJSON

func (p *ProformaInvoicePreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoicePreview. It customizes the JSON unmarshaling process for ProformaInvoicePreview objects.

type ProformaInvoiceTax

type ProformaInvoiceTax struct {
	Uid               *string                      `json:"uid,omitempty"`
	Title             *string                      `json:"title,omitempty"`
	SourceType        *string                      `json:"source_type,omitempty"`
	Percentage        *string                      `json:"percentage,omitempty"`
	TaxableAmount     *string                      `json:"taxable_amount,omitempty"`
	TaxAmount         *string                      `json:"tax_amount,omitempty"`
	LineItemBreakouts []ProformaInvoiceTaxBreakout `json:"line_item_breakouts,omitempty"`
}

ProformaInvoiceTax represents a ProformaInvoiceTax struct.

func (*ProformaInvoiceTax) MarshalJSON

func (p *ProformaInvoiceTax) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTax. It customizes the JSON marshaling process for ProformaInvoiceTax objects.

func (*ProformaInvoiceTax) UnmarshalJSON

func (p *ProformaInvoiceTax) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTax. It customizes the JSON unmarshaling process for ProformaInvoiceTax objects.

type ProformaInvoiceTaxBreakout

type ProformaInvoiceTaxBreakout struct {
	TaxableAmount *string `json:"taxable_amount,omitempty"`
	TaxAmount     *string `json:"tax_amount,omitempty"`
}

ProformaInvoiceTaxBreakout represents a ProformaInvoiceTaxBreakout struct.

func (*ProformaInvoiceTaxBreakout) MarshalJSON

func (p *ProformaInvoiceTaxBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ProformaInvoiceTaxBreakout. It customizes the JSON marshaling process for ProformaInvoiceTaxBreakout objects.

func (*ProformaInvoiceTaxBreakout) UnmarshalJSON

func (p *ProformaInvoiceTaxBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ProformaInvoiceTaxBreakout. It customizes the JSON unmarshaling process for ProformaInvoiceTaxBreakout objects.

type Proration

type Proration struct {
	// The alternative to sending preserve_period as a direct attribute to migration
	PreservePeriod *bool `json:"preserve_period,omitempty"`
}

Proration represents a Proration struct.

func (*Proration) MarshalJSON

func (p *Proration) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Proration. It customizes the JSON marshaling process for Proration objects.

func (*Proration) UnmarshalJSON

func (p *Proration) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Proration. It customizes the JSON unmarshaling process for Proration objects.

type PublicKey

type PublicKey struct {
	PublicKey             *string `json:"public_key,omitempty"`
	RequiresSecurityToken *bool   `json:"requires_security_token,omitempty"`
	CreatedAt             *string `json:"created_at,omitempty"`
}

PublicKey represents a PublicKey struct.

func (*PublicKey) MarshalJSON

func (p *PublicKey) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PublicKey. It customizes the JSON marshaling process for PublicKey objects.

func (*PublicKey) UnmarshalJSON

func (p *PublicKey) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PublicKey. It customizes the JSON unmarshaling process for PublicKey objects.

type PublicSignupPage

type PublicSignupPage struct {
	// The id of the signup page (public_signup_pages only)
	Id *int `json:"id,omitempty"`
	// The url to which a customer will be returned after a successful signup (public_signup_pages only)
	ReturnUrl Optional[string] `json:"return_url"`
	// The params to be appended to the return_url (public_signup_pages only)
	ReturnParams Optional[string] `json:"return_params"`
	// The url where the signup page can be viewed (public_signup_pages only)
	Url *string `json:"url,omitempty"`
}

PublicSignupPage represents a PublicSignupPage struct.

func (*PublicSignupPage) MarshalJSON

func (p *PublicSignupPage) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for PublicSignupPage. It customizes the JSON marshaling process for PublicSignupPage objects.

func (*PublicSignupPage) UnmarshalJSON

func (p *PublicSignupPage) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for PublicSignupPage. It customizes the JSON unmarshaling process for PublicSignupPage objects.

type QuantityBasedComponent added in v0.1.0

type QuantityBasedComponent struct {
	// A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes".
	Name string `json:"name"`
	// The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item
	UnitName string `json:"unit_name"`
	// A description for the component that will be displayed to the user on the hosted signup page.
	Description *string `json:"description,omitempty"`
	// A unique identifier for your use that can be used to retrieve this component is subsequent requests.  Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
	Handle *string `json:"handle,omitempty"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme `json:"pricing_scheme"`
	// (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes.
	Prices []Price `json:"prices,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit Optional[CreditType]      `json:"downgrade_credit"`
	PricePoints     []ComponentPricePointItem `json:"price_points,omitempty"`
	// The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice *interface{} `json:"unit_price,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode *string `json:"tax_code,omitempty"`
	// (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices.
	HideDateRangeOnInvoice *bool `json:"hide_date_range_on_invoice,omitempty"`
	// deprecated May 2011 - use unit_price instead
	PriceInCents              *string `json:"price_in_cents,omitempty"`
	Recurring                 *bool   `json:"recurring,omitempty"`
	DisplayOnHostedPage       *bool   `json:"display_on_hosted_page,omitempty"`
	AllowFractionalQuantities *bool   `json:"allow_fractional_quantities,omitempty"`
	PublicSignupPageIds       []int   `json:"public_signup_page_ids,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

QuantityBasedComponent represents a QuantityBasedComponent struct.

func (*QuantityBasedComponent) MarshalJSON added in v0.1.0

func (q *QuantityBasedComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for QuantityBasedComponent. It customizes the JSON marshaling process for QuantityBasedComponent objects.

func (*QuantityBasedComponent) UnmarshalJSON added in v0.1.0

func (q *QuantityBasedComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for QuantityBasedComponent. It customizes the JSON unmarshaling process for QuantityBasedComponent objects.

type ReactivateSubscriptionGroupRequest

type ReactivateSubscriptionGroupRequest struct {
	Resume        *bool `json:"resume,omitempty"`
	ResumeMembers *bool `json:"resume_members,omitempty"`
}

ReactivateSubscriptionGroupRequest represents a ReactivateSubscriptionGroupRequest struct.

func (*ReactivateSubscriptionGroupRequest) MarshalJSON

func (r *ReactivateSubscriptionGroupRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupRequest. It customizes the JSON marshaling process for ReactivateSubscriptionGroupRequest objects.

func (*ReactivateSubscriptionGroupRequest) UnmarshalJSON

func (r *ReactivateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupRequest. It customizes the JSON unmarshaling process for ReactivateSubscriptionGroupRequest objects.

type ReactivateSubscriptionGroupResponse

type ReactivateSubscriptionGroupResponse struct {
	Uid                   *string `json:"uid,omitempty"`
	Scheme                *int    `json:"scheme,omitempty"`
	CustomerId            *int    `json:"customer_id,omitempty"`
	PaymentProfileId      *int    `json:"payment_profile_id,omitempty"`
	SubscriptionIds       []int   `json:"subscription_ids,omitempty"`
	PrimarySubscriptionId *int    `json:"primary_subscription_id,omitempty"`
	NextAssessmentAt      *string `json:"next_assessment_at,omitempty"`
	State                 *string `json:"state,omitempty"`
	CancelAtEndOfPeriod   *bool   `json:"cancel_at_end_of_period,omitempty"`
}

ReactivateSubscriptionGroupResponse represents a ReactivateSubscriptionGroupResponse struct.

func (*ReactivateSubscriptionGroupResponse) MarshalJSON

func (r *ReactivateSubscriptionGroupResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionGroupResponse. It customizes the JSON marshaling process for ReactivateSubscriptionGroupResponse objects.

func (*ReactivateSubscriptionGroupResponse) UnmarshalJSON

func (r *ReactivateSubscriptionGroupResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionGroupResponse. It customizes the JSON unmarshaling process for ReactivateSubscriptionGroupResponse objects.

type ReactivateSubscriptionRequest

type ReactivateSubscriptionRequest struct {
	// These values are only applicable to subscriptions using calendar billing
	CalendarBilling *ReactivationBilling `json:"calendar_billing,omitempty"`
	// If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored.
	IncludeTrial *bool `json:"include_trial,omitempty"`
	// If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges.
	PreserveBalance *bool `json:"preserve_balance,omitempty"`
	// The coupon code to be applied during reactivation.
	CouponCode *string `json:"coupon_code,omitempty"`
	// If true is sent, Chargify will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored.
	UseCreditsAndPrepayments *bool `json:"use_credits_and_prepayments,omitempty"`
	// If `true`, Chargify will attempt to resume the subscription's billing period. if not resumable, the subscription will be reactivated with a new billing period. If `false`: Chargify will only attempt to reactivate the subscription.
	Resume *interface{} `json:"resume,omitempty"`
}

ReactivateSubscriptionRequest represents a ReactivateSubscriptionRequest struct.

func (*ReactivateSubscriptionRequest) MarshalJSON

func (r *ReactivateSubscriptionRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReactivateSubscriptionRequest. It customizes the JSON marshaling process for ReactivateSubscriptionRequest objects.

func (*ReactivateSubscriptionRequest) UnmarshalJSON

func (r *ReactivateSubscriptionRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReactivateSubscriptionRequest. It customizes the JSON unmarshaling process for ReactivateSubscriptionRequest objects.

type ReactivationBilling

type ReactivationBilling struct {
	// You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal
	ReactivationCharge *ReactivationCharge `json:"reactivation_charge,omitempty"`
}

ReactivationBilling represents a ReactivationBilling struct. These values are only applicable to subscriptions using calendar billing

func (*ReactivationBilling) MarshalJSON

func (r *ReactivationBilling) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReactivationBilling. It customizes the JSON marshaling process for ReactivationBilling objects.

func (*ReactivationBilling) UnmarshalJSON

func (r *ReactivationBilling) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReactivationBilling. It customizes the JSON unmarshaling process for ReactivationBilling objects.

type ReactivationCharge

type ReactivationCharge string

ReactivationCharge is a string enum. You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

const (
	ReactivationCharge_PRORATED  ReactivationCharge = "prorated"
	ReactivationCharge_IMMEDIATE ReactivationCharge = "immediate"
	ReactivationCharge_DELAYED   ReactivationCharge = "delayed"
)

type ReasonCode

type ReasonCode struct {
	Id          *int    `json:"id,omitempty"`
	SiteId      *int    `json:"site_id,omitempty"`
	Code        *string `json:"code,omitempty"`
	Description *string `json:"description,omitempty"`
	Position    *int    `json:"position,omitempty"`
	CreatedAt   *string `json:"created_at,omitempty"`
	UpdatedAt   *string `json:"updated_at,omitempty"`
}

ReasonCode represents a ReasonCode struct.

func (*ReasonCode) MarshalJSON

func (r *ReasonCode) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReasonCode. It customizes the JSON marshaling process for ReasonCode objects.

func (*ReasonCode) UnmarshalJSON

func (r *ReasonCode) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReasonCode. It customizes the JSON unmarshaling process for ReasonCode objects.

type ReasonCodeResponse

type ReasonCodeResponse struct {
	ReasonCode ReasonCode `json:"reason_code"`
}

ReasonCodeResponse represents a ReasonCodeResponse struct.

func (*ReasonCodeResponse) MarshalJSON

func (r *ReasonCodeResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReasonCodeResponse. It customizes the JSON marshaling process for ReasonCodeResponse objects.

func (*ReasonCodeResponse) UnmarshalJSON

func (r *ReasonCodeResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodeResponse. It customizes the JSON unmarshaling process for ReasonCodeResponse objects.

type ReasonCodesJsonResponse

type ReasonCodesJsonResponse struct {
	Ok *string `json:"ok,omitempty"`
}

ReasonCodesJsonResponse represents a ReasonCodesJsonResponse struct.

func (*ReasonCodesJsonResponse) MarshalJSON

func (r *ReasonCodesJsonResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReasonCodesJsonResponse. It customizes the JSON marshaling process for ReasonCodesJsonResponse objects.

func (*ReasonCodesJsonResponse) UnmarshalJSON

func (r *ReasonCodesJsonResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReasonCodesJsonResponse. It customizes the JSON unmarshaling process for ReasonCodesJsonResponse objects.

type RecordPaymentRequest

type RecordPaymentRequest struct {
	Payment CreatePayment `json:"payment"`
}

RecordPaymentRequest represents a RecordPaymentRequest struct.

func (*RecordPaymentRequest) MarshalJSON

func (r *RecordPaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RecordPaymentRequest. It customizes the JSON marshaling process for RecordPaymentRequest objects.

func (*RecordPaymentRequest) UnmarshalJSON

func (r *RecordPaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RecordPaymentRequest. It customizes the JSON unmarshaling process for RecordPaymentRequest objects.

type RecurringScheme

type RecurringScheme string

RecurringScheme is a string enum.

const (
	RecurringScheme_DONOTRECUR        RecurringScheme = "do_not_recur"
	RecurringScheme_RECURINDEFINITELY RecurringScheme = "recur_indefinitely"
	RecurringScheme_RECURWITHDURATION RecurringScheme = "recur_with_duration"
)

type ReferralCode

type ReferralCode struct {
	Id             *int    `json:"id,omitempty"`
	SiteId         *int    `json:"site_id,omitempty"`
	SubscriptionId *int    `json:"subscription_id,omitempty"`
	Code           *string `json:"code,omitempty"`
}

ReferralCode represents a ReferralCode struct.

func (*ReferralCode) MarshalJSON

func (r *ReferralCode) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReferralCode. It customizes the JSON marshaling process for ReferralCode objects.

func (*ReferralCode) UnmarshalJSON

func (r *ReferralCode) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReferralCode. It customizes the JSON unmarshaling process for ReferralCode objects.

type ReferralValidationResponse

type ReferralValidationResponse struct {
	ReferralCode *ReferralCode `json:"referral_code,omitempty"`
}

ReferralValidationResponse represents a ReferralValidationResponse struct.

func (*ReferralValidationResponse) MarshalJSON

func (r *ReferralValidationResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReferralValidationResponse. It customizes the JSON marshaling process for ReferralValidationResponse objects.

func (*ReferralValidationResponse) UnmarshalJSON

func (r *ReferralValidationResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReferralValidationResponse. It customizes the JSON unmarshaling process for ReferralValidationResponse objects.

type Refund

type Refund struct {
	// The amount to be refunded in decimal format as a string. Example: "10.50". Must not exceed the remaining refundable balance of the payment.
	Amount *string `json:"amount,omitempty"`
	// A description that will be attached to the refund
	Memo *string `json:"memo,omitempty"`
	// The ID of the payment to be refunded
	PaymentId *int `json:"payment_id,omitempty"`
	// Flag that marks refund as external (no money is returned to the customer). Defaults to `false`.
	External *bool `json:"external,omitempty"`
	// If set to true, creates credit and applies it to an invoice. Defaults to `false`.
	ApplyCredit *bool `json:"apply_credit,omitempty"`
	// If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`.
	VoidInvoice *bool `json:"void_invoice,omitempty"`
	// An array of segment uids to refund or the string 'all' to indicate that all segments should be refunded
	SegmentUids *interface{} `json:"segment_uids,omitempty"`
}

Refund represents a Refund struct.

func (*Refund) MarshalJSON

func (r *Refund) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Refund. It customizes the JSON marshaling process for Refund objects.

func (*Refund) UnmarshalJSON

func (r *Refund) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Refund. It customizes the JSON unmarshaling process for Refund objects.

type RefundInvoiceRequest

type RefundInvoiceRequest struct {
	Refund Refund `json:"refund"`
}

RefundInvoiceRequest represents a RefundInvoiceRequest struct.

func (*RefundInvoiceRequest) MarshalJSON

func (r *RefundInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RefundInvoiceRequest. It customizes the JSON marshaling process for RefundInvoiceRequest objects.

func (*RefundInvoiceRequest) UnmarshalJSON

func (r *RefundInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RefundInvoiceRequest. It customizes the JSON unmarshaling process for RefundInvoiceRequest objects.

type RefundPrepayment

type RefundPrepayment struct {
	// `amount` is not required if you pass `amount_in_cents`.
	AmountInCents int64 `json:"amount_in_cents"`
	// `amount_in_cents` is not required if you pass `amount`.
	Amount interface{} `json:"amount"`
	Memo   string      `json:"memo"`
	// Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required.
	External *bool `json:"external,omitempty"`
}

RefundPrepayment represents a RefundPrepayment struct.

func (*RefundPrepayment) MarshalJSON

func (r *RefundPrepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RefundPrepayment. It customizes the JSON marshaling process for RefundPrepayment objects.

func (*RefundPrepayment) UnmarshalJSON

func (r *RefundPrepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepayment. It customizes the JSON unmarshaling process for RefundPrepayment objects.

type RefundPrepaymentAggregatedError

type RefundPrepaymentAggregatedError struct {
	Refund *PrepaymentAggregatedError `json:"refund,omitempty"`
}

RefundPrepaymentAggregatedError represents a RefundPrepaymentAggregatedError struct.

func (*RefundPrepaymentAggregatedError) MarshalJSON

func (r *RefundPrepaymentAggregatedError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RefundPrepaymentAggregatedError. It customizes the JSON marshaling process for RefundPrepaymentAggregatedError objects.

func (*RefundPrepaymentAggregatedError) UnmarshalJSON

func (r *RefundPrepaymentAggregatedError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentAggregatedError. It customizes the JSON unmarshaling process for RefundPrepaymentAggregatedError objects.

type RefundPrepaymentBaseRefundError

type RefundPrepaymentBaseRefundError struct {
	Refund *BaseRefundError `json:"refund,omitempty"`
}

RefundPrepaymentBaseRefundError represents a RefundPrepaymentBaseRefundError struct.

func (*RefundPrepaymentBaseRefundError) MarshalJSON

func (r *RefundPrepaymentBaseRefundError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RefundPrepaymentBaseRefundError. It customizes the JSON marshaling process for RefundPrepaymentBaseRefundError objects.

func (*RefundPrepaymentBaseRefundError) UnmarshalJSON

func (r *RefundPrepaymentBaseRefundError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentBaseRefundError. It customizes the JSON unmarshaling process for RefundPrepaymentBaseRefundError objects.

type RefundPrepaymentRequest

type RefundPrepaymentRequest struct {
	Refund RefundPrepayment `json:"refund"`
}

RefundPrepaymentRequest represents a RefundPrepaymentRequest struct.

func (*RefundPrepaymentRequest) MarshalJSON

func (r *RefundPrepaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RefundPrepaymentRequest. It customizes the JSON marshaling process for RefundPrepaymentRequest objects.

func (*RefundPrepaymentRequest) UnmarshalJSON

func (r *RefundPrepaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RefundPrepaymentRequest. It customizes the JSON unmarshaling process for RefundPrepaymentRequest objects.

type RenewalPreview

type RenewalPreview struct {
	// The timestamp for the subscription’s next renewal
	NextAssessmentAt *string `json:"next_assessment_at,omitempty"`
	// An integer representing the amount of the total pre-tax, pre-discount charges that will be assessed at the next renewal
	SubtotalInCents *int64 `json:"subtotal_in_cents,omitempty"`
	// An integer representing the total tax charges that will be assessed at the next renewal
	TotalTaxInCents *int64 `json:"total_tax_in_cents,omitempty"`
	// An integer representing the amount of the coupon discounts that will be applied to the next renewal
	TotalDiscountInCents *int64 `json:"total_discount_in_cents,omitempty"`
	// An integer representing the total amount owed, less any discounts, that will be assessed at the next renewal
	TotalInCents *int64 `json:"total_in_cents,omitempty"`
	// An integer representing the amount of the subscription’s current balance
	ExistingBalanceInCents *int64 `json:"existing_balance_in_cents,omitempty"`
	// An integer representing the existing_balance_in_cents plus the total_in_cents
	TotalAmountDueInCents *int64 `json:"total_amount_due_in_cents,omitempty"`
	// A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions.
	UncalculatedTaxes *bool `json:"uncalculated_taxes,omitempty"`
	// An array of objects representing the individual transactions that will be created at the next renewal
	LineItems []RenewalPreviewLineItem `json:"line_items,omitempty"`
}

RenewalPreview represents a RenewalPreview struct.

func (*RenewalPreview) MarshalJSON

func (r *RenewalPreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RenewalPreview. It customizes the JSON marshaling process for RenewalPreview objects.

func (*RenewalPreview) UnmarshalJSON

func (r *RenewalPreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreview. It customizes the JSON unmarshaling process for RenewalPreview objects.

type RenewalPreviewComponent

type RenewalPreviewComponent struct {
	// Either the component's Chargify id or its handle prefixed with `handle:`
	ComponentId *interface{} `json:"component_id,omitempty"`
	// The quantity for which you wish to preview billing. This is useful if you want to preview a predicted, higher usage value than is currently present on the subscription.
	// This quantity represents:
	// - Whether or not an on/off component is enabled - use 0 for disabled or 1 for enabled
	// - The desired allocated_quantity for a quantity-based component
	// - The desired unit_balance for a metered component
	// - The desired metric quantity for an events-based component
	Quantity *int `json:"quantity,omitempty"`
	// Either the component price point's Chargify id or its handle prefixed with `handle:`
	PricePointId *interface{} `json:"price_point_id,omitempty"`
}

RenewalPreviewComponent represents a RenewalPreviewComponent struct.

func (*RenewalPreviewComponent) MarshalJSON

func (r *RenewalPreviewComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RenewalPreviewComponent. It customizes the JSON marshaling process for RenewalPreviewComponent objects.

func (*RenewalPreviewComponent) UnmarshalJSON

func (r *RenewalPreviewComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewComponent. It customizes the JSON unmarshaling process for RenewalPreviewComponent objects.

type RenewalPreviewLineItem

type RenewalPreviewLineItem struct {
	// A handle for the line item transaction type
	TransactionType *LineItemTransactionType `json:"transaction_type,omitempty"`
	// A handle for the line item kind
	Kind                  *LineItemKind `json:"kind,omitempty"`
	AmountInCents         *int64        `json:"amount_in_cents,omitempty"`
	Memo                  *string       `json:"memo,omitempty"`
	DiscountAmountInCents *int64        `json:"discount_amount_in_cents,omitempty"`
	TaxableAmountInCents  *int64        `json:"taxable_amount_in_cents,omitempty"`
	ProductId             *int          `json:"product_id,omitempty"`
	ProductName           *string       `json:"product_name,omitempty"`
	ComponentId           *int          `json:"component_id,omitempty"`
	ComponentHandle       *string       `json:"component_handle,omitempty"`
	ComponentName         *string       `json:"component_name,omitempty"`
	ProductHandle         *string       `json:"product_handle,omitempty"`
	PeriodRangeStart      *string       `json:"period_range_start,omitempty"`
	PeriodRangeEnd        *string       `json:"period_range_end,omitempty"`
}

RenewalPreviewLineItem represents a RenewalPreviewLineItem struct.

func (*RenewalPreviewLineItem) MarshalJSON

func (r *RenewalPreviewLineItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RenewalPreviewLineItem. It customizes the JSON marshaling process for RenewalPreviewLineItem objects.

func (*RenewalPreviewLineItem) UnmarshalJSON

func (r *RenewalPreviewLineItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewLineItem. It customizes the JSON unmarshaling process for RenewalPreviewLineItem objects.

type RenewalPreviewRequest

type RenewalPreviewRequest struct {
	// An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees).
	Components []RenewalPreviewComponent `json:"components,omitempty"`
}

RenewalPreviewRequest represents a RenewalPreviewRequest struct.

func (*RenewalPreviewRequest) MarshalJSON

func (r *RenewalPreviewRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RenewalPreviewRequest. It customizes the JSON marshaling process for RenewalPreviewRequest objects.

func (*RenewalPreviewRequest) UnmarshalJSON

func (r *RenewalPreviewRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewRequest. It customizes the JSON unmarshaling process for RenewalPreviewRequest objects.

type RenewalPreviewResponse

type RenewalPreviewResponse struct {
	RenewalPreview RenewalPreview `json:"renewal_preview"`
}

RenewalPreviewResponse represents a RenewalPreviewResponse struct.

func (*RenewalPreviewResponse) MarshalJSON

func (r *RenewalPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RenewalPreviewResponse. It customizes the JSON marshaling process for RenewalPreviewResponse objects.

func (*RenewalPreviewResponse) UnmarshalJSON

func (r *RenewalPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RenewalPreviewResponse. It customizes the JSON unmarshaling process for RenewalPreviewResponse objects.

type ReplayWebhooksRequest

type ReplayWebhooksRequest struct {
	Ids []int `json:"ids"`
}

ReplayWebhooksRequest represents a ReplayWebhooksRequest struct.

func (*ReplayWebhooksRequest) MarshalJSON

func (r *ReplayWebhooksRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReplayWebhooksRequest. It customizes the JSON marshaling process for ReplayWebhooksRequest objects.

func (*ReplayWebhooksRequest) UnmarshalJSON

func (r *ReplayWebhooksRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksRequest. It customizes the JSON unmarshaling process for ReplayWebhooksRequest objects.

type ReplayWebhooksResponse

type ReplayWebhooksResponse struct {
	Status *string `json:"status,omitempty"`
}

ReplayWebhooksResponse represents a ReplayWebhooksResponse struct.

func (*ReplayWebhooksResponse) MarshalJSON

func (r *ReplayWebhooksResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ReplayWebhooksResponse. It customizes the JSON marshaling process for ReplayWebhooksResponse objects.

func (*ReplayWebhooksResponse) UnmarshalJSON

func (r *ReplayWebhooksResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReplayWebhooksResponse. It customizes the JSON unmarshaling process for ReplayWebhooksResponse objects.

type ResentInvitation

type ResentInvitation struct {
	LastSentAt         *string `json:"last_sent_at,omitempty"`
	LastAcceptedAt     *string `json:"last_accepted_at,omitempty"`
	SendInviteLinkText *string `json:"send_invite_link_text,omitempty"`
	UninvitedCount     *int    `json:"uninvited_count,omitempty"`
}

ResentInvitation represents a ResentInvitation struct.

func (*ResentInvitation) MarshalJSON

func (r *ResentInvitation) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ResentInvitation. It customizes the JSON marshaling process for ResentInvitation objects.

func (*ResentInvitation) UnmarshalJSON

func (r *ResentInvitation) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ResentInvitation. It customizes the JSON unmarshaling process for ResentInvitation objects.

type ResourceType

type ResourceType string

ResourceType is a string enum.

const (
	ResourceType_SUBSCRIPTIONS ResourceType = "subscriptions"
	ResourceType_CUSTOMERS     ResourceType = "customers"
)

type RestrictionType

type RestrictionType string

RestrictionType is a string enum.

const (
	RestrictionType_COMPONENT RestrictionType = "Component"
	RestrictionType_PRODUCT   RestrictionType = "Product"
)

type ResumptionCharge

type ResumptionCharge string

ResumptionCharge is a string enum. (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled

const (
	ResumptionCharge_PRORATED  ResumptionCharge = "prorated"
	ResumptionCharge_IMMEDIATE ResumptionCharge = "immediate"
	ResumptionCharge_DELAYED   ResumptionCharge = "delayed"
)

type RevokedInvitation

type RevokedInvitation struct {
	LastSentAt     *string `json:"last_sent_at,omitempty"`
	LastAcceptedAt *string `json:"last_accepted_at,omitempty"`
	UninvitedCount *int    `json:"uninvited_count,omitempty"`
}

RevokedInvitation represents a RevokedInvitation struct.

func (*RevokedInvitation) MarshalJSON

func (r *RevokedInvitation) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for RevokedInvitation. It customizes the JSON marshaling process for RevokedInvitation objects.

func (*RevokedInvitation) UnmarshalJSON

func (r *RevokedInvitation) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RevokedInvitation. It customizes the JSON unmarshaling process for RevokedInvitation objects.

type SaleRep

type SaleRep struct {
	Id                 *int                  `json:"id,omitempty"`
	FullName           *string               `json:"full_name,omitempty"`
	SubscriptionsCount *int                  `json:"subscriptions_count,omitempty"`
	TestMode           *bool                 `json:"test_mode,omitempty"`
	Subscriptions      []SaleRepSubscription `json:"subscriptions,omitempty"`
}

SaleRep represents a SaleRep struct.

func (*SaleRep) MarshalJSON

func (s *SaleRep) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SaleRep. It customizes the JSON marshaling process for SaleRep objects.

func (*SaleRep) UnmarshalJSON

func (s *SaleRep) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SaleRep. It customizes the JSON unmarshaling process for SaleRep objects.

type SaleRepItemMrr

type SaleRepItemMrr struct {
	Mrr       *string `json:"mrr,omitempty"`
	Usage     *string `json:"usage,omitempty"`
	Recurring *string `json:"recurring,omitempty"`
}

SaleRepItemMrr represents a SaleRepItemMrr struct.

func (*SaleRepItemMrr) MarshalJSON

func (s *SaleRepItemMrr) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SaleRepItemMrr. It customizes the JSON marshaling process for SaleRepItemMrr objects.

func (*SaleRepItemMrr) UnmarshalJSON

func (s *SaleRepItemMrr) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SaleRepItemMrr. It customizes the JSON unmarshaling process for SaleRepItemMrr objects.

type SaleRepSettings

type SaleRepSettings struct {
	CustomerName    *string `json:"customer_name,omitempty"`
	SubscriptionId  *int    `json:"subscription_id,omitempty"`
	SiteLink        *string `json:"site_link,omitempty"`
	SiteName        *string `json:"site_name,omitempty"`
	SubscriptionMrr *string `json:"subscription_mrr,omitempty"`
	SalesRepId      *int    `json:"sales_rep_id,omitempty"`
	SalesRepName    *string `json:"sales_rep_name,omitempty"`
}

SaleRepSettings represents a SaleRepSettings struct.

func (*SaleRepSettings) MarshalJSON

func (s *SaleRepSettings) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SaleRepSettings. It customizes the JSON marshaling process for SaleRepSettings objects.

func (*SaleRepSettings) UnmarshalJSON

func (s *SaleRepSettings) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSettings. It customizes the JSON unmarshaling process for SaleRepSettings objects.

type SaleRepSubscription

type SaleRepSubscription struct {
	Id              *int             `json:"id,omitempty"`
	SiteName        *string          `json:"site_name,omitempty"`
	SubscriptionUrl *string          `json:"subscription_url,omitempty"`
	CustomerName    *string          `json:"customer_name,omitempty"`
	CreatedAt       *string          `json:"created_at,omitempty"`
	Mrr             *string          `json:"mrr,omitempty"`
	Usage           *string          `json:"usage,omitempty"`
	Recurring       *string          `json:"recurring,omitempty"`
	LastPayment     *string          `json:"last_payment,omitempty"`
	ChurnDate       Optional[string] `json:"churn_date"`
}

SaleRepSubscription represents a SaleRepSubscription struct.

func (*SaleRepSubscription) MarshalJSON

func (s *SaleRepSubscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SaleRepSubscription. It customizes the JSON marshaling process for SaleRepSubscription objects.

func (*SaleRepSubscription) UnmarshalJSON

func (s *SaleRepSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SaleRepSubscription. It customizes the JSON unmarshaling process for SaleRepSubscription objects.

type Segment

type Segment struct {
	Id                        *int `json:"id,omitempty"`
	ComponentId               *int `json:"component_id,omitempty"`
	PricePointId              *int `json:"price_point_id,omitempty"`
	EventBasedBillingMetricId *int `json:"event_based_billing_metric_id,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme         *PricingScheme `json:"pricing_scheme,omitempty"`
	SegmentProperty1Value *interface{}   `json:"segment_property_1_value,omitempty"`
	SegmentProperty2Value *interface{}   `json:"segment_property_2_value,omitempty"`
	SegmentProperty3Value *interface{}   `json:"segment_property_3_value,omitempty"`
	SegmentProperty4Value *interface{}   `json:"segment_property_4_value,omitempty"`
	CreatedAt             *string        `json:"created_at,omitempty"`
	UpdatedAt             *string        `json:"updated_at,omitempty"`
	Prices                []SegmentPrice `json:"prices,omitempty"`
}

Segment represents a Segment struct.

func (*Segment) MarshalJSON

func (s *Segment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Segment. It customizes the JSON marshaling process for Segment objects.

func (*Segment) UnmarshalJSON

func (s *Segment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Segment. It customizes the JSON unmarshaling process for Segment objects.

type SegmentPrice

type SegmentPrice struct {
	Id                 *int          `json:"id,omitempty"`
	ComponentId        *int          `json:"component_id,omitempty"`
	StartingQuantity   *int          `json:"starting_quantity,omitempty"`
	EndingQuantity     Optional[int] `json:"ending_quantity"`
	UnitPrice          *string       `json:"unit_price,omitempty"`
	PricePointId       *int          `json:"price_point_id,omitempty"`
	FormattedUnitPrice *string       `json:"formatted_unit_price,omitempty"`
	SegmentId          *int          `json:"segment_id,omitempty"`
}

SegmentPrice represents a SegmentPrice struct.

func (*SegmentPrice) MarshalJSON

func (s *SegmentPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SegmentPrice. It customizes the JSON marshaling process for SegmentPrice objects.

func (*SegmentPrice) UnmarshalJSON

func (s *SegmentPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SegmentPrice. It customizes the JSON unmarshaling process for SegmentPrice objects.

type SegmentResponse

type SegmentResponse struct {
	Segment *Segment `json:"segment,omitempty"`
}

SegmentResponse represents a SegmentResponse struct.

func (*SegmentResponse) MarshalJSON

func (s *SegmentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SegmentResponse. It customizes the JSON marshaling process for SegmentResponse objects.

func (*SegmentResponse) UnmarshalJSON

func (s *SegmentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SegmentResponse. It customizes the JSON unmarshaling process for SegmentResponse objects.

type Seller

type Seller struct {
	Name    *string          `json:"name,omitempty"`
	Address *InvoiceAddress  `json:"address,omitempty"`
	Phone   *string          `json:"phone,omitempty"`
	LogoUrl Optional[string] `json:"logo_url"`
}

Seller represents a Seller struct.

func (*Seller) MarshalJSON

func (s *Seller) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Seller. It customizes the JSON marshaling process for Seller objects.

func (*Seller) UnmarshalJSON

func (s *Seller) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Seller. It customizes the JSON unmarshaling process for Seller objects.

type SendInvoiceRequest

type SendInvoiceRequest struct {
	RecipientEmails    []string `json:"recipient_emails,omitempty"`
	CcRecipientEmails  []string `json:"cc_recipient_emails,omitempty"`
	BccRecipientEmails []string `json:"bcc_recipient_emails,omitempty"`
}

SendInvoiceRequest represents a SendInvoiceRequest struct.

func (*SendInvoiceRequest) MarshalJSON

func (s *SendInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SendInvoiceRequest. It customizes the JSON marshaling process for SendInvoiceRequest objects.

func (*SendInvoiceRequest) UnmarshalJSON

func (s *SendInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SendInvoiceRequest. It customizes the JSON unmarshaling process for SendInvoiceRequest objects.

type ServiceCredit

type ServiceCredit struct {
	Id *int `json:"id,omitempty"`
	// The amount in cents of the entry
	AmountInCents *int64 `json:"amount_in_cents,omitempty"`
	// The new balance for the credit account
	EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"`
	// The type of entry
	EntryType *ServiceCreditType `json:"entry_type,omitempty"`
	// The memo attached to the entry
	Memo *string `json:"memo,omitempty"`
}

ServiceCredit represents a ServiceCredit struct.

func (*ServiceCredit) MarshalJSON

func (s *ServiceCredit) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ServiceCredit. It customizes the JSON marshaling process for ServiceCredit objects.

func (*ServiceCredit) UnmarshalJSON

func (s *ServiceCredit) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ServiceCredit. It customizes the JSON unmarshaling process for ServiceCredit objects.

type ServiceCreditResponse

type ServiceCreditResponse struct {
	ServiceCredit ServiceCredit `json:"service_credit"`
}

ServiceCreditResponse represents a ServiceCreditResponse struct.

func (*ServiceCreditResponse) MarshalJSON

func (s *ServiceCreditResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ServiceCreditResponse. It customizes the JSON marshaling process for ServiceCreditResponse objects.

func (*ServiceCreditResponse) UnmarshalJSON

func (s *ServiceCreditResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ServiceCreditResponse. It customizes the JSON unmarshaling process for ServiceCreditResponse objects.

type ServiceCreditType

type ServiceCreditType string

ServiceCreditType is a string enum. The type of entry

const (
	ServiceCreditType_CREDIT ServiceCreditType = "Credit"
	ServiceCreditType_DEBIT  ServiceCreditType = "Debit"
)

type ShippingAddress

type ShippingAddress struct {
	Street  Optional[string] `json:"street"`
	Line2   Optional[string] `json:"line2"`
	City    Optional[string] `json:"city"`
	State   Optional[string] `json:"state"`
	Zip     Optional[string] `json:"zip"`
	Country Optional[string] `json:"country"`
}

ShippingAddress represents a ShippingAddress struct.

func (*ShippingAddress) MarshalJSON

func (s *ShippingAddress) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for ShippingAddress. It customizes the JSON marshaling process for ShippingAddress objects.

func (*ShippingAddress) UnmarshalJSON

func (s *ShippingAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ShippingAddress. It customizes the JSON unmarshaling process for ShippingAddress objects.

type SignupProformaPreview

type SignupProformaPreview struct {
	CurrentProformaInvoice *ProformaInvoice `json:"current_proforma_invoice,omitempty"`
	NextProformaInvoice    *ProformaInvoice `json:"next_proforma_invoice,omitempty"`
}

SignupProformaPreview represents a SignupProformaPreview struct.

func (*SignupProformaPreview) MarshalJSON

func (s *SignupProformaPreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SignupProformaPreview. It customizes the JSON marshaling process for SignupProformaPreview objects.

func (*SignupProformaPreview) UnmarshalJSON

func (s *SignupProformaPreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreview. It customizes the JSON unmarshaling process for SignupProformaPreview objects.

type SignupProformaPreviewResponse

type SignupProformaPreviewResponse struct {
	ProformaInvoicePreview SignupProformaPreview `json:"proforma_invoice_preview"`
}

SignupProformaPreviewResponse represents a SignupProformaPreviewResponse struct.

func (*SignupProformaPreviewResponse) MarshalJSON

func (s *SignupProformaPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SignupProformaPreviewResponse. It customizes the JSON marshaling process for SignupProformaPreviewResponse objects.

func (*SignupProformaPreviewResponse) UnmarshalJSON

func (s *SignupProformaPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SignupProformaPreviewResponse. It customizes the JSON unmarshaling process for SignupProformaPreviewResponse objects.

type Site

type Site struct {
	Id                             *int                 `json:"id,omitempty"`
	Name                           *string              `json:"name,omitempty"`
	Subdomain                      *string              `json:"subdomain,omitempty"`
	Currency                       *string              `json:"currency,omitempty"`
	SellerId                       *int                 `json:"seller_id,omitempty"`
	NonPrimaryCurrencies           []string             `json:"non_primary_currencies,omitempty"`
	RelationshipInvoicingEnabled   *bool                `json:"relationship_invoicing_enabled,omitempty"`
	CustomerHierarchyEnabled       *bool                `json:"customer_hierarchy_enabled,omitempty"`
	WhopaysEnabled                 *bool                `json:"whopays_enabled,omitempty"`
	WhopaysDefaultPayer            *string              `json:"whopays_default_payer,omitempty"`
	AllocationSettings             *AllocationSettings  `json:"allocation_settings,omitempty"`
	DefaultPaymentCollectionMethod *string              `json:"default_payment_collection_method,omitempty"`
	OrganizationAddress            *OrganizationAddress `json:"organization_address,omitempty"`
	TaxConfiguration               *TaxConfiguration    `json:"tax_configuration,omitempty"`
	NetTerms                       *NetTerms            `json:"net_terms,omitempty"`
	Test                           *bool                `json:"test,omitempty"`
}

Site represents a Site struct.

func (*Site) MarshalJSON

func (s *Site) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Site. It customizes the JSON marshaling process for Site objects.

func (*Site) UnmarshalJSON

func (s *Site) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Site. It customizes the JSON unmarshaling process for Site objects.

type SiteResponse

type SiteResponse struct {
	Site Site `json:"site"`
}

SiteResponse represents a SiteResponse struct.

func (*SiteResponse) MarshalJSON

func (s *SiteResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SiteResponse. It customizes the JSON marshaling process for SiteResponse objects.

func (*SiteResponse) UnmarshalJSON

func (s *SiteResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SiteResponse. It customizes the JSON unmarshaling process for SiteResponse objects.

type SiteStatistics

type SiteStatistics struct {
	TotalSubscriptions         *int     `json:"total_subscriptions,omitempty"`
	SubscriptionsToday         *int     `json:"subscriptions_today,omitempty"`
	TotalRevenue               *string  `json:"total_revenue,omitempty"`
	RevenueToday               *string  `json:"revenue_today,omitempty"`
	RevenueThisMonth           *string  `json:"revenue_this_month,omitempty"`
	RevenueThisYear            *string  `json:"revenue_this_year,omitempty"`
	TotalCanceledSubscriptions *int     `json:"total_canceled_subscriptions,omitempty"`
	TotalActiveSubscriptions   *float64 `json:"total_active_subscriptions,omitempty"`
	TotalPastDueSubscriptions  *float64 `json:"total_past_due_subscriptions,omitempty"`
	TotalUnpaidSubscriptions   *float64 `json:"total_unpaid_subscriptions,omitempty"`
	TotalDunningSubscriptions  *float64 `json:"total_dunning_subscriptions,omitempty"`
}

SiteStatistics represents a SiteStatistics struct.

func (*SiteStatistics) MarshalJSON

func (s *SiteStatistics) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SiteStatistics. It customizes the JSON marshaling process for SiteStatistics objects.

func (*SiteStatistics) UnmarshalJSON

func (s *SiteStatistics) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SiteStatistics. It customizes the JSON unmarshaling process for SiteStatistics objects.

type SiteSummary

type SiteSummary struct {
	SellerName   *string         `json:"seller_name,omitempty"`
	SiteName     *string         `json:"site_name,omitempty"`
	SiteId       *int            `json:"site_id,omitempty"`
	SiteCurrency *string         `json:"site_currency,omitempty"`
	Stats        *SiteStatistics `json:"stats,omitempty"`
}

SiteSummary represents a SiteSummary struct.

func (*SiteSummary) MarshalJSON

func (s *SiteSummary) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SiteSummary. It customizes the JSON marshaling process for SiteSummary objects.

func (*SiteSummary) UnmarshalJSON

func (s *SiteSummary) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SiteSummary. It customizes the JSON unmarshaling process for SiteSummary objects.

type SortingDirection

type SortingDirection string

SortingDirection is a string enum. Used for sorting results.

const (
	SortingDirection_ASC  SortingDirection = "asc"
	SortingDirection_DESC SortingDirection = "desc"
)

type Subscription

type Subscription struct {
	// The subscription unique id within Chargify.
	Id *int `json:"id,omitempty"`
	// The state of a subscription.
	// * **Live States**
	//     * `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
	//     * `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
	//     * `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
	//     * `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
	//     * `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
	// * **Problem States**
	//     * `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
	//     * `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
	//     * `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405505141005) settings to have a Final Action of `mark the subscription unpaid`.
	// * **End of Life States**
	//     * `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) documentation for info on how to restart a canceled subscription.
	//     While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
	//     * `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
	//     * `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
	//     * `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
	//     * `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
	//     * `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.
	// See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions.
	State *SubscriptionState `json:"state,omitempty"`
	// Gives the current outstanding subscription balance in the number of cents.
	BalanceInCents *int64 `json:"balance_in_cents,omitempty"`
	// Gives the total revenue from the subscription in the number of cents.
	TotalRevenueInCents *int64 `json:"total_revenue_in_cents,omitempty"`
	// (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version.
	ProductPriceInCents *int64 `json:"product_price_in_cents,omitempty"`
	// The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility.
	ProductVersionNumber *int `json:"product_version_number,omitempty"`
	// Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur)
	CurrentPeriodEndsAt *time.Time `json:"current_period_ends_at,omitempty"`
	// Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases)
	NextAssessmentAt *time.Time `json:"next_assessment_at,omitempty"`
	// Timestamp for when the trial period (if any) began
	TrialStartedAt Optional[time.Time] `json:"trial_started_at"`
	// Timestamp for when the trial period (if any) ended
	TrialEndedAt Optional[time.Time] `json:"trial_ended_at"`
	// Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial)
	ActivatedAt *time.Time `json:"activated_at,omitempty"`
	// Timestamp giving the expiration date of this subscription (if any)
	ExpiresAt Optional[time.Time] `json:"expires_at"`
	// The creation date for this subscription
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// The date of last update for this subscription
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// Seller-provided reason for, or note about, the cancellation.
	CancellationMessage Optional[string] `json:"cancellation_message"`
	// The process used to cancel the subscription, if the subscription has been canceled. It is nil if the subscription's state is not canceled.
	CancellationMethod Optional[CancellationMethod] `json:"cancellation_method"`
	// Whether or not the subscription will (or has) canceled at the end of the period.
	CancelAtEndOfPeriod Optional[bool] `json:"cancel_at_end_of_period"`
	// The timestamp of the most recent cancellation
	CanceledAt Optional[time.Time] `json:"canceled_at"`
	// Timestamp relating to the start of the current (recurring) period
	CurrentPeriodStartedAt *time.Time `json:"current_period_started_at,omitempty"`
	// Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state)
	PreviousState *SubscriptionState `json:"previous_state,omitempty"`
	// The ID of the transaction that generated the revenue
	SignupPaymentId *int `json:"signup_payment_id,omitempty"`
	// The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00)
	SignupRevenue *string `json:"signup_revenue,omitempty"`
	// Timestamp for when the subscription is currently set to cancel.
	DelayedCancelAt Optional[time.Time] `json:"delayed_cancel_at"`
	// (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon.
	CouponCode Optional[string] `json:"coupon_code"` // Deprecated
	// The day of the month that the subscription will charge according to calendar billing rules, if used.
	SnapDay Optional[string] `json:"snap_day"`
	// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
	PaymentCollectionMethod *CollectionMethod                 `json:"payment_collection_method,omitempty"`
	Customer                *Customer                         `json:"customer,omitempty"`
	Product                 *Product                          `json:"product,omitempty"`
	CreditCard              *CreditCardPaymentProfile         `json:"credit_card,omitempty"`
	Group                   Optional[NestedSubscriptionGroup] `json:"group"`
	BankAccount             *BankAccountPaymentProfile        `json:"bank_account,omitempty"`
	// The payment profile type for the active profile on file.
	PaymentType Optional[string] `json:"payment_type"`
	// The subscription's unique code that can be given to referrals.
	ReferralCode Optional[string] `json:"referral_code"`
	// If a delayed product change is scheduled, the ID of the product that the subscription will be changed to at the next renewal.
	NextProductId Optional[int] `json:"next_product_id"`
	// If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal.
	NextProductHandle Optional[string] `json:"next_product_handle"`
	// (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons.
	CouponUseCount Optional[int] `json:"coupon_use_count"` // Deprecated
	// (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons.
	CouponUsesAllowed Optional[int] `json:"coupon_uses_allowed"` // Deprecated
	// If the subscription is canceled, this is their churn code.
	ReasonCode Optional[string] `json:"reason_code"`
	// The date the subscription is scheduled to automatically resume from the on_hold state.
	AutomaticallyResumeAt Optional[time.Time] `json:"automatically_resume_at"`
	// An array for all the coupons attached to the subscription.
	CouponCodes []string `json:"coupon_codes,omitempty"`
	// The ID of the offer associated with the subscription.
	OfferId Optional[int] `json:"offer_id"`
	// On Relationship Invoicing, the ID of the individual paying for the subscription. Defaults to the Customer ID unless the 'Customer Hierarchies & WhoPays' feature is enabled.
	PayerId Optional[int] `json:"payer_id"`
	// The balance in cents plus the estimated renewal amount in cents.
	CurrentBillingAmountInCents *int64 `json:"current_billing_amount_in_cents,omitempty"`
	// The product price point currently subscribed to.
	ProductPricePointId *int `json:"product_price_point_id,omitempty"`
	// Price point type. We expose the following types:
	// 1. **default**: a price point that is marked as a default price for a certain product.
	// 2. **custom**: a custom price point.
	// 3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one.
	ProductPricePointType *PricePointType `json:"product_price_point_type,omitempty"`
	// If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal.
	NextProductPricePointId Optional[int] `json:"next_product_price_point_id"`
	// On Relationship Invoicing, the number of days before a renewal invoice is due.
	NetTerms Optional[int] `json:"net_terms"`
	// For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal.
	StoredCredentialTransactionId Optional[int] `json:"stored_credential_transaction_id"`
	// The reference value (provided by your app) for the subscription itelf.
	Reference Optional[string] `json:"reference"`
	// The timestamp of the most recent on hold action.
	OnHoldAt Optional[time.Time] `json:"on_hold_at"`
	// Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled
	PrepaidDunning *bool `json:"prepaid_dunning,omitempty"`
	// Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
	// Only in Read Subscription Endpoint.
	Coupons []SubscriptionIncludedCoupon `json:"coupons,omitempty"`
	// Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
	DunningCommunicationDelayEnabled *bool `json:"dunning_communication_delay_enabled,omitempty"`
	// Time zone for the Dunning Communication Delay feature.
	DunningCommunicationDelayTimeZone Optional[string]      `json:"dunning_communication_delay_time_zone"`
	ReceivesInvoiceEmails             Optional[bool]        `json:"receives_invoice_emails"`
	Locale                            Optional[string]      `json:"locale"`
	Currency                          *string               `json:"currency,omitempty"`
	ScheduledCancellationAt           Optional[time.Time]   `json:"scheduled_cancellation_at"`
	CreditBalanceInCents              *int64                `json:"credit_balance_in_cents,omitempty"`
	PrepaymentBalanceInCents          *int64                `json:"prepayment_balance_in_cents,omitempty"`
	PrepaidConfiguration              *PrepaidConfiguration `json:"prepaid_configuration,omitempty"`
	// Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided.
	SelfServicePageToken *string `json:"self_service_page_token,omitempty"`
}

Subscription represents a Subscription struct.

func (*Subscription) MarshalJSON

func (s *Subscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Subscription. It customizes the JSON marshaling process for Subscription objects.

func (*Subscription) UnmarshalJSON

func (s *Subscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Subscription. It customizes the JSON unmarshaling process for Subscription objects.

type SubscriptionComponent

type SubscriptionComponent struct {
	Id   *int    `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
	// A handle for the component type
	Kind     *ComponentKind `json:"kind,omitempty"`
	UnitName *string        `json:"unit_name,omitempty"`
	// (for on/off components) indicates if the component is enabled for the subscription
	Enabled     *bool   `json:"enabled,omitempty"`
	UnitBalance *int    `json:"unit_balance,omitempty"`
	Currency    *string `json:"currency,omitempty"`
	// For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
	AllocatedQuantity *interface{}            `json:"allocated_quantity,omitempty"`
	PricingScheme     Optional[PricingScheme] `json:"pricing_scheme"`
	ComponentId       *int                    `json:"component_id,omitempty"`
	ComponentHandle   Optional[string]        `json:"component_handle"`
	SubscriptionId    *int                    `json:"subscription_id,omitempty"`
	Recurring         *bool                   `json:"recurring,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	DowngradeCredit           Optional[CreditType] `json:"downgrade_credit"`
	ArchivedAt                Optional[string]     `json:"archived_at"`
	PricePointId              Optional[int]        `json:"price_point_id"`
	PricePointHandle          Optional[string]     `json:"price_point_handle"`
	PricePointType            *interface{}         `json:"price_point_type,omitempty"`
	PricePointName            Optional[string]     `json:"price_point_name"`
	ProductFamilyId           *int                 `json:"product_family_id,omitempty"`
	ProductFamilyHandle       *string              `json:"product_family_handle,omitempty"`
	CreatedAt                 *time.Time           `json:"created_at,omitempty"`
	UpdatedAt                 *time.Time           `json:"updated_at,omitempty"`
	UseSiteExchangeRate       Optional[bool]       `json:"use_site_exchange_rate"`
	Description               Optional[string]     `json:"description"`
	AllowFractionalQuantities *bool                `json:"allow_fractional_quantities,omitempty"`
	// An optional object, will be returned if provided `include=subscription` query param.
	Subscription        *SubscriptionComponentSubscription `json:"subscription,omitempty"`
	DisplayOnHostedPage *bool                              `json:"display_on_hosted_page,omitempty"`
	// The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
}

SubscriptionComponent represents a SubscriptionComponent struct.

func (*SubscriptionComponent) MarshalJSON

func (s *SubscriptionComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionComponent. It customizes the JSON marshaling process for SubscriptionComponent objects.

func (*SubscriptionComponent) UnmarshalJSON

func (s *SubscriptionComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponent. It customizes the JSON unmarshaling process for SubscriptionComponent objects.

type SubscriptionComponentAllocationErrorItem

type SubscriptionComponentAllocationErrorItem struct {
	Kind    *string `json:"kind,omitempty"`
	Message *string `json:"message,omitempty"`
}

SubscriptionComponentAllocationErrorItem represents a SubscriptionComponentAllocationErrorItem struct.

func (*SubscriptionComponentAllocationErrorItem) MarshalJSON

func (s *SubscriptionComponentAllocationErrorItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionComponentAllocationErrorItem. It customizes the JSON marshaling process for SubscriptionComponentAllocationErrorItem objects.

func (*SubscriptionComponentAllocationErrorItem) UnmarshalJSON

func (s *SubscriptionComponentAllocationErrorItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentAllocationErrorItem. It customizes the JSON unmarshaling process for SubscriptionComponentAllocationErrorItem objects.

type SubscriptionComponentResponse

type SubscriptionComponentResponse struct {
	Component *SubscriptionComponent `json:"component,omitempty"`
}

SubscriptionComponentResponse represents a SubscriptionComponentResponse struct.

func (*SubscriptionComponentResponse) MarshalJSON

func (s *SubscriptionComponentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionComponentResponse. It customizes the JSON marshaling process for SubscriptionComponentResponse objects.

func (*SubscriptionComponentResponse) UnmarshalJSON

func (s *SubscriptionComponentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentResponse. It customizes the JSON unmarshaling process for SubscriptionComponentResponse objects.

type SubscriptionComponentSubscription

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

SubscriptionComponentSubscription represents a SubscriptionComponentSubscription struct. An optional object, will be returned if provided `include=subscription` query param.

func (*SubscriptionComponentSubscription) MarshalJSON

func (s *SubscriptionComponentSubscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionComponentSubscription. It customizes the JSON marshaling process for SubscriptionComponentSubscription objects.

func (*SubscriptionComponentSubscription) UnmarshalJSON

func (s *SubscriptionComponentSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionComponentSubscription. It customizes the JSON unmarshaling process for SubscriptionComponentSubscription objects.

type SubscriptionCustomPrice

type SubscriptionCustomPrice struct {
	// (Optional)
	Name *string `json:"name,omitempty"`
	// (Optional)
	Handle *string `json:"handle,omitempty"`
	// Required if using `custom_price` attribute.
	PriceInCents interface{} `json:"price_in_cents"`
	// Required if using `custom_price` attribute.
	Interval interface{} `json:"interval"`
	// Required if using `custom_price` attribute.
	IntervalUnit IntervalUnit `json:"interval_unit"`
	// (Optional)
	TrialPriceInCents *interface{} `json:"trial_price_in_cents,omitempty"`
	// (Optional)
	TrialInterval *interface{} `json:"trial_interval,omitempty"`
	// (Optional)
	TrialIntervalUnit *IntervalUnit `json:"trial_interval_unit,omitempty"`
	// (Optional)
	InitialChargeInCents *interface{} `json:"initial_charge_in_cents,omitempty"`
	// (Optional)
	InitialChargeAfterTrial *bool `json:"initial_charge_after_trial,omitempty"`
	// (Optional)
	ExpirationInterval *interface{} `json:"expiration_interval,omitempty"`
	// (Optional)
	ExpirationIntervalUnit *IntervalUnit `json:"expiration_interval_unit,omitempty"`
	// (Optional)
	TaxIncluded *bool `json:"tax_included,omitempty"`
}

SubscriptionCustomPrice represents a SubscriptionCustomPrice struct. (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription

func (*SubscriptionCustomPrice) MarshalJSON

func (s *SubscriptionCustomPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionCustomPrice. It customizes the JSON marshaling process for SubscriptionCustomPrice objects.

func (*SubscriptionCustomPrice) UnmarshalJSON

func (s *SubscriptionCustomPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionCustomPrice. It customizes the JSON unmarshaling process for SubscriptionCustomPrice objects.

type SubscriptionDateField

type SubscriptionDateField string

SubscriptionDateField is a string enum.

const (
	SubscriptionDateField_CURRENTPERIODENDSAT   SubscriptionDateField = "current_period_ends_at"
	SubscriptionDateField_CURRENTPERIODSTARTSAT SubscriptionDateField = "current_period_starts_at"
	SubscriptionDateField_CREATEDAT             SubscriptionDateField = "created_at"
	SubscriptionDateField_ACTIVATEDAT           SubscriptionDateField = "activated_at"
	SubscriptionDateField_CANCELEDAT            SubscriptionDateField = "canceled_at"
	SubscriptionDateField_EXPIRESAT             SubscriptionDateField = "expires_at"
	SubscriptionDateField_TRIALSTARTEDAT        SubscriptionDateField = "trial_started_at"
	SubscriptionDateField_TRIALENDEDAT          SubscriptionDateField = "trial_ended_at"
	SubscriptionDateField_UPDATEDAT             SubscriptionDateField = "updated_at"
)

type SubscriptionGroup

type SubscriptionGroup struct {
	CustomerId              *int                             `json:"customer_id,omitempty"`
	PaymentProfile          *SubscriptionGroupPaymentProfile `json:"payment_profile,omitempty"`
	PaymentCollectionMethod *string                          `json:"payment_collection_method,omitempty"`
	SubscriptionIds         []int                            `json:"subscription_ids,omitempty"`
	CreatedAt               *string                          `json:"created_at,omitempty"`
}

SubscriptionGroup represents a SubscriptionGroup struct.

func (*SubscriptionGroup) MarshalJSON

func (s *SubscriptionGroup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroup. It customizes the JSON marshaling process for SubscriptionGroup objects.

func (*SubscriptionGroup) UnmarshalJSON

func (s *SubscriptionGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroup. It customizes the JSON unmarshaling process for SubscriptionGroup objects.

type SubscriptionGroupBalances

type SubscriptionGroupBalances struct {
	Prepayments      *AccountBalance `json:"prepayments,omitempty"`
	ServiceCredits   *AccountBalance `json:"service_credits,omitempty"`
	OpenInvoices     *AccountBalance `json:"open_invoices,omitempty"`
	PendingDiscounts *AccountBalance `json:"pending_discounts,omitempty"`
}

SubscriptionGroupBalances represents a SubscriptionGroupBalances struct.

func (*SubscriptionGroupBalances) MarshalJSON

func (s *SubscriptionGroupBalances) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBalances. It customizes the JSON marshaling process for SubscriptionGroupBalances objects.

func (*SubscriptionGroupBalances) UnmarshalJSON

func (s *SubscriptionGroupBalances) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBalances. It customizes the JSON unmarshaling process for SubscriptionGroupBalances objects.

type SubscriptionGroupBankAccount

type SubscriptionGroupBankAccount struct {
	// (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides
	BankName *string `json:"bank_name,omitempty"`
	// (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number
	BankAccountNumber *string `json:"bank_account_number,omitempty"`
	// (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API
	BankRoutingNumber *string `json:"bank_routing_number,omitempty"`
	// (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided
	BankIban *string `json:"bank_iban,omitempty"`
	// (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided
	BankBranchCode *string `json:"bank_branch_code,omitempty"`
	// Defaults to checking
	BankAccountType *BankAccountType `json:"bank_account_type,omitempty"`
	// Defaults to personal
	BankAccountHolderType *BankAccountHolderType `json:"bank_account_holder_type,omitempty"`
	PaymentType           *PaymentType           `json:"payment_type,omitempty"`
	BillingAddress        *string                `json:"billing_address,omitempty"`
	BillingCity           *string                `json:"billing_city,omitempty"`
	BillingState          *string                `json:"billing_state,omitempty"`
	BillingZip            *string                `json:"billing_zip,omitempty"`
	BillingCountry        *string                `json:"billing_country,omitempty"`
	ChargifyToken         *string                `json:"chargify_token,omitempty"`
	// The vault that stores the payment profile with the provided vault_token.
	CurrentVault  *BankAccountVault `json:"current_vault,omitempty"`
	GatewayHandle *string           `json:"gateway_handle,omitempty"`
}

SubscriptionGroupBankAccount represents a SubscriptionGroupBankAccount struct.

func (*SubscriptionGroupBankAccount) MarshalJSON

func (s *SubscriptionGroupBankAccount) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupBankAccount. It customizes the JSON marshaling process for SubscriptionGroupBankAccount objects.

func (*SubscriptionGroupBankAccount) UnmarshalJSON

func (s *SubscriptionGroupBankAccount) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupBankAccount. It customizes the JSON unmarshaling process for SubscriptionGroupBankAccount objects.

type SubscriptionGroupComponentCustomPrice

type SubscriptionGroupComponentCustomPrice struct {
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme  *PricingScheme         `json:"pricing_scheme,omitempty"`
	Prices         []Price                `json:"prices,omitempty"`
	OveragePricing []ComponentCustomPrice `json:"overage_pricing,omitempty"`
}

SubscriptionGroupComponentCustomPrice represents a SubscriptionGroupComponentCustomPrice struct. Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`.

func (*SubscriptionGroupComponentCustomPrice) MarshalJSON

func (s *SubscriptionGroupComponentCustomPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupComponentCustomPrice. It customizes the JSON marshaling process for SubscriptionGroupComponentCustomPrice objects.

func (*SubscriptionGroupComponentCustomPrice) UnmarshalJSON

func (s *SubscriptionGroupComponentCustomPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupComponentCustomPrice. It customizes the JSON unmarshaling process for SubscriptionGroupComponentCustomPrice objects.

type SubscriptionGroupCreditCard

type SubscriptionGroupCreditCard struct {
	FullNumber      *interface{} `json:"full_number,omitempty"`
	ExpirationMonth *interface{} `json:"expiration_month,omitempty"`
	ExpirationYear  *interface{} `json:"expiration_year,omitempty"`
	ChargifyToken   *string      `json:"chargify_token,omitempty"`
	VaultToken      *string      `json:"vault_token,omitempty"`
	// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
	CurrentVault    *CurrentVault `json:"current_vault,omitempty"`
	GatewayHandle   *string       `json:"gateway_handle,omitempty"`
	FirstName       *string       `json:"first_name,omitempty"`
	LastName        *string       `json:"last_name,omitempty"`
	BillingAddress  *string       `json:"billing_address,omitempty"`
	BillingAddress2 *string       `json:"billing_address_2,omitempty"`
	BillingCity     *string       `json:"billing_city,omitempty"`
	BillingState    *string       `json:"billing_state,omitempty"`
	BillingZip      *string       `json:"billing_zip,omitempty"`
	BillingCountry  *string       `json:"billing_country,omitempty"`
	LastFour        *string       `json:"last_four,omitempty"`
	// The type of card used.
	CardType           *CardType `json:"card_type,omitempty"`
	CustomerVaultToken *string   `json:"customer_vault_token,omitempty"`
	Cvv                *string   `json:"cvv,omitempty"`
	PaymentType        *string   `json:"payment_type,omitempty"`
}

SubscriptionGroupCreditCard represents a SubscriptionGroupCreditCard struct.

func (*SubscriptionGroupCreditCard) MarshalJSON

func (s *SubscriptionGroupCreditCard) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCreditCard. It customizes the JSON marshaling process for SubscriptionGroupCreditCard objects.

func (*SubscriptionGroupCreditCard) UnmarshalJSON

func (s *SubscriptionGroupCreditCard) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCreditCard. It customizes the JSON unmarshaling process for SubscriptionGroupCreditCard objects.

type SubscriptionGroupCustomer

type SubscriptionGroupCustomer struct {
	FirstName    *string `json:"first_name,omitempty"`
	LastName     *string `json:"last_name,omitempty"`
	Organization *string `json:"organization,omitempty"`
	Email        *string `json:"email,omitempty"`
	Reference    *string `json:"reference,omitempty"`
}

SubscriptionGroupCustomer represents a SubscriptionGroupCustomer struct.

func (*SubscriptionGroupCustomer) MarshalJSON

func (s *SubscriptionGroupCustomer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupCustomer. It customizes the JSON marshaling process for SubscriptionGroupCustomer objects.

func (*SubscriptionGroupCustomer) UnmarshalJSON

func (s *SubscriptionGroupCustomer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupCustomer. It customizes the JSON unmarshaling process for SubscriptionGroupCustomer objects.

type SubscriptionGroupItem

type SubscriptionGroupItem struct {
	Id                      *int             `json:"id,omitempty"`
	Reference               Optional[string] `json:"reference"`
	ProductId               *int             `json:"product_id,omitempty"`
	ProductHandle           Optional[string] `json:"product_handle"`
	ProductPricePointId     *int             `json:"product_price_point_id,omitempty"`
	ProductPricePointHandle *string          `json:"product_price_point_handle,omitempty"`
	Currency                *string          `json:"currency,omitempty"`
	CouponCode              Optional[string] `json:"coupon_code"`
	TotalRevenueInCents     *int64           `json:"total_revenue_in_cents,omitempty"`
	BalanceInCents          *int64           `json:"balance_in_cents,omitempty"`
}

SubscriptionGroupItem represents a SubscriptionGroupItem struct.

func (*SubscriptionGroupItem) MarshalJSON

func (s *SubscriptionGroupItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupItem. It customizes the JSON marshaling process for SubscriptionGroupItem objects.

func (*SubscriptionGroupItem) UnmarshalJSON

func (s *SubscriptionGroupItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupItem. It customizes the JSON unmarshaling process for SubscriptionGroupItem objects.

type SubscriptionGroupMemberError

type SubscriptionGroupMemberError struct {
	Id      *int    `json:"id,omitempty"`
	Type    *string `json:"type,omitempty"`
	Message *string `json:"message,omitempty"`
}

SubscriptionGroupMemberError represents a SubscriptionGroupMemberError struct.

func (*SubscriptionGroupMemberError) MarshalJSON

func (s *SubscriptionGroupMemberError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupMemberError. It customizes the JSON marshaling process for SubscriptionGroupMemberError objects.

func (*SubscriptionGroupMemberError) UnmarshalJSON

func (s *SubscriptionGroupMemberError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupMemberError. It customizes the JSON unmarshaling process for SubscriptionGroupMemberError objects.

type SubscriptionGroupPaymentProfile

type SubscriptionGroupPaymentProfile struct {
	Id               *int    `json:"id,omitempty"`
	FirstName        *string `json:"first_name,omitempty"`
	LastName         *string `json:"last_name,omitempty"`
	MaskedCardNumber *string `json:"masked_card_number,omitempty"`
}

SubscriptionGroupPaymentProfile represents a SubscriptionGroupPaymentProfile struct.

func (*SubscriptionGroupPaymentProfile) MarshalJSON

func (s *SubscriptionGroupPaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPaymentProfile. It customizes the JSON marshaling process for SubscriptionGroupPaymentProfile objects.

func (*SubscriptionGroupPaymentProfile) UnmarshalJSON

func (s *SubscriptionGroupPaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPaymentProfile. It customizes the JSON unmarshaling process for SubscriptionGroupPaymentProfile objects.

type SubscriptionGroupPrepayment

type SubscriptionGroupPrepayment struct {
	Amount  int                               `json:"amount"`
	Details string                            `json:"details"`
	Memo    string                            `json:"memo"`
	Method  SubscriptionGroupPrepaymentMethod `json:"method"`
}

SubscriptionGroupPrepayment represents a SubscriptionGroupPrepayment struct.

func (*SubscriptionGroupPrepayment) MarshalJSON

func (s *SubscriptionGroupPrepayment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepayment. It customizes the JSON marshaling process for SubscriptionGroupPrepayment objects.

func (*SubscriptionGroupPrepayment) UnmarshalJSON

func (s *SubscriptionGroupPrepayment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepayment. It customizes the JSON unmarshaling process for SubscriptionGroupPrepayment objects.

type SubscriptionGroupPrepaymentMethod

type SubscriptionGroupPrepaymentMethod string

SubscriptionGroupPrepaymentMethod is a string enum.

const (
	SubscriptionGroupPrepaymentMethod_CHECK         SubscriptionGroupPrepaymentMethod = "check"
	SubscriptionGroupPrepaymentMethod_CASH          SubscriptionGroupPrepaymentMethod = "cash"
	SubscriptionGroupPrepaymentMethod_MONEYORDER    SubscriptionGroupPrepaymentMethod = "money_order"
	SubscriptionGroupPrepaymentMethod_ACH           SubscriptionGroupPrepaymentMethod = "ach"
	SubscriptionGroupPrepaymentMethod_PAYPALACCOUNT SubscriptionGroupPrepaymentMethod = "paypal_account"
	SubscriptionGroupPrepaymentMethod_OTHER         SubscriptionGroupPrepaymentMethod = "other"
)

type SubscriptionGroupPrepaymentRequest

type SubscriptionGroupPrepaymentRequest struct {
	Prepayment SubscriptionGroupPrepayment `json:"prepayment"`
}

SubscriptionGroupPrepaymentRequest represents a SubscriptionGroupPrepaymentRequest struct.

func (*SubscriptionGroupPrepaymentRequest) MarshalJSON

func (s *SubscriptionGroupPrepaymentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentRequest. It customizes the JSON marshaling process for SubscriptionGroupPrepaymentRequest objects.

func (*SubscriptionGroupPrepaymentRequest) UnmarshalJSON

func (s *SubscriptionGroupPrepaymentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentRequest. It customizes the JSON unmarshaling process for SubscriptionGroupPrepaymentRequest objects.

type SubscriptionGroupPrepaymentResponse

type SubscriptionGroupPrepaymentResponse struct {
	Id *int `json:"id,omitempty"`
	// The amount in cents of the entry.
	AmountInCents *int64 `json:"amount_in_cents,omitempty"`
	// The ending balance in cents of the account.
	EndingBalanceInCents *int64 `json:"ending_balance_in_cents,omitempty"`
	// The type of entry
	EntryType *ServiceCreditType `json:"entry_type,omitempty"`
	// A memo attached to the entry.
	Memo *string `json:"memo,omitempty"`
}

SubscriptionGroupPrepaymentResponse represents a SubscriptionGroupPrepaymentResponse struct.

func (*SubscriptionGroupPrepaymentResponse) MarshalJSON

func (s *SubscriptionGroupPrepaymentResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupPrepaymentResponse. It customizes the JSON marshaling process for SubscriptionGroupPrepaymentResponse objects.

func (*SubscriptionGroupPrepaymentResponse) UnmarshalJSON

func (s *SubscriptionGroupPrepaymentResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupPrepaymentResponse. It customizes the JSON unmarshaling process for SubscriptionGroupPrepaymentResponse objects.

type SubscriptionGroupResponse

type SubscriptionGroupResponse struct {
	SubscriptionGroup SubscriptionGroup `json:"subscription_group"`
}

SubscriptionGroupResponse represents a SubscriptionGroupResponse struct.

func (*SubscriptionGroupResponse) MarshalJSON

func (s *SubscriptionGroupResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupResponse. It customizes the JSON marshaling process for SubscriptionGroupResponse objects.

func (*SubscriptionGroupResponse) UnmarshalJSON

func (s *SubscriptionGroupResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupResponse. It customizes the JSON unmarshaling process for SubscriptionGroupResponse objects.

type SubscriptionGroupSignup

type SubscriptionGroupSignup struct {
	PaymentProfileId *int    `json:"payment_profile_id,omitempty"`
	PayerId          *int    `json:"payer_id,omitempty"`
	PayerReference   *string `json:"payer_reference,omitempty"`
	// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
	PaymentCollectionMethod *CollectionMethod             `json:"payment_collection_method,omitempty"`
	PayerAttributes         *PayerAttributes              `json:"payer_attributes,omitempty"`
	CreditCardAttributes    *SubscriptionGroupCreditCard  `json:"credit_card_attributes,omitempty"`
	BankAccountAttributes   *SubscriptionGroupBankAccount `json:"bank_account_attributes,omitempty"`
	Subscriptions           []SubscriptionGroupSignupItem `json:"subscriptions"`
}

SubscriptionGroupSignup represents a SubscriptionGroupSignup struct.

func (*SubscriptionGroupSignup) MarshalJSON

func (s *SubscriptionGroupSignup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignup. It customizes the JSON marshaling process for SubscriptionGroupSignup objects.

func (*SubscriptionGroupSignup) UnmarshalJSON

func (s *SubscriptionGroupSignup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignup. It customizes the JSON unmarshaling process for SubscriptionGroupSignup objects.

type SubscriptionGroupSignupComponent

type SubscriptionGroupSignupComponent struct {
	// Required if passing any component to `components` attribute.
	ComponentId       *interface{} `json:"component_id,omitempty"`
	AllocatedQuantity *interface{} `json:"allocated_quantity,omitempty"`
	UnitBalance       *interface{} `json:"unit_balance,omitempty"`
	PricePointId      *interface{} `json:"price_point_id,omitempty"`
	// Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`.
	CustomPrice *SubscriptionGroupComponentCustomPrice `json:"custom_price,omitempty"`
}

SubscriptionGroupSignupComponent represents a SubscriptionGroupSignupComponent struct.

func (*SubscriptionGroupSignupComponent) MarshalJSON

func (s *SubscriptionGroupSignupComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupComponent. It customizes the JSON marshaling process for SubscriptionGroupSignupComponent objects.

func (*SubscriptionGroupSignupComponent) UnmarshalJSON

func (s *SubscriptionGroupSignupComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupComponent. It customizes the JSON unmarshaling process for SubscriptionGroupSignupComponent objects.

type SubscriptionGroupSignupError

type SubscriptionGroupSignupError struct {
	// Object that as key have subscription position in request subscriptions array and as value subscription errors object.
	Subscriptions     map[string]SubscriptionGroupSubscriptionError `json:"subscriptions,omitempty"`
	PayerReference    *string                                       `json:"payer_reference,omitempty"`
	Payer             *PayerError                                   `json:"payer,omitempty"`
	SubscriptionGroup []string                                      `json:"subscription_group,omitempty"`
	PaymentProfileId  *string                                       `json:"payment_profile_id,omitempty"`
	PayerId           *string                                       `json:"payer_id,omitempty"`
}

SubscriptionGroupSignupError represents a SubscriptionGroupSignupError struct.

func (*SubscriptionGroupSignupError) MarshalJSON

func (s *SubscriptionGroupSignupError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupError. It customizes the JSON marshaling process for SubscriptionGroupSignupError objects.

func (*SubscriptionGroupSignupError) UnmarshalJSON

func (s *SubscriptionGroupSignupError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupError. It customizes the JSON unmarshaling process for SubscriptionGroupSignupError objects.

type SubscriptionGroupSignupItem

type SubscriptionGroupSignupItem struct {
	// The API Handle of the product for which you are creating a subscription. Required, unless a `product_id` is given instead.
	ProductHandle *string `json:"product_handle,omitempty"`
	// The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`.
	ProductId *int `json:"product_id,omitempty"`
	// The ID of the particular price point on the product.
	ProductPricePointId *int `json:"product_price_point_id,omitempty"`
	// The user-friendly API handle of a product's particular price point.
	ProductPricePointHandle *string `json:"product_price_point_handle,omitempty"`
	// Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`
	OfferId *int `json:"offer_id,omitempty"`
	// The reference value (provided by your app) for the subscription itelf.
	Reference *string `json:"reference,omitempty"`
	// One of the subscriptions must be marked as primary in the group.
	Primary *bool `json:"primary,omitempty"`
	// (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription.
	Currency *string `json:"currency,omitempty"`
	// An array for all the coupons attached to the subscription.
	CouponCodes []string                           `json:"coupon_codes,omitempty"`
	Components  []SubscriptionGroupSignupComponent `json:"components,omitempty"`
	// (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription
	CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"`
	// (Optional). Cannot be used when also specifying next_billing_at
	CalendarBilling *CalendarBilling `json:"calendar_billing,omitempty"`
	// (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet.
	Metafields map[string]string `json:"metafields,omitempty"`
}

SubscriptionGroupSignupItem represents a SubscriptionGroupSignupItem struct.

func (*SubscriptionGroupSignupItem) MarshalJSON

func (s *SubscriptionGroupSignupItem) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupItem. It customizes the JSON marshaling process for SubscriptionGroupSignupItem objects.

func (*SubscriptionGroupSignupItem) UnmarshalJSON

func (s *SubscriptionGroupSignupItem) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupItem. It customizes the JSON unmarshaling process for SubscriptionGroupSignupItem objects.

type SubscriptionGroupSignupRequest

type SubscriptionGroupSignupRequest struct {
	SubscriptionGroup SubscriptionGroupSignup `json:"subscription_group"`
}

SubscriptionGroupSignupRequest represents a SubscriptionGroupSignupRequest struct.

func (*SubscriptionGroupSignupRequest) MarshalJSON

func (s *SubscriptionGroupSignupRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupRequest. It customizes the JSON marshaling process for SubscriptionGroupSignupRequest objects.

func (*SubscriptionGroupSignupRequest) UnmarshalJSON

func (s *SubscriptionGroupSignupRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupRequest. It customizes the JSON unmarshaling process for SubscriptionGroupSignupRequest objects.

type SubscriptionGroupSignupResponse

type SubscriptionGroupSignupResponse struct {
	Uid                   *string                 `json:"uid,omitempty"`
	Scheme                *int                    `json:"scheme,omitempty"`
	CustomerId            *int                    `json:"customer_id,omitempty"`
	PaymentProfileId      *int                    `json:"payment_profile_id,omitempty"`
	SubscriptionIds       []int                   `json:"subscription_ids,omitempty"`
	PrimarySubscriptionId *int                    `json:"primary_subscription_id,omitempty"`
	NextAssessmentAt      *string                 `json:"next_assessment_at,omitempty"`
	State                 *string                 `json:"state,omitempty"`
	CancelAtEndOfPeriod   *bool                   `json:"cancel_at_end_of_period,omitempty"`
	Subscriptions         []SubscriptionGroupItem `json:"subscriptions,omitempty"`
	// The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`.
	PaymentCollectionMethod *CollectionMethod `json:"payment_collection_method,omitempty"`
}

SubscriptionGroupSignupResponse represents a SubscriptionGroupSignupResponse struct.

func (*SubscriptionGroupSignupResponse) MarshalJSON

func (s *SubscriptionGroupSignupResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSignupResponse. It customizes the JSON marshaling process for SubscriptionGroupSignupResponse objects.

func (*SubscriptionGroupSignupResponse) UnmarshalJSON

func (s *SubscriptionGroupSignupResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSignupResponse. It customizes the JSON unmarshaling process for SubscriptionGroupSignupResponse objects.

type SubscriptionGroupSubscriptionError

type SubscriptionGroupSubscriptionError struct {
	Product                     []string `json:"product,omitempty"`
	ProductPricePointId         []string `json:"product_price_point_id,omitempty"`
	PaymentProfile              []string `json:"payment_profile,omitempty"`
	PaymentProfileChargifyToken []string `json:"payment_profile.chargify_token,omitempty"`
}

SubscriptionGroupSubscriptionError represents a SubscriptionGroupSubscriptionError struct. Object which contains subscription errors.

func (*SubscriptionGroupSubscriptionError) MarshalJSON

func (s *SubscriptionGroupSubscriptionError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupSubscriptionError. It customizes the JSON marshaling process for SubscriptionGroupSubscriptionError objects.

func (*SubscriptionGroupSubscriptionError) UnmarshalJSON

func (s *SubscriptionGroupSubscriptionError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupSubscriptionError. It customizes the JSON unmarshaling process for SubscriptionGroupSubscriptionError objects.

type SubscriptionGroupUpdateError

type SubscriptionGroupUpdateError struct {
	Members []SubscriptionGroupMemberError `json:"members,omitempty"`
}

SubscriptionGroupUpdateError represents a SubscriptionGroupUpdateError struct.

func (*SubscriptionGroupUpdateError) MarshalJSON

func (s *SubscriptionGroupUpdateError) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionGroupUpdateError. It customizes the JSON marshaling process for SubscriptionGroupUpdateError objects.

func (*SubscriptionGroupUpdateError) UnmarshalJSON

func (s *SubscriptionGroupUpdateError) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionGroupUpdateError. It customizes the JSON unmarshaling process for SubscriptionGroupUpdateError objects.

type SubscriptionInclude

type SubscriptionInclude string

SubscriptionInclude is a string enum.

const (
	SubscriptionInclude_COUPONS              SubscriptionInclude = "coupons"
	SubscriptionInclude_SELFSERVICEPAGETOKEN SubscriptionInclude = "self_service_page_token"
)

type SubscriptionIncludedCoupon

type SubscriptionIncludedCoupon struct {
	Code          *string          `json:"code,omitempty"`
	UseCount      *int             `json:"use_count,omitempty"`
	UsesAllowed   *int             `json:"uses_allowed,omitempty"`
	ExpiresAt     Optional[string] `json:"expires_at"`
	Recurring     *bool            `json:"recurring,omitempty"`
	AmountInCents Optional[int64]  `json:"amount_in_cents"`
	Percentage    Optional[string] `json:"percentage"`
}

SubscriptionIncludedCoupon represents a SubscriptionIncludedCoupon struct.

func (*SubscriptionIncludedCoupon) MarshalJSON

func (s *SubscriptionIncludedCoupon) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionIncludedCoupon. It customizes the JSON marshaling process for SubscriptionIncludedCoupon objects.

func (*SubscriptionIncludedCoupon) UnmarshalJSON

func (s *SubscriptionIncludedCoupon) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionIncludedCoupon. It customizes the JSON unmarshaling process for SubscriptionIncludedCoupon objects.

type SubscriptionListDateField

type SubscriptionListDateField string

SubscriptionListDateField is a string enum.

const (
	SubscriptionListDateField_UPDATEDAT SubscriptionListDateField = "updated_at"
)

type SubscriptionListInclude

type SubscriptionListInclude string

SubscriptionListInclude is a string enum.

const (
	SubscriptionListInclude_SELFSERVICEPAGETOKEN SubscriptionListInclude = "self_service_page_token"
)

type SubscriptionMRR

type SubscriptionMRR struct {
	SubscriptionId   int                      `json:"subscription_id"`
	MrrAmountInCents int64                    `json:"mrr_amount_in_cents"`
	Breakouts        *SubscriptionMRRBreakout `json:"breakouts,omitempty"`
}

SubscriptionMRR represents a SubscriptionMRR struct.

func (*SubscriptionMRR) MarshalJSON

func (s *SubscriptionMRR) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMRR. It customizes the JSON marshaling process for SubscriptionMRR objects.

func (*SubscriptionMRR) UnmarshalJSON

func (s *SubscriptionMRR) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRR. It customizes the JSON unmarshaling process for SubscriptionMRR objects.

type SubscriptionMRRBreakout

type SubscriptionMRRBreakout struct {
	PlanAmountInCents  int64 `json:"plan_amount_in_cents"`
	UsageAmountInCents int64 `json:"usage_amount_in_cents"`
}

SubscriptionMRRBreakout represents a SubscriptionMRRBreakout struct.

func (*SubscriptionMRRBreakout) MarshalJSON

func (s *SubscriptionMRRBreakout) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMRRBreakout. It customizes the JSON marshaling process for SubscriptionMRRBreakout objects.

func (*SubscriptionMRRBreakout) UnmarshalJSON

func (s *SubscriptionMRRBreakout) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRBreakout. It customizes the JSON unmarshaling process for SubscriptionMRRBreakout objects.

type SubscriptionMRRResponse

type SubscriptionMRRResponse struct {
	SubscriptionsMrr []SubscriptionMRR `json:"subscriptions_mrr"`
}

SubscriptionMRRResponse represents a SubscriptionMRRResponse struct.

func (*SubscriptionMRRResponse) MarshalJSON

func (s *SubscriptionMRRResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMRRResponse. It customizes the JSON marshaling process for SubscriptionMRRResponse objects.

func (*SubscriptionMRRResponse) UnmarshalJSON

func (s *SubscriptionMRRResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMRRResponse. It customizes the JSON unmarshaling process for SubscriptionMRRResponse objects.

type SubscriptionMigrationPreview

type SubscriptionMigrationPreview struct {
	// The amount of the prorated adjustment that would be issued for the current subscription.
	ProratedAdjustmentInCents *int64 `json:"prorated_adjustment_in_cents,omitempty"`
	// The amount of the charge that would be created for the new product.
	ChargeInCents *int64 `json:"charge_in_cents,omitempty"`
	// The amount of the payment due in the case of an upgrade.
	PaymentDueInCents *int64 `json:"payment_due_in_cents,omitempty"`
	// Represents a credit in cents that is applied to your subscription as part of a migration process for a specific product, which reduces the amount owed for the subscription.
	CreditAppliedInCents *int64 `json:"credit_applied_in_cents,omitempty"`
}

SubscriptionMigrationPreview represents a SubscriptionMigrationPreview struct.

func (*SubscriptionMigrationPreview) MarshalJSON

func (s *SubscriptionMigrationPreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreview. It customizes the JSON marshaling process for SubscriptionMigrationPreview objects.

func (*SubscriptionMigrationPreview) UnmarshalJSON

func (s *SubscriptionMigrationPreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreview. It customizes the JSON unmarshaling process for SubscriptionMigrationPreview objects.

type SubscriptionMigrationPreviewOptions

type SubscriptionMigrationPreviewOptions struct {
	// The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well.
	ProductId *int `json:"product_id,omitempty"`
	// The ID of the specified product's price point. This can be passed to migrate to a non-default price point.
	ProductPricePointId *int `json:"product_price_point_id,omitempty"`
	// Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
	IncludeTrial *bool `json:"include_trial,omitempty"`
	// If `true` is sent initial charges will be assessed.
	IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"`
	// If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
	IncludeCoupons *bool `json:"include_coupons,omitempty"`
	// If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
	PreservePeriod *bool `json:"preserve_period,omitempty"`
	// The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well.
	ProductHandle *string `json:"product_handle,omitempty"`
	// The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point.
	ProductPricePointHandle *string    `json:"product_price_point_handle,omitempty"`
	Proration               *Proration `json:"proration,omitempty"`
	// The date that the proration is calculated from for the preview
	ProrationDate *string `json:"proration_date,omitempty"`
}

SubscriptionMigrationPreviewOptions represents a SubscriptionMigrationPreviewOptions struct.

func (*SubscriptionMigrationPreviewOptions) MarshalJSON

func (s *SubscriptionMigrationPreviewOptions) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewOptions. It customizes the JSON marshaling process for SubscriptionMigrationPreviewOptions objects.

func (*SubscriptionMigrationPreviewOptions) UnmarshalJSON

func (s *SubscriptionMigrationPreviewOptions) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewOptions. It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewOptions objects.

type SubscriptionMigrationPreviewRequest

type SubscriptionMigrationPreviewRequest struct {
	Migration SubscriptionMigrationPreviewOptions `json:"migration"`
}

SubscriptionMigrationPreviewRequest represents a SubscriptionMigrationPreviewRequest struct.

func (*SubscriptionMigrationPreviewRequest) MarshalJSON

func (s *SubscriptionMigrationPreviewRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewRequest. It customizes the JSON marshaling process for SubscriptionMigrationPreviewRequest objects.

func (*SubscriptionMigrationPreviewRequest) UnmarshalJSON

func (s *SubscriptionMigrationPreviewRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewRequest. It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewRequest objects.

type SubscriptionMigrationPreviewResponse

type SubscriptionMigrationPreviewResponse struct {
	Migration SubscriptionMigrationPreview `json:"migration"`
}

SubscriptionMigrationPreviewResponse represents a SubscriptionMigrationPreviewResponse struct.

func (*SubscriptionMigrationPreviewResponse) MarshalJSON

func (s *SubscriptionMigrationPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionMigrationPreviewResponse. It customizes the JSON marshaling process for SubscriptionMigrationPreviewResponse objects.

func (*SubscriptionMigrationPreviewResponse) UnmarshalJSON

func (s *SubscriptionMigrationPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionMigrationPreviewResponse. It customizes the JSON unmarshaling process for SubscriptionMigrationPreviewResponse objects.

type SubscriptionNote

type SubscriptionNote struct {
	Id             *int    `json:"id,omitempty"`
	Body           *string `json:"body,omitempty"`
	SubscriptionId *int    `json:"subscription_id,omitempty"`
	CreatedAt      *string `json:"created_at,omitempty"`
	UpdatedAt      *string `json:"updated_at,omitempty"`
	Sticky         *bool   `json:"sticky,omitempty"`
}

SubscriptionNote represents a SubscriptionNote struct.

func (*SubscriptionNote) MarshalJSON

func (s *SubscriptionNote) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionNote. It customizes the JSON marshaling process for SubscriptionNote objects.

func (*SubscriptionNote) UnmarshalJSON

func (s *SubscriptionNote) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNote. It customizes the JSON unmarshaling process for SubscriptionNote objects.

type SubscriptionNoteResponse

type SubscriptionNoteResponse struct {
	Note SubscriptionNote `json:"note"`
}

SubscriptionNoteResponse represents a SubscriptionNoteResponse struct.

func (*SubscriptionNoteResponse) MarshalJSON

func (s *SubscriptionNoteResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionNoteResponse. It customizes the JSON marshaling process for SubscriptionNoteResponse objects.

func (*SubscriptionNoteResponse) UnmarshalJSON

func (s *SubscriptionNoteResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionNoteResponse. It customizes the JSON unmarshaling process for SubscriptionNoteResponse objects.

type SubscriptionPreview

type SubscriptionPreview struct {
	CurrentBillingManifest *BillingManifest `json:"current_billing_manifest,omitempty"`
	NextBillingManifest    *BillingManifest `json:"next_billing_manifest,omitempty"`
}

SubscriptionPreview represents a SubscriptionPreview struct.

func (*SubscriptionPreview) MarshalJSON

func (s *SubscriptionPreview) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionPreview. It customizes the JSON marshaling process for SubscriptionPreview objects.

func (*SubscriptionPreview) UnmarshalJSON

func (s *SubscriptionPreview) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreview. It customizes the JSON unmarshaling process for SubscriptionPreview objects.

type SubscriptionPreviewResponse

type SubscriptionPreviewResponse struct {
	SubscriptionPreview SubscriptionPreview `json:"subscription_preview"`
}

SubscriptionPreviewResponse represents a SubscriptionPreviewResponse struct.

func (*SubscriptionPreviewResponse) MarshalJSON

func (s *SubscriptionPreviewResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionPreviewResponse. It customizes the JSON marshaling process for SubscriptionPreviewResponse objects.

func (*SubscriptionPreviewResponse) UnmarshalJSON

func (s *SubscriptionPreviewResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionPreviewResponse. It customizes the JSON unmarshaling process for SubscriptionPreviewResponse objects.

type SubscriptionProductMigration

type SubscriptionProductMigration struct {
	// The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well.
	ProductId *int `json:"product_id,omitempty"`
	// The ID of the specified product's price point. This can be passed to migrate to a non-default price point.
	ProductPricePointId *int `json:"product_price_point_id,omitempty"`
	// Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
	IncludeTrial *bool `json:"include_trial,omitempty"`
	// If `true` is sent initial charges will be assessed.
	IncludeInitialCharge *bool `json:"include_initial_charge,omitempty"`
	// If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
	IncludeCoupons *bool `json:"include_coupons,omitempty"`
	// If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
	PreservePeriod *bool `json:"preserve_period,omitempty"`
	// The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well.
	ProductHandle *string `json:"product_handle,omitempty"`
	// The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point.
	ProductPricePointHandle *string    `json:"product_price_point_handle,omitempty"`
	Proration               *Proration `json:"proration,omitempty"`
}

SubscriptionProductMigration represents a SubscriptionProductMigration struct.

func (*SubscriptionProductMigration) MarshalJSON

func (s *SubscriptionProductMigration) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigration. It customizes the JSON marshaling process for SubscriptionProductMigration objects.

func (*SubscriptionProductMigration) UnmarshalJSON

func (s *SubscriptionProductMigration) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigration. It customizes the JSON unmarshaling process for SubscriptionProductMigration objects.

type SubscriptionProductMigrationRequest

type SubscriptionProductMigrationRequest struct {
	Migration SubscriptionProductMigration `json:"migration"`
}

SubscriptionProductMigrationRequest represents a SubscriptionProductMigrationRequest struct.

func (*SubscriptionProductMigrationRequest) MarshalJSON

func (s *SubscriptionProductMigrationRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionProductMigrationRequest. It customizes the JSON marshaling process for SubscriptionProductMigrationRequest objects.

func (*SubscriptionProductMigrationRequest) UnmarshalJSON

func (s *SubscriptionProductMigrationRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionProductMigrationRequest. It customizes the JSON unmarshaling process for SubscriptionProductMigrationRequest objects.

type SubscriptionPurgeType

type SubscriptionPurgeType string

SubscriptionPurgeType is a string enum.

const (
	SubscriptionPurgeType_CUSTOMER       SubscriptionPurgeType = "customer"
	SubscriptionPurgeType_PAYMENTPROFILE SubscriptionPurgeType = "payment_profile"
)

type SubscriptionResponse

type SubscriptionResponse struct {
	Subscription *Subscription `json:"subscription,omitempty"`
}

SubscriptionResponse represents a SubscriptionResponse struct.

func (*SubscriptionResponse) MarshalJSON

func (s *SubscriptionResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for SubscriptionResponse. It customizes the JSON marshaling process for SubscriptionResponse objects.

func (*SubscriptionResponse) UnmarshalJSON

func (s *SubscriptionResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SubscriptionResponse. It customizes the JSON unmarshaling process for SubscriptionResponse objects.

type SubscriptionSort

type SubscriptionSort string

SubscriptionSort is a string enum.

const (
	SubscriptionSort_SIGNUPDATE     SubscriptionSort = "signup_date"
	SubscriptionSort_PERIODSTART    SubscriptionSort = "period_start"
	SubscriptionSort_PERIODEND      SubscriptionSort = "period_end"
	SubscriptionSort_NEXTASSESSMENT SubscriptionSort = "next_assessment"
	SubscriptionSort_UPDATEDAT      SubscriptionSort = "updated_at"
	SubscriptionSort_CREATEDAT      SubscriptionSort = "created_at"
)

type SubscriptionState

type SubscriptionState string

SubscriptionState is a string enum. The state of a subscription. * **Live States**

  • `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
  • `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
  • `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
  • `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
  • `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.

* **Problem States**

  • `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
  • `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
  • `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405505141005) settings to have a Final Action of `mark the subscription unpaid`.

* **End of Life States**

  • `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405505141005) process without payment. See the [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559291021) documentation for info on how to restart a canceled subscription. While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
  • `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
  • `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
  • `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
  • `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
  • `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221) for more details.

See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773) for more info about subscription states and state transitions.

const (
	SubscriptionState_PENDING        SubscriptionState = "pending"
	SubscriptionState_FAILEDTOCREATE SubscriptionState = "failed_to_create"
	SubscriptionState_TRIALING       SubscriptionState = "trialing"
	SubscriptionState_ASSESSING      SubscriptionState = "assessing"
	SubscriptionState_ACTIVE         SubscriptionState = "active"
	SubscriptionState_SOFTFAILURE    SubscriptionState = "soft_failure"
	SubscriptionState_PASTDUE        SubscriptionState = "past_due"
	SubscriptionState_SUSPENDED      SubscriptionState = "suspended"
	SubscriptionState_CANCELED       SubscriptionState = "canceled"
	SubscriptionState_EXPIRED        SubscriptionState = "expired"
	SubscriptionState_PAUSED         SubscriptionState = "paused"
	SubscriptionState_UNPAID         SubscriptionState = "unpaid"
	SubscriptionState_TRIALENDED     SubscriptionState = "trial_ended"
	SubscriptionState_ONHOLD         SubscriptionState = "on_hold"
	SubscriptionState_AWAITINGSIGNUP SubscriptionState = "awaiting_signup"
)

type SubscriptionStateFilter

type SubscriptionStateFilter string

SubscriptionStateFilter is a string enum. Allowed values for filtering by the current state of the subscription.

const (
	SubscriptionStateFilter_ACTIVE              SubscriptionStateFilter = "active"
	SubscriptionStateFilter_CANCELED            SubscriptionStateFilter = "canceled"
	SubscriptionStateFilter_EXPIRED             SubscriptionStateFilter = "expired"
	SubscriptionStateFilter_EXPIREDCARDS        SubscriptionStateFilter = "expired_cards"
	SubscriptionStateFilter_ONHOLD              SubscriptionStateFilter = "on_hold"
	SubscriptionStateFilter_PASTDUE             SubscriptionStateFilter = "past_due"
	SubscriptionStateFilter_PENDINGCANCELLATION SubscriptionStateFilter = "pending_cancellation"
	SubscriptionStateFilter_PENDINGRENEWAL      SubscriptionStateFilter = "pending_renewal"
	SubscriptionStateFilter_SUSPENDED           SubscriptionStateFilter = "suspended"
	SubscriptionStateFilter_TRIALENDED          SubscriptionStateFilter = "trial_ended"
	SubscriptionStateFilter_TRIALING            SubscriptionStateFilter = "trialing"
	SubscriptionStateFilter_UNPAID              SubscriptionStateFilter = "unpaid"
)

type TaxConfiguration

type TaxConfiguration struct {
	Kind               *TaxConfigurationKind  `json:"kind,omitempty"`
	DestinationAddress *TaxDestinationAddress `json:"destination_address,omitempty"`
	// Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-Introduction
	FullyConfigured *bool `json:"fully_configured,omitempty"`
}

TaxConfiguration represents a TaxConfiguration struct.

func (*TaxConfiguration) MarshalJSON

func (t *TaxConfiguration) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for TaxConfiguration. It customizes the JSON marshaling process for TaxConfiguration objects.

func (*TaxConfiguration) UnmarshalJSON

func (t *TaxConfiguration) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TaxConfiguration. It customizes the JSON unmarshaling process for TaxConfiguration objects.

type TaxConfigurationKind

type TaxConfigurationKind string

TaxConfigurationKind is a string enum.

const (
	TaxConfigurationKind_CUSTOM             TaxConfigurationKind = "custom"
	TaxConfigurationKind_ENUMMANAGEDAVALARA TaxConfigurationKind = "managed avalara"
	TaxConfigurationKind_ENUMLINKEDAVALARA  TaxConfigurationKind = "linked avalara"
	TaxConfigurationKind_ENUMDIGITALRIVER   TaxConfigurationKind = "digital river"
)

type TaxDestinationAddress

type TaxDestinationAddress string

TaxDestinationAddress is a string enum.

const (
	TaxDestinationAddress_SHIPPINGTHENBILLING TaxDestinationAddress = "shipping_then_billing"
	TaxDestinationAddress_BILLINGTHENSHIPPING TaxDestinationAddress = "billing_then_shipping"
	TaxDestinationAddress_SHIPPINGONLY        TaxDestinationAddress = "shipping_only"
	TaxDestinationAddress_BILLINGONLY         TaxDestinationAddress = "billing_only"
)

type TooManyManagementLinkRequests

type TooManyManagementLinkRequests struct {
	Error              string    `json:"error"`
	NewLinkAvailableAt time.Time `json:"new_link_available_at"`
}

TooManyManagementLinkRequests represents a TooManyManagementLinkRequests struct.

func (*TooManyManagementLinkRequests) MarshalJSON

func (t *TooManyManagementLinkRequests) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for TooManyManagementLinkRequests. It customizes the JSON marshaling process for TooManyManagementLinkRequests objects.

func (*TooManyManagementLinkRequests) UnmarshalJSON

func (t *TooManyManagementLinkRequests) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TooManyManagementLinkRequests. It customizes the JSON unmarshaling process for TooManyManagementLinkRequests objects.

type UpdateAllocationExpirationDate

type UpdateAllocationExpirationDate struct {
	Allocation *AllocationExpirationDate `json:"allocation,omitempty"`
}

UpdateAllocationExpirationDate represents a UpdateAllocationExpirationDate struct.

func (*UpdateAllocationExpirationDate) MarshalJSON

func (u *UpdateAllocationExpirationDate) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateAllocationExpirationDate. It customizes the JSON marshaling process for UpdateAllocationExpirationDate objects.

func (*UpdateAllocationExpirationDate) UnmarshalJSON

func (u *UpdateAllocationExpirationDate) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateAllocationExpirationDate. It customizes the JSON unmarshaling process for UpdateAllocationExpirationDate objects.

type UpdateComponent

type UpdateComponent struct {
	Handle *string `json:"handle,omitempty"`
	// The name of the Component, suitable for display on statements. i.e. Text Messages.
	Name *string `json:"name,omitempty"`
	// The description of the component.
	Description    Optional[string] `json:"description"`
	AccountingCode Optional[string] `json:"accounting_code"`
	// Boolean flag describing whether a component is taxable or not.
	Taxable *bool `json:"taxable,omitempty"`
	// A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
	TaxCode Optional[string] `json:"tax_code"`
	// One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other
	ItemCategory        Optional[ItemCategory] `json:"item_category"`
	DisplayOnHostedPage *bool                  `json:"display_on_hosted_page,omitempty"`
	// The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
	// Available values: `full`, `prorated`, `none`.
	UpgradeCharge Optional[CreditType] `json:"upgrade_charge"`
}

UpdateComponent represents a UpdateComponent struct.

func (*UpdateComponent) MarshalJSON

func (u *UpdateComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateComponent. It customizes the JSON marshaling process for UpdateComponent objects.

func (*UpdateComponent) UnmarshalJSON

func (u *UpdateComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponent. It customizes the JSON unmarshaling process for UpdateComponent objects.

type UpdateComponentPricePoint

type UpdateComponentPricePoint struct {
	Name   *string `json:"name,omitempty"`
	Handle *string `json:"handle,omitempty"`
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme *PricingScheme `json:"pricing_scheme,omitempty"`
	// Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
	UseSiteExchangeRate *bool `json:"use_site_exchange_rate,omitempty"`
	// Whether or not the price point includes tax
	TaxIncluded *bool `json:"tax_included,omitempty"`
	// The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
	Interval *int `json:"interval,omitempty"`
	// A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
	IntervalUnit *IntervalUnit `json:"interval_unit,omitempty"`
	Prices       []UpdatePrice `json:"prices,omitempty"`
}

UpdateComponentPricePoint represents a UpdateComponentPricePoint struct.

func (*UpdateComponentPricePoint) MarshalJSON

func (u *UpdateComponentPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePoint. It customizes the JSON marshaling process for UpdateComponentPricePoint objects.

func (*UpdateComponentPricePoint) UnmarshalJSON

func (u *UpdateComponentPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePoint. It customizes the JSON unmarshaling process for UpdateComponentPricePoint objects.

type UpdateComponentPricePointRequest

type UpdateComponentPricePointRequest struct {
	PricePoint *UpdateComponentPricePoint `json:"price_point,omitempty"`
}

UpdateComponentPricePointRequest represents a UpdateComponentPricePointRequest struct.

func (*UpdateComponentPricePointRequest) MarshalJSON

func (u *UpdateComponentPricePointRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateComponentPricePointRequest. It customizes the JSON marshaling process for UpdateComponentPricePointRequest objects.

func (*UpdateComponentPricePointRequest) UnmarshalJSON

func (u *UpdateComponentPricePointRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentPricePointRequest. It customizes the JSON unmarshaling process for UpdateComponentPricePointRequest objects.

type UpdateComponentRequest

type UpdateComponentRequest struct {
	Component UpdateComponent `json:"component"`
}

UpdateComponentRequest represents a UpdateComponentRequest struct.

func (*UpdateComponentRequest) MarshalJSON

func (u *UpdateComponentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateComponentRequest. It customizes the JSON marshaling process for UpdateComponentRequest objects.

func (*UpdateComponentRequest) UnmarshalJSON

func (u *UpdateComponentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateComponentRequest. It customizes the JSON unmarshaling process for UpdateComponentRequest objects.

type UpdateCouponCurrency

type UpdateCouponCurrency struct {
	// ISO code for the site defined currency.
	Currency string `json:"currency"`
	// Price for the given currency.
	Price int `json:"price"`
}

UpdateCouponCurrency represents a UpdateCouponCurrency struct.

func (*UpdateCouponCurrency) MarshalJSON

func (u *UpdateCouponCurrency) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateCouponCurrency. It customizes the JSON marshaling process for UpdateCouponCurrency objects.

func (*UpdateCouponCurrency) UnmarshalJSON

func (u *UpdateCouponCurrency) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateCouponCurrency. It customizes the JSON unmarshaling process for UpdateCouponCurrency objects.

type UpdateCurrencyPrice

type UpdateCurrencyPrice struct {
	// ID of the currency price record being updated
	Id int `json:"id"`
	// New price for the given currency
	Price int `json:"price"`
}

UpdateCurrencyPrice represents a UpdateCurrencyPrice struct.

func (*UpdateCurrencyPrice) MarshalJSON

func (u *UpdateCurrencyPrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPrice. It customizes the JSON marshaling process for UpdateCurrencyPrice objects.

func (*UpdateCurrencyPrice) UnmarshalJSON

func (u *UpdateCurrencyPrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPrice. It customizes the JSON unmarshaling process for UpdateCurrencyPrice objects.

type UpdateCurrencyPricesRequest

type UpdateCurrencyPricesRequest struct {
	CurrencyPrices []UpdateCurrencyPrice `json:"currency_prices"`
}

UpdateCurrencyPricesRequest represents a UpdateCurrencyPricesRequest struct.

func (*UpdateCurrencyPricesRequest) MarshalJSON

func (u *UpdateCurrencyPricesRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateCurrencyPricesRequest. It customizes the JSON marshaling process for UpdateCurrencyPricesRequest objects.

func (*UpdateCurrencyPricesRequest) UnmarshalJSON

func (u *UpdateCurrencyPricesRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateCurrencyPricesRequest. It customizes the JSON unmarshaling process for UpdateCurrencyPricesRequest objects.

type UpdateCustomer

type UpdateCustomer struct {
	FirstName    *string `json:"first_name,omitempty"`
	LastName     *string `json:"last_name,omitempty"`
	Email        *string `json:"email,omitempty"`
	CcEmails     *string `json:"cc_emails,omitempty"`
	Organization *string `json:"organization,omitempty"`
	Reference    *string `json:"reference,omitempty"`
	Address      *string `json:"address,omitempty"`
	Address2     *string `json:"address_2,omitempty"`
	City         *string `json:"city,omitempty"`
	State        *string `json:"state,omitempty"`
	Zip          *string `json:"zip,omitempty"`
	Country      *string `json:"country,omitempty"`
	Phone        *string `json:"phone,omitempty"`
	// Set a specific language on a customer record.
	Locale          *string       `json:"locale,omitempty"`
	VatNumber       *string       `json:"vat_number,omitempty"`
	TaxExempt       *bool         `json:"tax_exempt,omitempty"`
	TaxExemptReason *string       `json:"tax_exempt_reason,omitempty"`
	ParentId        Optional[int] `json:"parent_id"`
}

UpdateCustomer represents a UpdateCustomer struct.

func (*UpdateCustomer) MarshalJSON

func (u *UpdateCustomer) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateCustomer. It customizes the JSON marshaling process for UpdateCustomer objects.

func (*UpdateCustomer) UnmarshalJSON

func (u *UpdateCustomer) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomer. It customizes the JSON unmarshaling process for UpdateCustomer objects.

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	Customer UpdateCustomer `json:"customer"`
}

UpdateCustomerRequest represents a UpdateCustomerRequest struct.

func (*UpdateCustomerRequest) MarshalJSON

func (u *UpdateCustomerRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateCustomerRequest. It customizes the JSON marshaling process for UpdateCustomerRequest objects.

func (*UpdateCustomerRequest) UnmarshalJSON

func (u *UpdateCustomerRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateCustomerRequest. It customizes the JSON unmarshaling process for UpdateCustomerRequest objects.

type UpdateEndpoint

type UpdateEndpoint struct {
	Url                  string                `json:"url"`
	WebhookSubscriptions []WebhookSubscription `json:"webhook_subscriptions"`
}

UpdateEndpoint represents a UpdateEndpoint struct. Used to Create or Update Endpoint

func (*UpdateEndpoint) MarshalJSON

func (u *UpdateEndpoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateEndpoint. It customizes the JSON marshaling process for UpdateEndpoint objects.

func (*UpdateEndpoint) UnmarshalJSON

func (u *UpdateEndpoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpoint. It customizes the JSON unmarshaling process for UpdateEndpoint objects.

type UpdateEndpointRequest

type UpdateEndpointRequest struct {
	// Used to Create or Update Endpoint
	Endpoint UpdateEndpoint `json:"endpoint"`
}

UpdateEndpointRequest represents a UpdateEndpointRequest struct. Used to Create or Update Endpoint

func (*UpdateEndpointRequest) MarshalJSON

func (u *UpdateEndpointRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateEndpointRequest. It customizes the JSON marshaling process for UpdateEndpointRequest objects.

func (*UpdateEndpointRequest) UnmarshalJSON

func (u *UpdateEndpointRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateEndpointRequest. It customizes the JSON unmarshaling process for UpdateEndpointRequest objects.

type UpdateMetadata

type UpdateMetadata struct {
	CurrentName *string `json:"current_name,omitempty"`
	Name        *string `json:"name,omitempty"`
	Value       *string `json:"value,omitempty"`
}

UpdateMetadata represents a UpdateMetadata struct.

func (*UpdateMetadata) MarshalJSON

func (u *UpdateMetadata) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateMetadata. It customizes the JSON marshaling process for UpdateMetadata objects.

func (*UpdateMetadata) UnmarshalJSON

func (u *UpdateMetadata) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadata. It customizes the JSON unmarshaling process for UpdateMetadata objects.

type UpdateMetadataRequest

type UpdateMetadataRequest struct {
	Metadata *UpdateMetadata `json:"metadata,omitempty"`
}

UpdateMetadataRequest represents a UpdateMetadataRequest struct.

func (*UpdateMetadataRequest) MarshalJSON

func (u *UpdateMetadataRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateMetadataRequest. It customizes the JSON marshaling process for UpdateMetadataRequest objects.

func (*UpdateMetadataRequest) UnmarshalJSON

func (u *UpdateMetadataRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetadataRequest. It customizes the JSON unmarshaling process for UpdateMetadataRequest objects.

type UpdateMetafieldsRequest

type UpdateMetafieldsRequest struct {
	Metafields *interface{} `json:"metafields,omitempty"`
}

UpdateMetafieldsRequest represents a UpdateMetafieldsRequest struct.

func (*UpdateMetafieldsRequest) MarshalJSON

func (u *UpdateMetafieldsRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateMetafieldsRequest. It customizes the JSON marshaling process for UpdateMetafieldsRequest objects.

func (*UpdateMetafieldsRequest) UnmarshalJSON

func (u *UpdateMetafieldsRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateMetafieldsRequest. It customizes the JSON unmarshaling process for UpdateMetafieldsRequest objects.

type UpdatePaymentProfile

type UpdatePaymentProfile struct {
	// The first name of the card holder.
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the card holder.
	LastName *string `json:"last_name,omitempty"`
	// The full credit card number
	FullNumber *string `json:"full_number,omitempty"`
	// The type of card used.
	CardType *CardType `json:"card_type,omitempty"`
	// (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5
	ExpirationMonth *string `json:"expiration_month,omitempty"`
	// (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012
	ExpirationYear *string `json:"expiration_year,omitempty"`
	// The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing.
	CurrentVault *CurrentVault `json:"current_vault,omitempty"`
	// The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway.
	BillingAddress *string `json:"billing_address,omitempty"`
	// The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway.
	BillingCity *string `json:"billing_city,omitempty"`
	// The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.
	BillingState *string `json:"billing_state,omitempty"`
	// The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway.
	BillingZip *string `json:"billing_zip,omitempty"`
	// The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Please check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.
	BillingCountry *string `json:"billing_country,omitempty"`
	// Second line of the customer’s billing address i.e. Apt. 100
	BillingAddress2 Optional[string] `json:"billing_address_2"`
}

UpdatePaymentProfile represents a UpdatePaymentProfile struct.

func (*UpdatePaymentProfile) MarshalJSON

func (u *UpdatePaymentProfile) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfile. It customizes the JSON marshaling process for UpdatePaymentProfile objects.

func (*UpdatePaymentProfile) UnmarshalJSON

func (u *UpdatePaymentProfile) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfile. It customizes the JSON unmarshaling process for UpdatePaymentProfile objects.

type UpdatePaymentProfileRequest

type UpdatePaymentProfileRequest struct {
	PaymentProfile UpdatePaymentProfile `json:"payment_profile"`
}

UpdatePaymentProfileRequest represents a UpdatePaymentProfileRequest struct.

func (*UpdatePaymentProfileRequest) MarshalJSON

func (u *UpdatePaymentProfileRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdatePaymentProfileRequest. It customizes the JSON marshaling process for UpdatePaymentProfileRequest objects.

func (*UpdatePaymentProfileRequest) UnmarshalJSON

func (u *UpdatePaymentProfileRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdatePaymentProfileRequest. It customizes the JSON unmarshaling process for UpdatePaymentProfileRequest objects.

type UpdatePrice

type UpdatePrice struct {
	Id             *int         `json:"id,omitempty"`
	EndingQuantity *interface{} `json:"ending_quantity,omitempty"`
	// The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065
	UnitPrice        *interface{} `json:"unit_price,omitempty"`
	Destroy          *bool        `json:"_destroy,omitempty"`
	StartingQuantity *interface{} `json:"starting_quantity,omitempty"`
}

UpdatePrice represents a UpdatePrice struct.

func (*UpdatePrice) MarshalJSON

func (u *UpdatePrice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdatePrice. It customizes the JSON marshaling process for UpdatePrice objects.

func (*UpdatePrice) UnmarshalJSON

func (u *UpdatePrice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdatePrice. It customizes the JSON unmarshaling process for UpdatePrice objects.

type UpdateProductPricePoint

type UpdateProductPricePoint struct {
	Handle       *string `json:"handle,omitempty"`
	PriceInCents *int64  `json:"price_in_cents,omitempty"`
}

UpdateProductPricePoint represents a UpdateProductPricePoint struct.

func (*UpdateProductPricePoint) MarshalJSON

func (u *UpdateProductPricePoint) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateProductPricePoint. It customizes the JSON marshaling process for UpdateProductPricePoint objects.

func (*UpdateProductPricePoint) UnmarshalJSON

func (u *UpdateProductPricePoint) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePoint. It customizes the JSON unmarshaling process for UpdateProductPricePoint objects.

type UpdateProductPricePointRequest

type UpdateProductPricePointRequest struct {
	PricePoint UpdateProductPricePoint `json:"price_point"`
}

UpdateProductPricePointRequest represents a UpdateProductPricePointRequest struct.

func (*UpdateProductPricePointRequest) MarshalJSON

func (u *UpdateProductPricePointRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateProductPricePointRequest. It customizes the JSON marshaling process for UpdateProductPricePointRequest objects.

func (*UpdateProductPricePointRequest) UnmarshalJSON

func (u *UpdateProductPricePointRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateProductPricePointRequest. It customizes the JSON unmarshaling process for UpdateProductPricePointRequest objects.

type UpdateReasonCode

type UpdateReasonCode struct {
	// The unique identifier for the ReasonCode
	Code *string `json:"code,omitempty"`
	// The friendly summary of what the code signifies
	Description *string `json:"description,omitempty"`
	// The order that code appears in lists
	Position *int `json:"position,omitempty"`
}

UpdateReasonCode represents a UpdateReasonCode struct.

func (*UpdateReasonCode) MarshalJSON

func (u *UpdateReasonCode) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateReasonCode. It customizes the JSON marshaling process for UpdateReasonCode objects.

func (*UpdateReasonCode) UnmarshalJSON

func (u *UpdateReasonCode) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCode. It customizes the JSON unmarshaling process for UpdateReasonCode objects.

type UpdateReasonCodeRequest

type UpdateReasonCodeRequest struct {
	ReasonCode UpdateReasonCode `json:"reason_code"`
}

UpdateReasonCodeRequest represents a UpdateReasonCodeRequest struct.

func (*UpdateReasonCodeRequest) MarshalJSON

func (u *UpdateReasonCodeRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateReasonCodeRequest. It customizes the JSON marshaling process for UpdateReasonCodeRequest objects.

func (*UpdateReasonCodeRequest) UnmarshalJSON

func (u *UpdateReasonCodeRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateReasonCodeRequest. It customizes the JSON unmarshaling process for UpdateReasonCodeRequest objects.

type UpdateSegment

type UpdateSegment struct {
	// The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes.
	PricingScheme PricingScheme                `json:"pricing_scheme"`
	Prices        []CreateOrUpdateSegmentPrice `json:"prices,omitempty"`
}

UpdateSegment represents a UpdateSegment struct.

func (*UpdateSegment) MarshalJSON

func (u *UpdateSegment) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSegment. It customizes the JSON marshaling process for UpdateSegment objects.

func (*UpdateSegment) UnmarshalJSON

func (u *UpdateSegment) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegment. It customizes the JSON unmarshaling process for UpdateSegment objects.

type UpdateSegmentRequest

type UpdateSegmentRequest struct {
	Segment UpdateSegment `json:"segment"`
}

UpdateSegmentRequest represents a UpdateSegmentRequest struct.

func (*UpdateSegmentRequest) MarshalJSON

func (u *UpdateSegmentRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSegmentRequest. It customizes the JSON marshaling process for UpdateSegmentRequest objects.

func (*UpdateSegmentRequest) UnmarshalJSON

func (u *UpdateSegmentRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSegmentRequest. It customizes the JSON unmarshaling process for UpdateSegmentRequest objects.

type UpdateSubscription

type UpdateSubscription struct {
	CreditCardAttributes *CreditCardAttributes `json:"credit_card_attributes,omitempty"`
	// Set to the handle of a different product to change the subscription's product
	ProductHandle *string `json:"product_handle,omitempty"`
	// Set to the id of a different product to change the subscription's product
	ProductId            *int  `json:"product_id,omitempty"`
	ProductChangeDelayed *bool `json:"product_change_delayed,omitempty"`
	// Set to an empty string to cancel a delayed product change.
	NextProductId           *string `json:"next_product_id,omitempty"`
	NextProductPricePointId *string `json:"next_product_price_point_id,omitempty"`
	// Use for subscriptions with product eligible for calendar billing only. Value can be 1-28 or 'end'.
	SnapDay                       *interface{} `json:"snap_day,omitempty"`
	NextBillingAt                 *string      `json:"next_billing_at,omitempty"`
	PaymentCollectionMethod       *string      `json:"payment_collection_method,omitempty"`
	ReceivesInvoiceEmails         *bool        `json:"receives_invoice_emails,omitempty"`
	NetTerms                      *interface{} `json:"net_terms,omitempty"`
	StoredCredentialTransactionId *int         `json:"stored_credential_transaction_id,omitempty"`
	Reference                     *string      `json:"reference,omitempty"`
	// (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription
	CustomPrice *SubscriptionCustomPrice `json:"custom_price,omitempty"`
	// (Optional) An array of component ids and custom prices to be added to the subscription.
	Components []UpdateSubscriptionComponent `json:"components,omitempty"`
	// Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
	DunningCommunicationDelayEnabled Optional[bool] `json:"dunning_communication_delay_enabled"`
	// Time zone for the Dunning Communication Delay feature.
	DunningCommunicationDelayTimeZone Optional[string] `json:"dunning_communication_delay_time_zone"`
}

UpdateSubscription represents a UpdateSubscription struct.

func (*UpdateSubscription) MarshalJSON

func (u *UpdateSubscription) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscription. It customizes the JSON marshaling process for UpdateSubscription objects.

func (*UpdateSubscription) UnmarshalJSON

func (u *UpdateSubscription) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscription. It customizes the JSON unmarshaling process for UpdateSubscription objects.

type UpdateSubscriptionComponent

type UpdateSubscriptionComponent struct {
	ComponentId *int `json:"component_id,omitempty"`
	// Create or update custom pricing unique to the subscription. Used in place of `price_point_id`.
	CustomPrice *ComponentCustomPrice `json:"custom_price,omitempty"`
}

UpdateSubscriptionComponent represents a UpdateSubscriptionComponent struct.

func (*UpdateSubscriptionComponent) MarshalJSON

func (u *UpdateSubscriptionComponent) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionComponent. It customizes the JSON marshaling process for UpdateSubscriptionComponent objects.

func (*UpdateSubscriptionComponent) UnmarshalJSON

func (u *UpdateSubscriptionComponent) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionComponent. It customizes the JSON unmarshaling process for UpdateSubscriptionComponent objects.

type UpdateSubscriptionGroup

type UpdateSubscriptionGroup struct {
	MemberIds []int `json:"member_ids,omitempty"`
}

UpdateSubscriptionGroup represents a UpdateSubscriptionGroup struct.

func (*UpdateSubscriptionGroup) MarshalJSON

func (u *UpdateSubscriptionGroup) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroup. It customizes the JSON marshaling process for UpdateSubscriptionGroup objects.

func (*UpdateSubscriptionGroup) UnmarshalJSON

func (u *UpdateSubscriptionGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroup. It customizes the JSON unmarshaling process for UpdateSubscriptionGroup objects.

type UpdateSubscriptionGroupRequest

type UpdateSubscriptionGroupRequest struct {
	SubscriptionGroup UpdateSubscriptionGroup `json:"subscription_group"`
}

UpdateSubscriptionGroupRequest represents a UpdateSubscriptionGroupRequest struct.

func (*UpdateSubscriptionGroupRequest) MarshalJSON

func (u *UpdateSubscriptionGroupRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionGroupRequest. It customizes the JSON marshaling process for UpdateSubscriptionGroupRequest objects.

func (*UpdateSubscriptionGroupRequest) UnmarshalJSON

func (u *UpdateSubscriptionGroupRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionGroupRequest. It customizes the JSON unmarshaling process for UpdateSubscriptionGroupRequest objects.

type UpdateSubscriptionNote

type UpdateSubscriptionNote struct {
	Body   string `json:"body"`
	Sticky bool   `json:"sticky"`
}

UpdateSubscriptionNote represents a UpdateSubscriptionNote struct. Updatable fields for Subscription Note

func (*UpdateSubscriptionNote) MarshalJSON

func (u *UpdateSubscriptionNote) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNote. It customizes the JSON marshaling process for UpdateSubscriptionNote objects.

func (*UpdateSubscriptionNote) UnmarshalJSON

func (u *UpdateSubscriptionNote) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNote. It customizes the JSON unmarshaling process for UpdateSubscriptionNote objects.

type UpdateSubscriptionNoteRequest

type UpdateSubscriptionNoteRequest struct {
	// Updatable fields for Subscription Note
	Note UpdateSubscriptionNote `json:"note"`
}

UpdateSubscriptionNoteRequest represents a UpdateSubscriptionNoteRequest struct. Updatable fields for Subscription Note

func (*UpdateSubscriptionNoteRequest) MarshalJSON

func (u *UpdateSubscriptionNoteRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionNoteRequest. It customizes the JSON marshaling process for UpdateSubscriptionNoteRequest objects.

func (*UpdateSubscriptionNoteRequest) UnmarshalJSON

func (u *UpdateSubscriptionNoteRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionNoteRequest. It customizes the JSON unmarshaling process for UpdateSubscriptionNoteRequest objects.

type UpdateSubscriptionRequest

type UpdateSubscriptionRequest struct {
	Subscription UpdateSubscription `json:"subscription"`
}

UpdateSubscriptionRequest represents a UpdateSubscriptionRequest struct.

func (*UpdateSubscriptionRequest) MarshalJSON

func (u *UpdateSubscriptionRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpdateSubscriptionRequest. It customizes the JSON marshaling process for UpdateSubscriptionRequest objects.

func (*UpdateSubscriptionRequest) UnmarshalJSON

func (u *UpdateSubscriptionRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpdateSubscriptionRequest. It customizes the JSON unmarshaling process for UpdateSubscriptionRequest objects.

type UpsertPrepaidConfiguration

type UpsertPrepaidConfiguration struct {
	InitialFundingAmountInCents     *int64 `json:"initial_funding_amount_in_cents,omitempty"`
	ReplenishToAmountInCents        *int64 `json:"replenish_to_amount_in_cents,omitempty"`
	AutoReplenish                   *bool  `json:"auto_replenish,omitempty"`
	ReplenishThresholdAmountInCents *int64 `json:"replenish_threshold_amount_in_cents,omitempty"`
}

UpsertPrepaidConfiguration represents a UpsertPrepaidConfiguration struct.

func (*UpsertPrepaidConfiguration) MarshalJSON

func (u *UpsertPrepaidConfiguration) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfiguration. It customizes the JSON marshaling process for UpsertPrepaidConfiguration objects.

func (*UpsertPrepaidConfiguration) UnmarshalJSON

func (u *UpsertPrepaidConfiguration) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfiguration. It customizes the JSON unmarshaling process for UpsertPrepaidConfiguration objects.

type UpsertPrepaidConfigurationRequest

type UpsertPrepaidConfigurationRequest struct {
	PrepaidConfiguration UpsertPrepaidConfiguration `json:"prepaid_configuration"`
}

UpsertPrepaidConfigurationRequest represents a UpsertPrepaidConfigurationRequest struct.

func (*UpsertPrepaidConfigurationRequest) MarshalJSON

func (u *UpsertPrepaidConfigurationRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UpsertPrepaidConfigurationRequest. It customizes the JSON marshaling process for UpsertPrepaidConfigurationRequest objects.

func (*UpsertPrepaidConfigurationRequest) UnmarshalJSON

func (u *UpsertPrepaidConfigurationRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UpsertPrepaidConfigurationRequest. It customizes the JSON unmarshaling process for UpsertPrepaidConfigurationRequest objects.

type Usage

type Usage struct {
	Id              *int64       `json:"id,omitempty"`
	Memo            *string      `json:"memo,omitempty"`
	CreatedAt       *time.Time   `json:"created_at,omitempty"`
	PricePointId    *int         `json:"price_point_id,omitempty"`
	Quantity        *interface{} `json:"quantity,omitempty"`
	OverageQuantity *int         `json:"overage_quantity,omitempty"`
	ComponentId     *int         `json:"component_id,omitempty"`
	ComponentHandle *string      `json:"component_handle,omitempty"`
	SubscriptionId  *int         `json:"subscription_id,omitempty"`
}

Usage represents a Usage struct.

func (*Usage) MarshalJSON

func (u *Usage) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Usage. It customizes the JSON marshaling process for Usage objects.

func (*Usage) UnmarshalJSON

func (u *Usage) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Usage. It customizes the JSON unmarshaling process for Usage objects.

type UsageResponse

type UsageResponse struct {
	Usage Usage `json:"usage"`
}

UsageResponse represents a UsageResponse struct.

func (*UsageResponse) MarshalJSON

func (u *UsageResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for UsageResponse. It customizes the JSON marshaling process for UsageResponse objects.

func (*UsageResponse) UnmarshalJSON

func (u *UsageResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UsageResponse. It customizes the JSON unmarshaling process for UsageResponse objects.

type VoidInvoice

type VoidInvoice struct {
	Reason string `json:"reason"`
}

VoidInvoice represents a VoidInvoice struct.

func (*VoidInvoice) MarshalJSON

func (v *VoidInvoice) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for VoidInvoice. It customizes the JSON marshaling process for VoidInvoice objects.

func (*VoidInvoice) UnmarshalJSON

func (v *VoidInvoice) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoice. It customizes the JSON unmarshaling process for VoidInvoice objects.

type VoidInvoiceRequest

type VoidInvoiceRequest struct {
	Void VoidInvoice `json:"void"`
}

VoidInvoiceRequest represents a VoidInvoiceRequest struct.

func (*VoidInvoiceRequest) MarshalJSON

func (v *VoidInvoiceRequest) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for VoidInvoiceRequest. It customizes the JSON marshaling process for VoidInvoiceRequest objects.

func (*VoidInvoiceRequest) UnmarshalJSON

func (v *VoidInvoiceRequest) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for VoidInvoiceRequest. It customizes the JSON unmarshaling process for VoidInvoiceRequest objects.

type Webhook

type Webhook struct {
	// A string describing which event type produced the given webhook
	Event *string `json:"event,omitempty"`
	// The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event.
	Id *int `json:"id,omitempty"`
	// Timestamp indicating when the webhook was created
	CreatedAt *string `json:"created_at,omitempty"`
	// Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared.
	LastError *string `json:"last_error,omitempty"`
	// Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared.
	LastErrorAt *string `json:"last_error_at,omitempty"`
	// Timestamp indicating when the webhook was accepted by the merchant endpoint. When a webhook is explicitly replayed by the merchant, this value will be cleared until it is accepted again.
	AcceptedAt Optional[string] `json:"accepted_at"`
	// Timestamp indicating when the most recent attempt was made to send the webhook
	LastSentAt *string `json:"last_sent_at,omitempty"`
	// The url that the endpoint was last sent to.
	LastSentUrl *string `json:"last_sent_url,omitempty"`
	// A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds)
	Successful *bool `json:"successful,omitempty"`
	// The data sent within the webhook post
	Body *string `json:"body,omitempty"`
	// The calculated webhook signature
	Signature *string `json:"signature,omitempty"`
	// The calculated HMAC-SHA-256 webhook signature
	SignatureHmacSha256 *string `json:"signature_hmac_sha_256,omitempty"`
}

Webhook represents a Webhook struct.

func (*Webhook) MarshalJSON

func (w *Webhook) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for Webhook. It customizes the JSON marshaling process for Webhook objects.

func (*Webhook) UnmarshalJSON

func (w *Webhook) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Webhook. It customizes the JSON unmarshaling process for Webhook objects.

type WebhookOrder

type WebhookOrder string

WebhookOrder is a string enum.

const (
	WebhookOrder_NEWESTFIRST WebhookOrder = "newest_first"
	WebhookOrder_OLDESTFIRST WebhookOrder = "oldest_first"
)

type WebhookResponse

type WebhookResponse struct {
	Webhook *Webhook `json:"webhook,omitempty"`
}

WebhookResponse represents a WebhookResponse struct.

func (*WebhookResponse) MarshalJSON

func (w *WebhookResponse) MarshalJSON() (
	[]byte,
	error)

MarshalJSON implements the json.Marshaler interface for WebhookResponse. It customizes the JSON marshaling process for WebhookResponse objects.

func (*WebhookResponse) UnmarshalJSON

func (w *WebhookResponse) UnmarshalJSON(input []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for WebhookResponse. It customizes the JSON unmarshaling process for WebhookResponse objects.

type WebhookStatus

type WebhookStatus string

WebhookStatus is a string enum.

const (
	WebhookStatus_SUCCESSFUL WebhookStatus = "successful"
	WebhookStatus_FAILED     WebhookStatus = "failed"
	WebhookStatus_PENDING    WebhookStatus = "pending"
	WebhookStatus_PAUSED     WebhookStatus = "paused"
)

type WebhookSubscription

type WebhookSubscription string

WebhookSubscription is a string enum.

const (
	WebhookSubscription_BILLINGDATECHANGE                              WebhookSubscription = "billing_date_change"
	WebhookSubscription_COMPONENTALLOCATIONCHANGE                      WebhookSubscription = "component_allocation_change"
	WebhookSubscription_CUSTOMERCREATE                                 WebhookSubscription = "customer_create"
	WebhookSubscription_CUSTOMERUPDATE                                 WebhookSubscription = "customer_update"
	WebhookSubscription_DUNNINGSTEPREACHED                             WebhookSubscription = "dunning_step_reached"
	WebhookSubscription_EXPIRINGCARD                                   WebhookSubscription = "expiring_card"
	WebhookSubscription_EXPIRATIONDATECHANGE                           WebhookSubscription = "expiration_date_change"
	WebhookSubscription_INVOICEISSUED                                  WebhookSubscription = "invoice_issued"
	WebhookSubscription_METEREDUSAGE                                   WebhookSubscription = "metered_usage"
	WebhookSubscription_PAYMENTFAILURE                                 WebhookSubscription = "payment_failure"
	WebhookSubscription_PAYMENTSUCCESS                                 WebhookSubscription = "payment_success"
	WebhookSubscription_DIRECTDEBITPAYMENTPENDING                      WebhookSubscription = "direct_debit_payment_pending"
	WebhookSubscription_DIRECTDEBITPAYMENTPAIDOUT                      WebhookSubscription = "direct_debit_payment_paid_out"
	WebhookSubscription_DIRECTDEBITPAYMENTREJECTED                     WebhookSubscription = "direct_debit_payment_rejected"
	WebhookSubscription_PREPAIDSUBSCRIPTIONBALANCECHANGED              WebhookSubscription = "prepaid_subscription_balance_changed"
	WebhookSubscription_PREPAIDUSAGE                                   WebhookSubscription = "prepaid_usage"
	WebhookSubscription_REFUNDFAILURE                                  WebhookSubscription = "refund_failure"
	WebhookSubscription_REFUNDSUCCESS                                  WebhookSubscription = "refund_success"
	WebhookSubscription_RENEWALFAILURE                                 WebhookSubscription = "renewal_failure"
	WebhookSubscription_RENEWALSUCCESS                                 WebhookSubscription = "renewal_success"
	WebhookSubscription_SIGNUPFAILURE                                  WebhookSubscription = "signup_failure"
	WebhookSubscription_SIGNUPSUCCESS                                  WebhookSubscription = "signup_success"
	WebhookSubscription_STATEMENTCLOSED                                WebhookSubscription = "statement_closed"
	WebhookSubscription_STATEMENTSETTLED                               WebhookSubscription = "statement_settled"
	WebhookSubscription_SUBSCRIPTIONCARDUPDATE                         WebhookSubscription = "subscription_card_update"
	WebhookSubscription_SUBSCRIPTIONGROUPCARDUPDATE                    WebhookSubscription = "subscription_group_card_update"
	WebhookSubscription_SUBSCRIPTIONPRODUCTCHANGE                      WebhookSubscription = "subscription_product_change"
	WebhookSubscription_SUBSCRIPTIONSTATECHANGE                        WebhookSubscription = "subscription_state_change"
	WebhookSubscription_TRIALENDNOTICE                                 WebhookSubscription = "trial_end_notice"
	WebhookSubscription_UPCOMINGRENEWALNOTICE                          WebhookSubscription = "upcoming_renewal_notice"
	WebhookSubscription_UPGRADEDOWNGRADEFAILURE                        WebhookSubscription = "upgrade_downgrade_failure"
	WebhookSubscription_UPGRADEDOWNGRADESUCCESS                        WebhookSubscription = "upgrade_downgrade_success"
	WebhookSubscription_PENDINGCANCELLATIONCHANGE                      WebhookSubscription = "pending_cancellation_change"
	WebhookSubscription_SUBSCRIPTIONPREPAYMENTACCOUNTBALANCECHANGED    WebhookSubscription = "subscription_prepayment_account_balance_changed"
	WebhookSubscription_SUBSCRIPTIONSERVICECREDITACCOUNTBALANCECHANGED WebhookSubscription = "subscription_service_credit_account_balance_changed"
)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL