Documentation
¶
Index ¶
- Constants
- type API
- type Account
- type AccountUpdate
- type AccountUpdateResponse
- type AccountUpdateTaxInfo
- type AdjustmentSourceType
- type AdjustmentType
- type AuthHeaderProvider
- type BasicAuthHeader
- type ChargeUpdateDetail
- type Config
- type ConfigOption
- type Contact
- type ContextKey
- type Doer
- type GatewayOption
- type GatewayOptionData
- type Invoice
- type InvoiceFile
- type InvoiceFilesResponse
- type InvoiceItem
- type InvoiceItemAdjustment
- type InvoiceItemAdjustmentCreatePayload
- type InvoiceItemZoql
- type InvoiceItemsResponse
- type InvoicePayment
- type MemoryTokenStore
- type OAuthHeader
- type ObjecName
- type ObjectModel
- type Payment
- type PaymentMethod
- type Product
- type ProductRatePlan
- type ProductRatePlanCharge
- type ProductRatePlanChargeTier
- type Querier
- type RatePlan
- type RatePlanCharge
- type Refund
- type RefundCreatePayload
- type RefundCreateResonse
- type RefundInvoicePayment
- type RefundInvoicePaymentData
- type RefundReasonCode
- type RefundType
- type Response
- type Subscription
- type SubscriptionAddChargeOverride
- type SubscriptionAddRatePlan
- type SubscriptionCancellation
- type SubscriptionCancellationResponse
- type SubscriptionRemoveRatePlan
- type SubscriptionUpdate
- type SubscriptionUpdateRatePlan
- type TaxationItem
- type Tier
- type Token
- type TokenStorer
- type Usage
- type V1
Examples ¶
Constants ¶
const ContextKeyZuoraEntityIds = ContextKey("Zuora-Entity-Ids")
ContextKeyZuoraEntityIds will be added as a header on requests
const ContextKeyZuoraTrackID = ContextKey("Zuora-Track-Id")
ContextKeyZuoraTrackID will be addeed as a header on requests
const ContextKeyZuoraVersion = ContextKey("zuora-version")
ContextKeyZuoraVersion will be added as header when an endpoint supports it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
V1 V1
ObjectModel ObjectModel
}
API is a container struct with access to all underlying services
type Account ¶
type Account struct {
ID *string `json:"id,omitempty"`
AccountNumber *string `json:"accountNumber,omitempty"`
// AdditionalEmailAddresses show as part of GetById response as a string but
// as an array in Get response but inside `billingAndPayment`.
// TODO: Check with ZOQL
// AdditionalEmailAddresses *string `json:"additionalEmailAddresses,omitempty"`
AllowInvoiceEdit *bool `json:"allowInvoiceEdit,omitempty"`
AutoPay *bool `json:"autoPay,omitempty"`
Balance *float64 `json:"balance,omitempty"`
Batch *string `json:"batch,omitempty"`
BcdSettingOption string `json:"bcdSettingOption"`
BillCycleDay int `json:"billCycleDay"`
BillToID *string `json:"billToId,omitempty"`
CommunicationProfileID *string `json:"communicationProfileId,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
CreditBalance *float64 `json:"creditBalance,omitempty"`
CrmID *string `json:"crmId,omitempty"`
Currency string `json:"currency"`
CustomerServiceRepName *string `json:"customerServiceRepName,omitempty"`
DefaultPaymentMethodID *string `json:"defaultPaymentMethodId,omitempty"`
InvoiceDeliveryPrefsEmail *bool `json:"invoiceDeliveryPrefsEmail,omitempty"`
InvoiceDeliveryPrefsPrint *bool `json:"invoiceDeliveryPrefsPrint,omitempty"`
InvoiceTemplateID *string `json:"invoiceTemplateId,omitempty"`
LastInvoiceDate *string `json:"lastInvoiceDate,omitempty"`
Mrr *float64 `json:"mrr,omitempty"`
Name string `json:"name"`
Notes *string `json:"notes,omitempty"`
ParentID *string `json:"parentId,omitempty"`
PaymentGateway *string `json:"paymentGateway,omitempty"`
PaymentTerm *string `json:"paymentTerm,omitempty"`
PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"`
SalesRepName *string `json:"salesRepName,omitempty"`
SequenceSetID *string `json:"sequenceSetId,omitempty"`
SoldToID *string `json:"soldToId,omitempty"`
Status string `json:"status"`
TaxCompanyCode *string `json:"taxCompanyCode,omitempty"`
TaxExemptCertificateID *string `json:"taxExemptCertificateID,omitempty"`
TaxExemptCertificateType *string `json:"taxExemptCertificateType,omitempty"`
TaxExemptDescription *string `json:"taxExemptDescription,omitempty"`
TaxExemptEffectiveDate *string `json:"taxExemptEffectiveDate,omitempty"`
TaxExemptEntityUseCode *string `json:"taxExemptEntityUseCode,omitempty"`
TaxExemptExpirationDate *string `json:"taxExemptExpirationDate,omitempty"`
TaxExemptIssuingJurisdiction *string `json:"taxExemptIssuingJurisdiction,omitempty"`
TaxExemptStatus *string `json:"taxExemptStatus,omitempty"`
TotalDebitMemoBalance *float64 `json:"totalDebitMemoBalance,omitempty"`
TotalInvoiceBalance *float64 `json:"totalInvoiceBalance,omitempty"`
UnappliedBalance float64 `json:"unappliedBalance"`
UnappliedCreditMemoAmount *float64 `json:"unappliedCreditMemoAmount,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
VATId *string `json:"vatId,omitempty"`
}
Account has all the possible properties given by Zuora. This comes from the Describe endpoint.
type AccountUpdate ¶
type AccountUpdate struct {
AdditionalEmailAddresses []string `json:"additionalEmailAddresses,omitempty"`
AutoPay *bool `json:"autoPay,omitempty"`
Batch *string `json:"batch,omitempty"`
BillToContact *Contact `json:"billToContact,omitempty"`
CommunicationProfileID *string `json:"communicationProfileId,omitempty"`
CreditMemoTemplateID *string `json:"creditMemoTemplateId,omitempty"`
CrmID *string `json:"crmId,omitempty"`
DebitMemoTemplateID *string `json:"debitMemoTemplateId,omitempty"`
InvoiceDeliveryPrefsEmail *bool `json:"invoiceDeliveryPrefsEmail,omitempty"`
InvoiceDeliveryPrefsPrint *bool `json:"invoiceDeliveryPrefsPrint,omitempty"`
InvoiceTemplateID *string `json:"invoiceTemplateId,omitempty"`
Name string `json:"name,omitempty"`
Notes *string `json:"notes,omitempty"`
ParentID *string `json:"parentId,omitempty"`
PaymentGateway *string `json:"paymentGateway,omitempty"`
SalesRepName *string `json:"salesRepName,omitempty"`
SequenceSetID *string `json:"sequenceSetId,omitempty"`
SoldToContact *Contact `json:"soldToContact,omitempty"`
Tagging *string `json:"tagging,omitempty"`
TaxInfo *AccountUpdateTaxInfo `json:"taxInfo,omitempty"`
}
AccountUpdate has all the possible properties given by Zuora. This comes from the Describe endpoint.
type AccountUpdateResponse ¶
AccountUpdateResponse CRUD responses have this response.
type AccountUpdateTaxInfo ¶
type AccountUpdateTaxInfo struct {
VATId *string `json:"vatId,omitempty"`
CompanyCode *string `json:"companyCode,omitempty"`
ExemptCertificateID *string `json:"exemptCertificateID,omitempty"`
ExemptCertificateType *string `json:"exemptCertificateType,omitempty"`
ExemptDescription *string `json:"exemptDescription,omitempty"`
ExemptEffectiveDate *string `json:"exemptEffectiveDate,omitempty"`
ExemptEntityUseCode *string `json:"exemptEntityUseCode,omitempty"`
ExemptExpirationDate *string `json:"exemptExpirationDate,omitempty"`
ExemptIssuingJurisdiction *string `json:"exemptIssuingJurisdiction,omitempty"`
ExemptStatus *string `json:"exemptStatus,omitempty"`
}
AccountUpdateTaxInfo Container for tax exempt information, used to establish the tax exempt status of a customer account.
type AdjustmentSourceType ¶
type AdjustmentSourceType string
AdjustmentSourceType supported by Zuora
var AdjustmentTypeInvoiceDetail AdjustmentSourceType = "InvoiceDetail"
AdjustmentTypeInvoiceDetail --
var AdjustmentTypeTax AdjustmentSourceType = "Tax"
AdjustmentTypeTax --
type AdjustmentType ¶
type AdjustmentType string
AdjustmentType Indicates whether the adjustment credits or debits the invoice item amount.
var AdjustmentTypeCredit AdjustmentType = "Credit"
AdjustmentTypeCredit --
var AdjustmentTypeDebit AdjustmentType = "Debit"
AdjustmentTypeDebit --
type AuthHeaderProvider ¶
AuthHeaderProvider an interface that defines a common get method for different types of Authentication for Zuora.
type BasicAuthHeader ¶
type BasicAuthHeader struct {
// contains filtered or unexported fields
}
BasicAuthHeader represents a basic HTTP auth header holder.
Example ¶
ExampleBasicAuthHeader how to initialize the Zuora client with Basic header provider.
package main
import (
"context"
"fmt"
"net/http"
"github.com/hyeomans/zuora"
)
func main() {
ctx := context.Background()
httpClient := http.DefaultClient
basicAuthHeader := zuora.NewBasicAuthHeader("yourClientID", "yourClientSecret")
zuoraAPI := zuora.NewAPI(httpClient, basicAuthHeader, "https://apisandbox.zuora.com/")
fmt.Println(zuoraAPI.V1.AccountsService.Summary(ctx, "ObjectID"))
}
Output:
func NewBasicAuthHeader ¶
func NewBasicAuthHeader(clientID, clientSecret string) *BasicAuthHeader
NewBasicAuthHeader initialize with clientID & clientSecret from Zuora.
func (*BasicAuthHeader) AuthHeaders ¶
func (t *BasicAuthHeader) AuthHeaders(ctx context.Context) (string, error)
AuthHeaders returns a string that will be added to each request going out to Zuora
type ChargeUpdateDetail ¶
type ChargeUpdateDetail struct {
BillingPeriodAlignment *string `json:"billingPeriodAlignment,omitempty"`
Description *string `json:"description,omitempty"`
IncludedUnits *float64 `json:"includedUnits,omitempty"`
OveragePrice *float64 `json:"overagePrice,omitempty"`
Price *float64 `json:"price,omitempty"`
PriceChangeOption *string `json:"priceChangeOption,omitempty"`
PriceIncreasePercentage *float64 `json:"priceIncreasePercentage,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
RatePlanChargeID string `json:"ratePlanChargeId,omitempty"`
Tiers []Tier `json:"tiers,omitempty"`
TriggerDate *string `json:"triggerDate,omitempty"`
TriggerEvent *string `json:"triggerEvent,omitempty"`
}
ChargeUpdateDetail Custom struct to modify Product Rate Plan charges in an existing subscription.
type Config ¶
type Config struct {
HTTPClient *http.Client
BaseURL string
ClientID string
ClientSecret string
// contains filtered or unexported fields
}
Config is the base configuration to return ZuoraApi
type ConfigOption ¶
type ConfigOption func(*Config)
ConfigOption helper function to modify current Config struct
type Contact ¶
type Contact struct {
AccountID string `json:"accountId"`
Address1 *string `json:"address1,omitempty"`
Address2 *string `json:"address2,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
County *string `json:"county,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Description *string `json:"description,omitempty"`
Fax *string `json:"fax,omitempty"`
FirstName string `json:"firstName"`
HomePhone *string `json:"HomePhone,omitempty"`
ID *string `json:"id,omitempty"`
LastName string `json:"lastName"`
MobilePhone *string `json:"mobilePhone,omitempty"`
NickName *string `json:"nickName,omitempty"`
OtherPhone *string `json:"otherPhone,omitempty"`
OtherPhoneType *string `json:"otherPhoneType,omitempty"`
PersonalEmail *string `json:"personalEmail,omitempty"`
PostalCode *string `json:"postalCode,omitempty"`
State *string `json:"state,omitempty"`
TaxRegion *string `json:"taxRegion,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
WorkEmail *string `json:"workEmail,omitempty"`
WorkPhone *string `json:"workPhone,omitempty"`
}
Contact The Contact object defines the customer who holds an account or who is otherwise a person to contact about an account. An Account object requires a contact for the BillToId and SoldToId fields before the account can be active. The Contact object provides the attributes that these Account object fields need.
type ContextKey ¶
type ContextKey string
ContextKey is a helper to define Zuora context values
func (ContextKey) String ¶
func (c ContextKey) String() string
type Doer ¶
Doer is a common interface for Http clients https://golang.org/pkg/net/http/#Client.Do
type GatewayOption ¶
GatewayOption --
type GatewayOptionData ¶
type GatewayOptionData struct {
GatewayOption []GatewayOption `json:"GatewayOption,omitempty"`
}
GatewayOptionData --
type Invoice ¶
type Invoice struct {
AccountID string `json:"accountId"`
AdjustmentAmount float64 `json:"adjustmentAmount"`
Amount *float64 `json:"amount,omitempty"`
AmountWithoutTax *float64 `json:"amountWithoutTax,omitempty"`
AutoPay *bool `json:"autoPay,omitempty"`
Balance *float64 `json:"balance,omitempty"`
BillRunID *string `json:"billRunId,omitempty"`
BillToContactSnapshotID *string `json:"billToContactSnapshotId,omitempty"`
Body string `json:"body"`
Comments *string `json:"comments,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
CreditBalanceAdjustmentAmount float64 `json:"creditBalanceAdjustmentAmount"`
DueDate *string `json:"dueDate,omitempty"`
ID *string `json:"id,omitempty"`
IncludesOneTime *bool `json:"includesOneTime,omitempty"`
IncludesRecurring *bool `json:"includesRecurring,omitempty"`
IncludesUsage *bool `json:"includesUsage,omitempty"`
InvoiceDate *string `json:"invoiceDate,omitempty"`
InvoiceNumber *string `json:"invoiceNumber,omitempty"`
LastEmailSentDate *string `json:"lastEmailSentDate,omitempty"`
PaymentAmount float64 `json:"paymentAmount"`
PostedBy *string `json:"postedBy,omitempty"`
PostedDate *string `json:"postedDate,omitempty"`
RefundAmount float64 `json:"refundAmount"`
RegenerateInvoicePDF *bool `json:"regenerateInvoicePDF,omitempty"`
Reversed *bool `json:"reversed,omitempty"`
SoldToContactSnapshotID *string `json:"soldToContactSnapshotId,omitempty"`
Source *string `json:"source,omitempty"`
SourceID *string `json:"sourceId,omitempty"`
Status *string `json:"status,omitempty"`
TargetDate *string `json:"targetDate,omitempty"`
TaxAmount float64 `json:"taxAmount"`
TaxExemptAmount float64 `json:"taxExemptAmount"`
TaxMessage *string `json:"taxMessage,omitempty"`
TaxStatus *string `json:"taxStatus,omitempty"`
TransferredToAccounting *string `json:"transferredToAccounting,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
Invoice An invoice represents a bill to a customer. You generate invoices from a bill run, then email them as PDFs to your customers in batches or individually, or print them and send them to customers through postal mail. You can also generate a preview of an invoice before you activate a new subscription or amendment. The Invoice object provides information about customers' accounts for invoices, including dates, the status, and amounts. It is created at the account level, and can include all of the charges for multiple subscriptions for an account.
type InvoiceFile ¶
type InvoiceFile struct {
ID string `json:"id"`
VersionNumber int64 `json:"versionNumber"`
PdfFileURL string `json:"pdfFileUrl"`
}
InvoiceFile --
type InvoiceFilesResponse ¶
type InvoiceFilesResponse struct {
InvoiceFiles []InvoiceFile `json:"invoiceFiles"`
Response
}
InvoiceFilesResponse --
type InvoiceItem ¶
type InvoiceItem struct {
ID string `json:"id"`
SubscriptionName string `json:"subscriptionName"`
SubscriptionID string `json:"subscriptionId"`
ServiceStartDate string `json:"serviceStartDate"`
ServiceEndDate string `json:"serviceEndDate"`
Balance float64 `json:"balance,omitempty"`
ChargeAmount float64 `json:"chargeAmount"`
ChargeDescription string `json:"chargeDescription"`
ChargeName string `json:"chargeName"`
ChargeID string `json:"chargeId"`
ProductName string `json:"productName"`
Quantity float64 `json:"quantity"`
TaxAmount float64 `json:"taxAmount"`
UnitOfMeasure string `json:"unitOfMeasure"`
AppliedToItemID interface{} `json:"appliedToItemId"`
TaxationItems TaxationItem `json:"taxationItems"`
}
InvoiceItem --
type InvoiceItemAdjustment ¶
type InvoiceItemAdjustment struct {
InvoiceItemAdjustmentCreatePayload
AccountID string `json:"AccountId,omitempty"`
CancelledByID string `json:"CancelledById,omitempty"`
CancelledDate string `json:"CancelledDate,omitempty"`
CreatedByID string `json:"CreatedById,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
CustomerName string `json:"CustomerName"`
CustomerNumber string `json:"CustomerNumber"`
ID string `json:"Id,omitempty"`
InvoiceItemName string `json:"InvoiceItemName"`
ServiceEndDate string `json:"ServiceEndDate,omitempty"`
ServiceStartDate string `json:"ServiceStartDate,omitempty"`
Status string `json:"Status,omitempty"`
TransferredToAccounting string `json:"TransferredToAccounting,omitempty"`
UpdatedByID string `json:"UpdatedById,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
InvoiceItemAdjustment use this for GET requests
type InvoiceItemAdjustmentCreatePayload ¶
type InvoiceItemAdjustmentCreatePayload struct {
// The accounting code for the invoice item. Accounting codes group transactions that contain similar accounting attributes.
AccountingCode string `json:"AccountingCode,omitempty"`
// Required. The date when the invoice item adjustment is applied. This date must be the same as the invoice's date or later.
AdjustmentDate string `json:"AdjustmentDate"`
// A unique string to identify an individual invoice item adjustment.
AdjustmentNumber string `json:"AdjustmentNumber,omitempty"`
// Required. The amount of the invoice item adjustment. The value of Amount must be positive.
// Use the required parameter Type to either credit or charge (debit) this amount on the invoice.
Amount float64 `json:"Amount"`
// Use this field to record comments about the invoice item adjustment.
Comment string `json:"Comment,omitempty"`
// Records the deferred accounting code in the finance system.
DeferredRevenueAccount string `json:"DeferredRevenueAccount,omitempty"`
// Required. The ID of the invoice associated with the adjustment. The adjustment invoice item is in this invoice. This field is optional if you specify a value for the InvoiceNumber field.
InvoiceID string `json:"InvoiceId"`
// Required. The unique identification number for the invoice that contains the invoice item. This field is optional if you specify a value for the InvoiceId field.
InvoiceNumber string `json:"InvoiceNumber"`
// A code identifying the reason for the transaction. Must be an existing reason code or empty. If you do not specify a value, Zuora uses the default reason code.
ReasonCode string `json:"ReasonCode,omitempty"`
// Records the recognized accounting code in the finance system.
RecognizedRevenueAccount string `json:"RecognizedRevenueAccount,omitempty"`
// A code to reference an object external to Zuora. For example, you can use this field to reference a case number in an external system.
ReferenceID string `json:"ReferenceId,omitempty"`
// Required. The ID of the item specified in the SourceType field.
SourceID string `json:"SourceId"`
// Required. The type of adjustment.
SourceType AdjustmentSourceType `json:"SourceType"`
// Required. Indicates whether the adjustment credits or debits the invoice item amount.
Type AdjustmentType `json:"Type"`
}
InvoiceItemAdjustmentCreatePayload use it when calling Actions.Create endpoint.
type InvoiceItemZoql ¶
type InvoiceItemZoql struct {
AccountingCode string `json:"AccountingCode,omitempty"`
AppliedToChargeNumber string `json:"AppliedToChargeNumber,omitempty"`
AppliedToInvoiceItemID string `json:"AppliedToInvoiceItemId,omitempty"`
Balance float64 `json:"Balance,omitempty"`
ChargeAmount float64 `json:"ChargeAmount,omitempty"`
ChargeDate string `json:"ChargeDate,omitempty"`
ChargeDescription string `json:"ChargeDescription,omitempty"`
ChargeID string `json:"ChargeId,omitempty"`
ChargeName string `json:"ChargeName,omitempty"`
ChargeNumber string `json:"ChargeNumber,omitempty"`
ChargeType string `json:"ChargeType,omitempty"`
CreatedByID string `json:"CreatedById,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
ID string `json:"Id,omitempty"`
InvoiceID string `json:"InvoiceId,omitempty"`
ProcessingType string `json:"ProcessingType,omitempty"`
ProductDescription string `json:"ProductDescription,omitempty"`
ProductID string `json:"ProductId,omitempty"`
ProductName string `json:"ProductName,omitempty"`
Quantity float64 `json:"Quantity,omitempty"`
RatePlanChargeID string `json:"RatePlanChargeId,omitempty"`
RevRecCode string `json:"RevRecCode,omitempty"`
RevRecStartDate string `json:"RevRecStartDate,omitempty"`
RevRecTriggerCondition string `json:"RevRecTriggerCondition,omitempty"`
ServiceEndDate string `json:"ServiceEndDate,omitempty"`
ServiceStartDate string `json:"ServiceStartDate,omitempty"`
SKU string `json:"SKU,omitempty"`
SubscriptionID string `json:"SubscriptionId,omitempty"`
SubscriptionNumber string `json:"SubscriptionNumber,omitempty"`
TaxAmount float64 `json:"TaxAmount,omitempty"`
TaxCode string `json:"TaxCode,omitempty"`
TaxExemptAmount float64 `json:"TaxExemptAmount,omitempty"`
TaxMode string `json:"TaxMode,omitempty"`
UnitPrice float64 `json:"UnitPrice,omitempty"`
UOM string `json:"UOM,omitempty"`
UpdatedByID string `json:"UpdatedById,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
InvoiceItemZoql this includes all the fields that can be retrieved when calling InvoiceItem through ZOQL query.
type InvoiceItemsResponse ¶
type InvoiceItemsResponse struct {
InvoiceItems []InvoiceItem `json:"invoiceItems"`
Response
}
InvoiceItemsResponse --
type InvoicePayment ¶
type InvoicePayment struct {
Amount float64 `json:"Amount"`
CreatedByID string `json:"CreatedById,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
ID string `json:"Id,omitempty"`
InvoiceID string `json:"InvoiceId"`
PaymentID string `json:"PaymentId,omitempty"`
RefundAmount float64 `json:"RefundAmount,omitempty"`
UpdatedByID string `json:"UpdatedById,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
InvoicePayment intermediary table between Refunds & Refunds. You can use PaymentID from Refund to search all Invoices using a ZOQL query.
type MemoryTokenStore ¶
MemoryTokenStore a simple token storer to avoid creating a new token on each request.
func (*MemoryTokenStore) Token ¶
func (m *MemoryTokenStore) Token() (bool, *Token)
Token Stores token in memory
func (*MemoryTokenStore) Update ¶
func (m *MemoryTokenStore) Update(token *Token)
Update updates token in memory
type OAuthHeader ¶
type OAuthHeader struct {
// contains filtered or unexported fields
}
OAuthHeader is the holder of information to retrieve an OAuth token from Zuora
Example ¶
ExampleOAuthHeader how to initialize the Zuora client with OAuth header provider.
package main
import (
"context"
"fmt"
"net/http"
"github.com/hyeomans/zuora"
)
func main() {
ctx := context.Background()
httpClient := http.DefaultClient
oauthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, "clientID", "clientSecret", "https://apisandbox.zuora.com/")
zuoraAPI := zuora.NewAPI(httpClient, oauthHeaderProvider, "https://apisandbox.zuora.com/")
fmt.Println(zuoraAPI.V1.AccountsService.Summary(ctx, "ObjectID"))
}
Output:
func NewOAuthHeader ¶
func NewOAuthHeader(doer Doer, tokenStorer TokenStorer, clientID, clientSecret, baseURL string) *OAuthHeader
NewOAuthHeader initialize OAuthHeader struct with information coming from Zuora.
func (*OAuthHeader) AuthHeaders ¶
func (t *OAuthHeader) AuthHeaders(ctx context.Context) (string, error)
AuthHeaders returns a string that will be added to each request going out to Zuora.
type ObjectModel ¶
type ObjectModel struct {
Account ObjecName
AccountingCode ObjecName
AccountingPeriod ObjecName
Amendment ObjecName
BillingRun ObjecName
Contact ObjecName
ContactSnapshot ObjecName
CreditBalanceAdjustment ObjecName
CreditMemo ObjecName
CreditMemoApplication ObjecName
CreditMemoApplicationItem ObjecName
CreditMemoItem ObjecName
CreditMemoPart ObjecName
CreditMemoPartItem ObjecName
CreditTaxationItem ObjecName
FXCustomRate ObjecName
DebitMemo ObjecName
DebitMemoItem ObjecName
DebitTaxationItem ObjecName
DiscountAppliedMetrics ObjecName
Tenant ObjecName
PaymentGatewayReconciliationEventLog ObjecName
PaymentReconciliationJob ObjecName
PaymentReconciliationLog ObjecName
Invoice ObjecName
InvoiceAdjustment ObjecName
InvoiceItem ObjecName
InvoiceItemAdjustment ObjecName
InvoicePayment ObjecName
JournalEntry ObjecName
JournalEntryItem ObjecName
JournalRun ObjecName
Order ObjecName
OrderAction ObjecName
OrderElp ObjecName
OrderItem ObjecName
OrderMrr ObjecName
OrderQuantity ObjecName
OrderTcb ObjecName
OrderTcv ObjecName
Payment ObjecName
PaymentApplication ObjecName
PaymentApplicationItem ObjecName
PaymentMethod ObjecName
PaymentMethodSnapshot ObjecName
PaymentMethodTransactionLog ObjecName
UpdaterDetail ObjecName
PaymentPart ObjecName
PaymentPartItem ObjecName
PaymentRun ObjecName
PaymentTransactionLog ObjecName
ProcessedUsage ObjecName
Product ObjecName
ProductRatePlan ObjecName
ProductRatePlanCharge ObjecName
ProductRatePlanChargeTier ObjecName
RatePlan ObjecName
RatePlanCharge ObjecName
RatePlanChargeTier ObjecName
Refund ObjecName
RefundApplication ObjecName
RefundApplicationItem ObjecName
RefundInvoicePayment ObjecName
RefundPart ObjecName
RefundPartItem ObjecName
RefundTransactionLog ObjecName
RevenueChargeSummary ObjecName
RevenueChargeSummaryItem ObjecName
RevenueEvent ObjecName
RevenueEventCreditMemoItem ObjecName
RevenueEventDebitMemoItem ObjecName
RevenueEventInvoiceItem ObjecName
RevenueEventInvoiceItemAdjustment ObjecName
RevenueEventItem ObjecName
RevenueEventItemCreditMemoItem ObjecName
RevenueEventItemDebitMemoItem ObjecName
RevenueEventItemInvoiceItem ObjecName
RevenueEventItemInvoiceItemAdjustment ObjecName
RevenueEventType ObjecName
RevenueSchedule ObjecName
RevenueScheduleCreditMemoItem ObjecName
RevenueScheduleDebitMemoItem ObjecName
RevenueScheduleInvoiceItem ObjecName
RevenueScheduleInvoiceItemAdjustment ObjecName
RevenueScheduleItem ObjecName
RevenueScheduleItemCreditMemoItem ObjecName
RevenueScheduleItemDebitMemoItem ObjecName
RevenueScheduleItemInvoiceItem ObjecName
RevenueScheduleItemInvoiceItemAdjustment ObjecName
Subscription ObjecName
TaxableItemSnapshot ObjecName
TaxationItem ObjecName
UpdaterBatch ObjecName
Usage ObjecName
}
ObjectModel container struct for all Zuora objects
type Payment ¶
type Payment struct {
// Something something
AccountID *string `json:"accountId,omitempty"`
AccountingCode *string `json:"accountingCode,omitempty"`
Amount float64 `json:"amount"`
AppliedAmount float64 `json:"appliedAmount"`
AppliedCreditBalanceAmount float64 `json:"appliedCreditBalanceAmount"`
AppliedInvoiceAmount *float64 `json:"appliedInvoiceAmount,omitempty"`
AuthTransactionID *string `json:"authTransactionId,omitempty"`
BankIdentificationNumber *string `json:"bankIdentificationNumber,omitempty"`
CancelledOn *string `json:"cancelledOn,omitempty"`
Comment *string `json:"comment,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Currency *string `json:"currency,omitempty"`
EffectiveDate string `json:"effectiveDate"`
Gateway *string `json:"gateway,omitempty"`
// GatewayOrderID A merchant-specified natural key value that can be passed
// to the payment gateway when an electronic payment is created.
// A gateway is an online service provider that connects
// an online shopping cart to a payment processor. Gateways
// check duplicates on the gateway order ID to ensure that
// the merchant didn't accidentally enter the same transaction
// twice. This ID can also be used to do reconciliation and tie
// the payment to a natural key in external systems. For example,
// a shopping cart order ID.
// The source of this ID varies by merchant. Some merchants
// use their shopping cart order IDs, and others use something different.
// Merchants use this ID to track transactions in their eCommerce systems.
// Gateways usually do a uniqueness check on this value to prevent
// multiple submissions of the same transaction, such as when a customer
// clicks the Pay button twice during a single checkout process, inadvertently
// sending two identical orders to Zuora and the gateway. A uniqueness check prevents DuplicateOrderID exceptions.
// If not provided, Zuora will default this value to the PaymentNumber.
GatewayOrderID *string `json:"gatewayOrderId,omitempty"`
GatewayResponse string `json:"gatewayResponse"`
GatewayResponseCode string `json:"gatewayResponseCode"`
GatewayState string `json:"gatewayState"`
ID *string `json:"id,omitempty"`
InvoiceID *string `json:"invoiceId,omitempty"`
InvoiceNumber *string `json:"invoiceNumber,omitempty"`
MarkedForSubmissionOn *string `json:"markedForSubmissionOn,omitempty"`
PaymentMethodID *string `json:"paymentMethodId,omitempty"`
PaymentMethodSnapshotID *string `json:"paymentMethodSnapshotId,omitempty"`
PaymentNumber string `json:"paymentNumber"`
ReferencedPaymentID *string `json:"referencedPaymentID,omitempty"`
ReferenceID *string `json:"referenceId,omitempty"`
RefundAmount *float64 `json:"refundAmount,omitempty"`
SecondPaymentReferenceID *string `json:"secondPaymentReferenceId,omitempty"`
SettledOn *string `json:"settledOn,omitempty"`
SoftDescriptor *string `json:"softDescriptor,omitempty"`
SoftDescriptorPhone *string `json:"softDescriptorPhone,omitempty"`
Source *string `json:"source,omitempty"`
SourceName *string `json:"sourceName,omitempty"`
Status string `json:"status"`
SubmittedOn *string `json:"submittedOn,omitempty"`
TransferredToAccounting *string `json:"transferredToAccounting,omitempty"`
Type string `json:"type"`
UnappliedAmount float64 `json:"unappliedAmount"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
Payment A payment is the money that customers send to pay for invoices related to their subscriptions. The Payment object holds all of the information about an individual payment, including the payment amount and to which invoices the payment was applied to. More info at: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Payment
type PaymentMethod ¶
type PaymentMethod struct {
AccountID *string `json:"accountId,omitempty"`
AchAbaCode *string `json:"achAbaCode,omitempty"`
AchAccountName *string `json:"achAccountName,omitempty"`
AchAccountNumberMask *string `json:"achAccountNumberMask,omitempty"`
AchAccountType *string `json:"achAccountType,omitempty"`
AchAddress1 *string `json:"achAddress1,omitempty"`
AchAddress2 *string `json:"achAddress2,omitempty"`
AchBankName *string `json:"achBankName,omitempty"`
AchCity *string `json:"achCity,omitempty"`
AchCountry *string `json:"achCountry,omitempty"`
AchPostalCode *string `json:"achPostalCode,omitempty"`
AchState *string `json:"achState,omitempty"`
Active *bool `json:"active,omitempty"`
BankBranchCode *string `json:"bankBranchCode,omitempty"`
BankCheckDigit *string `json:"bankCheckDigit,omitempty"`
BankCity *string `json:"bankCity,omitempty"`
BankCode *string `json:"bankCode,omitempty"`
BankIdentificationNumber *string `json:"bankIdentificationNumber,omitempty"`
BankName *string `json:"bankName,omitempty"`
BankPostalCode *string `json:"bankPostalCode,omitempty"`
BankStreetName *string `json:"bankStreetName,omitempty"`
BankStreetNumber *string `json:"bankStreetNumber,omitempty"`
BankTransferAccountName *string `json:"bankTransferAccountName,omitempty"`
BankTransferAccountNumberMask *string `json:"bankTransferAccountNumberMask,omitempty"`
BankTransferAccountType *string `json:"bankTransferAccountType,omitempty"`
BankTransferType *string `json:"bankTransferType,omitempty"`
BusinessIdentificationCode *string `json:"businessIdentificationCode,omitempty"`
City *string `json:"city,omitempty"`
CompanyName *string `json:"companyName,omitempty"`
Country *string `json:"country,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
CreditCardAddress1 *string `json:"creditCardAddress1,omitempty"`
CreditCardAddress2 *string `json:"creditCardAddress2,omitempty"`
CreditCardCity *string `json:"creditCardCity,omitempty"`
CreditCardCountry *string `json:"creditCardCountry,omitempty"`
CreditCardExpirationMonth *int `json:"creditCardExpirationMonth,omitempty"`
CreditCardExpirationYear *int `json:"creditCardExpirationYear,omitempty"`
CreditCardHolderName *string `json:"creditCardHolderName,omitempty"`
CreditCardMaskNumber *string `json:"creditCardMaskNumber,omitempty"`
CreditCardNumber *string `json:"creditCardNumber,omitempty"`
CreditCardPostalCode *string `json:"creditCardPostalCode,omitempty"`
CreditCardSecurityCode *string `json:"creditCardSecurityCode,omitempty"`
CreditCardState *string `json:"creditCardState,omitempty"`
CreditCardType *string `json:"creditCardType,omitempty"`
DeviceSessionID *string `json:"deviceSessionId,omitempty"`
Email *string `json:"email,omitempty"`
ExistingMandate *string `json:"existingMandate,omitempty"`
FirstName *string `json:"firstName,omitempty"`
IBAN *string `json:"iban,omitempty"`
ID *string `json:"id,omitempty"`
IdentityNumber *string `json:"identityNumber,omitempty"`
IPAddress *string `json:"iPAddress,omitempty"`
IsCompany bool `json:"isCompany"`
LastFailedSaleTransactionDate *string `json:"lastFailedSaleTransactionDate,omitempty"`
LastName *string `json:"lastName,omitempty"`
LastTransactionDateTime *string `json:"lastTransactionDateTime,omitempty"`
LastTransactionStatus *string `json:"lastTransactionStatus,omitempty"`
MandateCreationDate *string `json:"mandateCreationDate,omitempty"`
MandateID *string `json:"mandateID,omitempty"`
MandateReceived *string `json:"mandateReceived,omitempty"`
MandateUpdateDate *string `json:"mandateUpdateDate,omitempty"`
MaxConsecutivePaymentFailures *int `json:"maxConsecutivePaymentFailures,omitempty"`
MitConsentAgreementRef *string `json:"mitConsentAgreementRef,omitempty"`
MitConsentAgreementSrc *string `json:"mitConsentAgreementSrc,omitempty"`
MitNetworkTransactionID *string `json:"mitNetworkTransactionId,omitempty"`
MitProfileAction *string `json:"mitProfileAction,omitempty"`
MitProfileAgreedOn *string `json:"mitProfileAgreedOn,omitempty"`
MitProfileType *string `json:"mitProfileType,omitempty"`
Name *string `json:"name,omitempty"`
NumConsecutiveFailures *int `json:"numConsecutiveFailures,omitempty"`
PaymentMethodStatus *string `json:"paymentMethodStatus,omitempty"`
PaymentRetryWindow *int `json:"paymentRetryWindow,omitempty"`
PaypalBaid *string `json:"paypalBaid,omitempty"`
PaypalEmail *string `json:"paypalEmail,omitempty"`
PaypalPreapprovalKey *string `json:"paypalPreapprovalKey,omitempty"`
PaypalType *string `json:"paypalType,omitempty"`
Phone *string `json:"phone,omitempty"`
PostalCode *string `json:"postalCode,omitempty"`
SecondTokenID *string `json:"secondTokenId,omitempty"`
SkipValidation *bool `json:"skipValidation,omitempty"`
State *string `json:"state,omitempty"`
StreetName *string `json:"streetName,omitempty"`
StreetNumber *string `json:"streetNumber,omitempty"`
TokenID *string `json:"tokenId,omitempty"`
TotalNumberOfErrorPayments int `json:"totalNumberOfErrorPayments"`
TotalNumberOfProcessedPayments int `json:"totalNumberOfProcessedPayments"`
Type string `json:"type"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
UseDefaultRetryRule bool `json:"useDefaultRetryRule"`
}
PaymentMethod Payment methods are the ways in which customers pay for their subscriptions. Your customers can choose a payment method from your company's list of preferred payment methods. The PaymentMethod object represents payment method details associated with a customer account. Electronic payment methods include credit cards, debit cards, bank transfers, and third-party processors, such as PayPal. Non-electronic methods, which must be made outside of Z-Payments, are called external methods, and include checks, cash, and wire transfers. You define payment methods in the web-based UI. The methods that you define are available for you to use for individual customer accounts in the API. More info at: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/PaymentMethod
type Product ¶
type Product struct {
AllowFeatureChanges *bool `json:"allowFeatureChanges,omitempty"`
Category *string `json:"category,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Description *string `json:"description,omitempty"`
EffectiveEndDate string `json:"effectiveEndDate"`
EffectiveStartDate string `json:"effectiveStartDate"`
ID *string `json:"id,omitempty"`
Name string `json:"name"`
SKU *string `json:"sku,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
Product A product is an item or service that your company sells. In the subscription economy, a product is generally a service that your customers subscribe to rather than a physical item that they purchase one time. For example, customers subscribe to a service that provides them a car when and where they need a car rather than buying a car outright.
A Product object contains all of the items in a specific product, especially product rate plans and product rate plan charges. Each Product object can have multiple rate plans, which in turn can each have multiple rate plan charges. Each rate plan charge can have multiple tiers. Taken together, all of these items create a single product.
Customers subscribe to products that are in your product catalog. Product objects collectively compose your product catalog. You create your product catalog by creating products. More info at: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Product
type ProductRatePlan ¶
type ProductRatePlan struct {
ActiveCurrencies *string `json:"activeCurrencies,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Description *string `json:"description,omitempty"`
EffectiveEndDate *string `json:"effectiveEndDate,omitempty"`
EffectiveStartDate *string `json:"effectiveStartDate,omitempty"`
ID *string `json:"id,omitempty"`
Name string `json:"name"`
ProductID *string `json:"productId,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
ProductRatePlan A product rate plan is the part of a product that your customers subscribe to. Each product can have multiple product rate plans, and each product rate plan can have multiple product rate plan charges, which are fees for products and their product rate plans. Don't confuse a product rate plan and a rate plan. A product rate plan is a rate plan that's part of a product in your product catalog. A rate plan is the specific rate plan in a subscription. More info: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/ProductRatePlan
type ProductRatePlanCharge ¶
type ProductRatePlanCharge struct {
AccountingCode *string `json:"accountingCode,omitempty"`
ApplyDiscountTo *string `json:"applyDiscountTo,omitempty"`
BillCycleDay *int `json:"billCycleDay,omitempty"`
BillCycleType *string `json:"billCycleType,omitempty"`
BillingPeriod *string `json:"billingPeriod,omitempty"`
BillingPeriodAlignment *string `json:"billingPeriodAlignment,omitempty"`
BillingTiming *string `json:"billingTiming,omitempty"`
ChargeModel *string `json:"chargeModel,omitempty"`
ChargeType *string `json:"chargeType,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
DefaultQuantity *float64 `json:"defaultQuantity,omitempty"`
DeferredRevenueAccount *string `json:"deferredRevenueAccount,omitempty"`
Description *string `json:"description,omitempty"`
DiscountClass *string `json:"discountClass,omitempty"`
DiscountLevel *string `json:"discountLevel,omitempty"`
EndDateCondition *string `json:"endDateCondition,omitempty"`
ID *string `json:"id,omitempty"`
IncludedUnits *float64 `json:"includedUnits,omitempty"`
LegacyRevenueReporting *bool `json:"legacyRevenueReporting,omitempty"`
ListPriceBase *string `json:"listPriceBase,omitempty"`
MaxQuantity *float64 `json:"maxQuantity,omitempty"`
MinQuantity *float64 `json:"minQuantity,omitempty"`
Name string `json:"name"`
NumberOfPeriod *int `json:"numberOfPeriod,omitempty"`
OverageCalculationOption *string `json:"overageCalculationOption,omitempty"`
OverageUnusedUnitsCreditOption *string `json:"overageUnusedUnitsCreditOption,omitempty"`
PriceChangeOption *string `json:"priceChangeOption,omitempty"`
PriceIncreasePercentage *float64 `json:"priceIncreasePercentage,omitempty"`
ProductRatePlanID *string `json:"productRatePlanId,omitempty"`
RatingGroup *string `json:"ratingGroup,omitempty"`
RecognizedRevenueAccount *string `json:"recognizedRevenueAccount,omitempty"`
RevenueRecognitionRuleName *string `json:"revenueRecognitionRuleName,omitempty"`
RevRecCode *string `json:"revRecCode,omitempty"`
RevRecTriggerCondition *string `json:"revRecTriggerCondition,omitempty"`
SmoothingModel *string `json:"smoothingModel,omitempty"`
SpecificBillingPeriod *int `json:"specificBillingPeriod,omitempty"`
Taxable *bool `json:"taxable,omitempty"`
TaxCode *string `json:"taxCode,omitempty"`
TaxMode *string `json:"taxMode,omitempty"`
TriggerEvent *string `json:"triggerEvent,omitempty"`
UOM *string `json:"uom,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
UpToPeriods *int `json:"upToPeriods,omitempty"`
UpToPeriodsType *string `json:"upToPeriodsType,omitempty"`
UsageRecordRatingOption *string `json:"usageRecordRatingOption,omitempty"`
UseDiscountSpecificAccountingCode *bool `json:"useDiscountSpecificAccountingCode,omitempty"`
UseTenantDefaultForPriceChange *bool `json:"useTenantDefaultForPriceChange,omitempty"`
WeeklyBillCycleDay *string `json:"weeklyBillCycleDay,omitempty"`
}
ProductRatePlanCharge A product rate plan charge represents a charge model or a set of fees associated with a product rate plan. A product rate plan charge represents a charge model or a set of fees associated with a product rate plan, which is the part of a product that your customers subscribe to. Each product rate plan can have multiple product rate plan charges. More info at: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/ProductRatePlanCharge
type ProductRatePlanChargeTier ¶
type ProductRatePlanChargeTier struct {
Tier
Active *bool `json:"active,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Currency *string `json:"currency,omitempty"`
DiscountAmount *float64 `json:"discountAmount,omitempty"`
DiscountPercentage *float64 `json:"discountPercentage,omitempty"`
ID *string `json:"id,omitempty"`
IncludedUnits *float64 `json:"includedUnits,omitempty"`
IsOveragePrice bool `json:"isOveragePrice"`
OveragePrice *float64 `json:"overagePrice,omitempty"`
ProductRatePlanChargeID string `json:"productRatePlanChargeId"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
ProductRatePlanChargeTier A product rate plan charge tier holds the prices for a product rate plan charge. Each product rate plan charge has at least one tier associated with it. Use the ProductRatePlanChargeTier object to represent a tier of charges in a ProductRatePlanCharge object. Don't confuse a product rate plan charge tier with tiered pricing. Tiered pricing is a charge model in which you create different charges or tiers for different quantites of an item. The tiers of usage fees in the Product: Family Plan example diagram represented tiered pricing.
type Querier ¶
type Querier interface {
Build() string
}
Querier One who, or that which, queries actions
type RatePlan ¶
type RatePlan struct {
ID *string `json:"id,omitempty"`
AmendmentID *string `json:"amendmentId,omitempty"`
AmendmentSubscriptionRatePlanID *string `json:"amendmentSubscriptionRatePlanId,omitempty"`
AmendmentType *string `json:"amendmentType,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Name string `json:"name"`
ProductRatePlanID *string `json:"productRatePlanId,omitempty"`
SubscriptionID *string `json:"subscriptionId,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
RatePlan has all the possible properties given by Zuora. Don't confuse RatePlan with ProductRatePlan
type RatePlanCharge ¶
type RatePlanCharge struct {
AccountingCode *string `json:"accountingCode,omitempty"`
ApplyDiscountTo *string `json:"applyDiscountTo,omitempty"`
BillCycleDay *int `json:"BillCycleDay,omitempty"`
BillCycleType *string `json:"BillCycleType,omitempty"`
BillingPeriod *string `json:"BillingPeriod,omitempty"`
BillingPeriodAlignment *string `json:"BillingPeriodAlignment,omitempty"`
BillingTiming *string `json:"BillingTiming,omitempty"`
ChargedThroughDate *string `json:"chargedThroughDate,omitempty"`
ChargeModel *string `json:"chargeModel,omitempty"`
ChargeNumber string `json:"chargeNumber"`
ChargeType string `json:"chargeType"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Description *string `json:"description,omitempty"`
DiscountAmount *float64 `json:"discountAmount,omitempty"`
DiscountClass *string `json:"discountClass,omitempty"`
DiscountLevel *string `json:"discountLevel,omitempty"`
DiscountPercentage *float64 `json:"discountPercentage,omitempty"`
DMRC *float64 `json:"dmrc,omitempty"`
DTCV *float64 `json:"dtcv,omitempty"`
EffectiveEndDate *string `json:"EffectiveEndDate,omitempty"`
EffectiveStartDate *string `json:"EffectiveStartDate,omitempty"`
EndDateCondition *string `json:"EndDateCondition,omitempty"`
ID *string `json:"id,omitempty"`
IncludedUnits *float64 `json:"includedUnits,omitempty"`
IsLastSegment *bool `json:"isLastSegment,omitempty"`
ListPriceBase *string `json:"ListPriceBase,omitempty"`
MRR *float64 `json:"mrr,omitempty"`
Name string `json:"name"`
NumberOfPeriods *int `json:"numberOfPeriods,omitempty"`
OriginalID *string `json:"originalId,omitempty"`
OverageCalculationOption *string `json:"overageCalculationOption,omitempty"`
OveragePrice *float64 `json:"overagePrice,omitempty"`
OverageUnusedUnitsCreditOption *string `json:"overageUnusedUnitsCreditOption,omitempty"`
Price *float64 `json:"price,omitempty"`
PriceChangeOption *string `json:"priceChangeOption,omitempty"`
PriceIncreasePercentage *float64 `json:"priceIncreasePercentage,omitempty"`
ProcessedThroughDate *string `json:"processedThroughDate,omitempty"`
ProductRatePlanChargeID string `json:"productRatePlanChargeId"`
Quantity *float64 `json:"quantity,omitempty"`
RatePlanID *string `json:"ratePlanId,omitempty"`
RatingGroup *string `json:"ratingGroup,omitempty"`
RevenueRecognitionRuleName *string `json:"revenueRecognitionRuleName,omitempty"`
RevRecCode *string `json:"revRecCode,omitempty"`
RevRecTriggerCondition *string `json:"revRecTriggerCondition,omitempty"`
RolloverBalance *float64 `json:"rolloverBalance,omitempty"`
Segment int `json:"segment"`
SpecificBillingPeriod *int `json:"specificBillingPeriod,omitempty"`
SpecificEndDate *string `json:"specificEndDate,omitempty"`
TCV *float64 `json:"tcv,omitempty"`
TriggerDate *string `json:"triggerDate,omitempty"`
TriggerEvent string `json:"triggerEvent"`
UnusedUnitsCreditRates *float64 `json:"unusedUnitsCreditRates,omitempty"`
UOM string `json:"uom"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
UpToPeriods *int `json:"upToPeriods,omitempty"`
UpToPeriodsType *string `json:"upToPeriodsType,omitempty"`
UsageRecordRatingOption *string `json:"usageRecordRatingOption,omitempty"`
UseDiscountSpecificAccountingCode *bool `json:"useDiscountSpecificAccountingCode,omitempty"`
Version *int `json:"version,omitempty"`
WeeklyBillCycleDay *string `json:"weeklyBillCycleDay,omitempty"`
}
RatePlanCharge has all the possible properties given by Zuora.
type Refund ¶
type Refund struct {
AccountID string `json:"AccountId,omitempty"`
AccountingCode string `json:"AccountingCode,omitempty"`
Amount float64 `json:"Amount,omitempty"`
CancelledOn string `json:"CancelledOn,omitempty"`
Comment string `json:"Comment,omitempty"`
CreatedByID string `json:"CreatedById,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
Gateway string `json:"Gateway,omitempty"`
GatewayResponse string `json:"GatewayResponse,omitempty"`
GatewayResponseCode string `json:"GatewayResponseCode,omitempty"`
GatewayState string `json:"GatewayState"`
ID string `json:"Id,omitempty"`
MarkedForSubmissionOn string `json:"MarkedForSubmissionOn,omitempty"`
MethodType string `json:"MethodType,omitempty"`
PaymentID string `json:"PaymentId,omitempty"`
PaymentMethodID string `json:"PaymentMethodId,omitempty"`
PaymentMethodSnapshotID string `json:"PaymentMethodSnapshotId,omitempty"`
ReasonCode string `json:"ReasonCode,omitempty"`
ReferenceID string `json:"ReferenceID,omitempty"`
RefundDate string `json:"RefundDate,omitempty"`
RefundNumber string `json:"RefundNumber,omitempty"`
RefundTransactionTime string `json:"RefundTransactionTime,omitempty"`
SecondRefundReferenceID string `json:"SecondRefundReferenceId,omitempty"`
SettledOn string `json:"SettledOn,omitempty"`
SoftDescriptor string `json:"SoftDescriptor,omitempty"`
SoftDescriptorPhone string `json:"SoftDescriptorPhone,omitempty"`
SourceType string `json:"SourceType,omitempty"`
Status string `json:"Status,omitempty"`
SubmittedOn string `json:"SubmittedOn,omitempty"`
TransferredToAccounting string `json:"TransferredToAccounting,omitempty"`
Type string `json:"Type"`
UpdatedByID string `json:"UpdatedById,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
Refund A refund returns money to a customer - as opposed to a credit, which creates a customer credit balance that may be applied to reduce the amount owed to you. For instance, refunds are used when a customer cancels service and is no longer your customer. Refunds can also represent processed payments that are reversed, such as a chargeback or a direct debit payment reversal.
type RefundCreatePayload ¶
type RefundCreatePayload struct {
// Required.
Amount float64 `json:"Amount"`
// Required. Specifies if the refund is electronic or external.
Type RefundType `json:"Type"`
AccountID string `json:"AccountId,omitempty"`
Comment string `json:"Comment,omitempty"`
// Indicates how an external refund was issued to a customer. This field is only required if the Type field is set to External.
MethodType string `json:"MethodType,omitempty"`
// The unique ID of the payment method that the customer used to make the payment.
// This field is only required if you create a non-referenced refund.
PaymentID string `json:"PaymentId,omitempty"`
// The unique ID of the payment method that the customer used to make the payment.
// Specify a value for this field only if you're creating an electronic non-referenced refund.
PaymentMethodID string `json:"PaymentMethodID,omitempty"`
// ReasonCode A code identifying the reason for the transaction. Must be an existing reason code or empty.
// If you do not specify a value, Zuora uses the default reason code.
ReasonCode RefundReasonCode `json:"ReasonCode,omitempty"`
// The date of the refund, in yyyy-mm-dd format.
// The date of the refund cannot be before the payment date.
// This field is only required if the Type field is set to External.
// Zuora automatically generates this field for electronic refunds.
RefundDate string `json:"RefundDate,omitempty"`
// Use this field to pass gateway options.
GatewayOptionData *GatewayOptionData `json:"GatewayOptionData,omitempty"`
// RefundInvoicePaymentData Container for the refund invoice payment data.
// This field is only required if you apply a full or partical refund against a payment attached to muliple invoices.
RefundInvoicePaymentData *RefundInvoicePaymentData `json:"RefundInvoicePaymentData,omitempty"`
// A payment gateway-specific field that maps Zuora to other gateways .
SoftDescriptor string `json:"SoftDescriptor,omitempty"`
// A payment gateway-specific field that maps Zuora to other gateways .
SoftDescriptorPhone string `json:"SoftDescriptorPhone,omitempty"`
// Specifies whether the refund is a refund payment or a credit balance.
// This field is only required if you create a non-referenced refund.
// If you creating an non-referenced refund, then set this value to CreditBalance
SourceType string `json:"SourceType,omitempty"`
}
RefundCreatePayload --
type RefundCreateResonse ¶
RefundCreateResonse --
type RefundInvoicePayment ¶
type RefundInvoicePayment struct {
CreatedByID string `json:"CreatedById,omitempty"`
CreatedDate string `json:"CreatedDate,omitempty"`
ID string `json:"Id,omitempty"`
InvoiceID string `json:"InvoiceId,omitempty"`
InvoicePaymentID string `json:"InvoicePaymentId"`
RefundAmount float64 `json:"RefundAmount"`
RefundID string `json:"RefundId"`
UpdatedByID string `json:"UpdatedById,omitempty"`
UpdatedDate string `json:"UpdatedDate,omitempty"`
}
RefundInvoicePayment --
type RefundInvoicePaymentData ¶
type RefundInvoicePaymentData struct {
RefundInvoicePayment []RefundInvoicePayment `json:"RefundInvoicePayment,omitempty"`
}
RefundInvoicePaymentData --
type RefundReasonCode ¶
type RefundReasonCode string
RefundReasonCode --
var RefundReasonCodeChargeback RefundReasonCode = "Chargeback"
RefundReasonCodeChargeback --
var RefundReasonCodeCustomerSatisfaction RefundReasonCode = "Customer Satisfaction"
RefundReasonCodeCustomerSatisfaction --
var RefundReasonCodePaymentReversal RefundReasonCode = "Payment Reversal"
RefundReasonCodePaymentReversal --
type RefundType ¶
type RefundType string
RefundType --
var ElectronigRefundType RefundType = "Electronic"
ElectronigRefundType --
var ExternalRefundType RefundType = "External"
ExternalRefundType --
type Response ¶
type Response struct {
Success bool `json:"success"`
}
Response is a generic catch all struct to check if a response was successfull
type Subscription ¶
type Subscription struct {
AccountID string `json:"accountId"`
AncestorAccountID *string `json:"ancestorAccountId,omitempty"`
AutoRenew *bool `json:"autoRenew,omitempty"`
CancelledDate *string `json:"cancelledDate,omitempty"`
ContractAcceptanceDate *string `json:"contractAcceptanceDate,omitempty"`
ContractEffectiveDate *string `json:"contractEffectiveDate,omitempty"`
CpqBundleJSONIDQT *string `json:"cpqBundleJsonId__QT,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
CreatorAccountID *string `json:"creatorAccountId,omitempty"`
CreatorInvoiceOwnerID *string `json:"creatorInvoiceOwnerId,omitempty"`
CurrentTerm *int `json:"currentTerm,omitempty"`
CurrentTermPeriodType *string `json:"currentTermPeriodType,omitempty"`
ID *string `json:"id,omitempty"`
InitialTerm *int `json:"initialTerm,omitempty"`
InitialTermPeriodType *string `json:"initialTermPeriodType,omitempty"`
InvoiceOwnerID string `json:"invoiceOwnerId"`
IsInvoiceSeparate *bool `json:"isInvoiceSeparate,omitempty"`
Name *string `json:"name,omitempty"`
Notes *string `json:"notes,omitempty"`
OpportunityCloseDateQT *string `json:"opportunityCloseDate__QT,omitempty"`
OpportunityNameQT *string `json:"opportunityName__QT,omitempty"`
OriginalCreatedDate *string `json:"originalCreatedDate,omitempty"`
OriginalID *string `json:"originalId,omitempty"`
PreviousSubscriptionID *string `json:"previousSubscriptionId,omitempty"`
QuoteBusinessTypeQT *string `json:"quoteBusinessType__QT,omitempty"`
QuoteNumberQT *string `json:"quoteNumber__QT,omitempty"`
QuoteTypeQT *string `json:"quoteType__QT,omitempty"`
RenewalSetting string `json:"renewalSetting"`
RenewalTerm *int `json:"renewalTerm,omitempty"`
RenewalTermPeriodType *string `json:"renewalTermPeriodType,omitempty"`
ServiceActivationDate *string `json:"serviceActivationDate,omitempty"`
Status *string `json:"status,omitempty"`
SubscriptionEndDate *string `json:"subscriptionEndDate,omitempty"`
SubscriptionStartDate *string `json:"subscriptionStartDate,omitempty"`
TermEndDate *string `json:"termEndDate,omitempty"`
TermStartDate *string `json:"termStartDate,omitempty"`
TermType *string `json:"termType,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
Version *int `json:"version,omitempty"`
}
Subscription has all the possible properties given by Zuora. This comes from the Describe endpoint.
type SubscriptionAddChargeOverride ¶
type SubscriptionAddChargeOverride struct {
ApplyDiscountTo *string `json:"applyDiscountTo,omitempty"`
BillCycleDay *string `json:"billCycleDay,omitempty"`
BillCycleType *string `json:"billCycleType,omitempty"`
BillingPeriod *string `json:"billingPeriod,omitempty"`
BillingPeriodAlignment *string `json:"billingPeriodAlignment,omitempty"`
BillingTiming *string `json:"billingTiming,omitempty"`
Description *string `json:"description,omitempty"`
DiscountAmount *string `json:"discountAmount,omitempty"`
DiscountLevel *string `json:"discountLevel,omitempty"`
DiscountPercentage *float64 `json:"discountPercentage,omitempty"`
EndDateCondition *string `json:"endDateCondition,omitempty"`
IncludedUnits *float64 `json:"includedUnits,omitempty"`
ListPriceBase *string `json:"listPriceBase,omitempty"`
NumberOfPeriod *int `json:"numberOfPeriod,omitempty"`
OveragePrice *float64 `json:"overagePrice,omitempty"`
OverageUnusedUnitsCreditOption *string `json:"overageUnusedUnitsCreditOption,omitempty"`
Price *float64 `json:"price,omitempty"`
PriceChangeOption *string `json:"priceChangeOption,omitempty"`
PriceIncreasePercentage *float64 `json:"priceIncreasePercentage,omitempty"`
ProductRatePlanChargeID string `json:"productRatePlanChargeId,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
RatingGroup *string `json:"ratingGroup,omitempty"`
SpecificBillingPeriod *int `json:"specificBillingPeriod,omitempty"`
SpecificEndDate *string `json:"specificEndDate,omitempty"`
Tiers []Tier `json:"tiers,omitempty"`
TriggerEvent *string `json:"triggerEvent,omitempty"`
TriggerDate *string `json:"triggerDate,omitempty"`
UnusedUnitCreditRates *float64 `json:"unusedUnitCreditRates,omitempty"`
UpToPeriods *int `json:"upToPeriods,omitempty"`
UpToPeriodsType *string `json:"upToPeriodsType,omitempty"`
}
SubscriptionAddChargeOverride Custom struct to modify Rate Plan Charges on an existing subscription.
type SubscriptionAddRatePlan ¶
type SubscriptionAddRatePlan struct {
// You will have to define your custom ChargeOverrides given that SubscriptionAddChargeOverride
// accepts custom properties.
// ChargeOverrides []SubscriptionAddChargeOverride `json:"chargeOverrides,omitempty"`
ContractEffectiveDate string `json:"contractEffectiveDate,omitempty"`
CustomerAcceptanceDate *string `json:"customerAcceptanceDate,omitempty"`
ProductRatePlanID string `json:"productRatePlanId,omitempty"`
ServiceActivationDate *string `json:"serviceActivationDate,omitempty"`
}
SubscriptionAddRatePlan Custom struct to add a rate plan whem modifying an existing subscription
type SubscriptionCancellation ¶
type SubscriptionCancellation struct {
ApplyCreditBalance *bool `json:"applyCreditBalance,omitempty"`
CancellationEffectiveDate *string `json:"cancellationEffectiveDate,omitempty"`
CancellationPolicy string `json:"cancellationPolicy"`
Collect *bool `json:"collect,omitempty"`
DocumentDate *string `json:"documentDate,omitempty"`
Invoice *bool `json:"invoice,omitempty"`
InvoiceCollect bool `json:"invoiceCollect"`
InvoiceTargetDate *string `json:"invoiceTargetDate,omitempty"`
RunBilling *bool `json:"runBilling,omitempty"`
TargetDate *string `json:"targetDate,omitempty"`
}
SubscriptionCancellation is the request body schema to cancell a subscription More info at: https://www.zuora.com/developer/api-reference/#operation/PUT_CancelSubscription
type SubscriptionCancellationResponse ¶
type SubscriptionCancellationResponse struct {
CancelledDate string `json:"cancelledDate"`
CreditMemoID string `json:"creditMemoId"`
InvoiceID string `json:"invoiceId"`
PaidAmount string `json:"paidAmount"`
PaymentID string `json:"paymentId"`
SubscriptionID string `json:"subscriptionId"`
Success bool `json:"success"`
TotalDeltaMrr *float64 `json:"totalDeltaMrr"`
TotalDeltaTcv *float64 `json:"totalDeltaTcv"`
}
SubscriptionCancellationResponse response when cancelling an Subscription
type SubscriptionRemoveRatePlan ¶
type SubscriptionRemoveRatePlan struct {
ContractEffectiveDate string `json:"contractEffectiveDate,omitempty"`
CustomerAcceptanceDate *string `json:"customerAcceptanceDate,omitempty"`
RatePlanID string `json:"ratePlanId,omitempty"`
ServiceActivationDate *string `json:"serviceActivationDate,omitempty"`
}
SubscriptionRemoveRatePlan Custom struct to remove a rate plan whem modifying an existing subscription
type SubscriptionUpdate ¶
type SubscriptionUpdate struct {
// Add []SubscriptionAddRatePlan `json:"add,omitempty"`
// Remove []SubscriptionRemoveRatePlan `json:"remove,omitempty"`
// Update []SubscriptionUpdateRatePlan `json:"update,omitempty"`
ApplyCreditBalance *bool `json:"applyCreditBalance,omitempty"`
AutoRenew *bool `json:"autoRenew,omitempty"`
Collect *bool `json:"collect,omitempty"`
CurrentTerm *int `json:"currentTerm,omitempty"`
CurrentTermPeriodType *string `json:"currentTermPeriodType,omitempty"`
DocumentDate *string `json:"documentDate,omitempty"`
IncludeExistingDraftDocItems *bool `json:"includeExistingDraftDocItems,omitempty"`
IncludeExistingDraftInvoiceItems *bool `json:"includeExistingDraftInvoiceItems,omitempty"`
Invoice *bool `json:"invoice,omitempty"`
InvoiceCollect *bool `json:"invoiceCollect,omitempty"`
InvoiceSeparately *bool `json:"invoiceSeparately,omitempty"`
InvoiceTargetDate *string `json:"invoiceTargetDate,omitempty"`
Notes *string `json:"notes,omitempty"`
Preview *bool `json:"preview,omitempty"`
PreviewType *string `json:"previewType,omitempty"`
RenewalSetting *string `json:"renewalSetting,omitempty"`
RenewalTerm *int `json:"renewalTerm,omitempty"`
RenewalTermPeriodType *string `json:"renewalTermPeriodType,omitempty"`
RunBilling *bool `json:"runBilling,omitempty"`
TargetDate *string `json:"targetDate,omitempty"`
TermStartDate *string `json:"termStartDate,omitempty"`
TermType *string `json:"termType,omitempty"`
}
SubscriptionUpdate Update subscription
** CHECK HERE FOR MORE INFORMATION **
https://www.zuora.com/developer/api-reference/#operation/PUT_Subscription
You will have to defined Add, Remove, Update in a custom struct because they accept custom fields.
type SubscriptionUpdateRatePlan ¶
type SubscriptionUpdateRatePlan struct {
// You will have to define your custom ChargeUpdateDetail given that ChargeUpdateDetails
// accepts custom properties.
// ChargeUpdateDetails []ChargeUpdateDetail `json:"chargeUpdateDetails,omitempty"`
ContractEffectiveDate string `json:"contractEffectiveDate,omitempty"`
CustomerAcceptanceDate *string `json:"customerAcceptanceDate,omitempty"`
RatePlanID string `json:"ratePlanId,omitempty"`
ServiceActivationDate *string `json:"serviceActivationDate,omitempty"`
SpecificUpdateDate *string `json:"specificUpdateDate,omitempty"`
}
SubscriptionUpdateRatePlan Custom struct to update a rate plan whem modifying an existing subscription
type TaxationItem ¶
type TaxationItem struct {
Data []struct {
Balance float64 `json:"balance"`
PaymentAmount float64 `json:"paymentAmount"`
CreditAmount float64 `json:"creditAmount"`
ID string `json:"id"`
TaxAmount float64 `json:"taxAmount"`
Name string `json:"name"`
ExemptAmount float64 `json:"exemptAmount"`
Jurisdiction string `json:"jurisdiction"`
LocationCode string `json:"locationCode"`
TaxCode string `json:"taxCode"`
TaxCodeDescription interface{} `json:"taxCodeDescription"`
TaxDate string `json:"taxDate"`
TaxRate float64 `json:"taxRate"`
TaxRateDescription string `json:"taxRateDescription"`
TaxRateType string `json:"taxRateType"`
} `json:"data"`
}
TaxationItem --
type Tier ¶
type Tier struct {
EndingUnit *float64 `json:"endingUnit,omitempty"`
Price float64 `json:"price,omitempty"`
PriceFormat *string `json:"priceFormat,omitempty"`
StartingUnit *float64 `json:"startingUnit,omitempty"`
Tier int `json:"tier,omitempty"`
}
Tier Container for Volume, Tiered or Tiered with Overage charge models. Supports the following charge types:
- One-time
- Recurring
- Usage-based
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
Scope string `json:"scope"`
Jti string `json:"jti"`
}
Token represents the OAuth token returned by Zuora.
type TokenStorer ¶
TokenStorer handles token renewal with two simple methods. Token() returns a boolean to indicate a token is valid and if valid, it will return the active token. Update() causes a side-effect to update a token in whichever backing store you choose.
type Usage ¶
type Usage struct {
AccountID *string `json:"accountId,omitempty"`
AccountNumber *string `json:"accountNumber,omitempty"`
AncestorAccountID *string `json:"ancestorAccountId,omitempty"`
ChargeID *string `json:"chargeId,omitempty"`
ChargeNumber *string `json:"chargeNumber,omitempty"`
CreatedByID *string `json:"createdById,omitempty"`
CreatedDate *string `json:"createdDate,omitempty"`
Description *string `json:"description,omitempty"`
EndDateTime *string `json:"endDateTime,omitempty"`
ID *string `json:"id,omitempty"`
ImportID *string `json:"importId,omitempty"`
InvoiceID *string `json:"invoiceId,omitempty"`
InvoiceNumber *string `json:"invoiceNumber,omitempty"`
Quantity *float64 `json:"quantity,omitempty"`
RbeStatus *string `json:"rbeStatus,omitempty"`
SourceName *string `json:"sourceName,omitempty"`
SourceType *string `json:"sourceType,omitempty"`
StartDateTime *string `json:"startDateTime,omitempty"`
SubmissionDateTime *string `json:"submissionDateTime,omitempty"`
SubscriptionID *string `json:"subscriptionId,omitempty"`
SubscriptionNumber *string `json:"subscriptionNumber,omitempty"`
UOM *string `json:"uom,omitempty"`
UpdatedByID *string `json:"updatedById,omitempty"`
UpdatedDate *string `json:"updatedDate,omitempty"`
}
Usage Usage is the amount of resources a customer uses. You track the usage of metered resources, then charge based on the amount that your customers consume. Usage is always billed in arrears. For example, you bill in November for usage consumed in October. You can bill usage on a recurring, monthly, quarterly, semi-annual, and annual basis. Use the Usage object to import the quantity of units that customers use of a product, such as the number of page loads on a wiki.
type V1 ¶
type V1 struct {
ActionsService *actionsService
AccountsService *accountsService
CatalogService *catalogService
SubscriptionsService *subscriptionsService
DescribeService *describeService
PaymentMethods *paymentMethods
Invoices *invoices
RefundService *refundService
}
V1 All the available REST endpoints in Zuora