zuora

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 12 Imported by: 0

README

Build Status

A Go client library to consume Zuora API.

This is a WIP and has minimal endpoints covered but it is really easy to add new ones.

Requirements

  • Go >1.7
  • Zuora client ID (Use Environment variables as best practice)
  • Zuora client secret (Use Environment variables as best practice)
  • Zuora api url (Use Environment variables as best practice)
  • You can get a ClientId & ClientSecret at: https://labs.zuora.com/ for testing purposes

Available endpoints

  • Accounts:
    • Get - /v1/accounts/{accountKey}
    • Summary - /v1/accounts/{objectId}/summary
    • Update - /v1/accounts/{accountKey}
  • Actions
    • Query - /v1/action/query ZOQL queries
    • Create - /v1/action/create Bulk action endpoint.
  • Catalog
    • GetProduct - /v1/catalog/products?pageSize={pageSize}
    • GetProductNextPage - Pass uri from GetProduct
  • Describe
    • Model - /v1/describe/{objectModel} Helpful to see custom types and full properties
  • PaymentMethods
    • GetPaymentMethod - /v1/object/payment-method/{objectID}
    • GetPaymentMethodSnapshot - /v1/object/payment-method-snapshot/{snapshotID}
  • Subscription
    • ByKey - /v1/subscriptions/{subscriptionKey}
    • Update - /v1/subscriptions/{subscriptionKey}
    • Cancel - /v1/subscriptions/{subscriptionKey}/cancel
  • Invoices
    • GetInvoice - /v1/object/invoice/{invoiceID}
    • GetInvoiceFiles - /v1/invoices/{InvoiceID}/files?pageSize={pageSize}
    • GetInvoiceItems - /v1/invoices/%v/items?pageSize={pageSize}
  • Refund
    • Create - /v1/object/refund

Missing types

Why return an array of bytes? Zuora responses vary from company to company. The variation comes from Custom Fields defined into your company definition of Zuora.

The package could send typed information, let's take the example of Product. Zuora defines "Product" entity like this:

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"`
}

But, how would you define custom fields if the signature of the method is:

func (t *catalogService) GetProduct(ctx context.Context, pageSize int) (*Product, error) {....}

Well, you can't. That's why we return the raw bytes, and then you can marshal into your own struct. We include common types into the package, so you don't have to guess. Imagine you have a custom field named "DisplayName__c", you can define your own struct using the power of struct embedding. For example:

type myProduct struct {
  zuora.Product
  DisplayName     *string `json:"DisplayName__c,omitempty"`
}

Now marshal the JSON into your custom struct. Let's see a practical example with the Account Summary endpoint.

Usage

Account Summary Example

Account summary response retrieves a great overview of an account state. The problem is that if you defined custom properties, the nested payload would include those properties.

In the following code example, you will find custom structs that define those custom properties, that later will be bound to a custom struct.

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

type myRatePlan struct {
	zuora.RatePlan
	MyCustomProperty *string            `json:"MyCustomProperty__c,omitempty"`
	RatePlanCharges  []myRatePlanCharge `json:"ratePlanCharges"`
}

type myRatePlanCharge struct {
	zuora.RatePlanCharge
	MyCustomProperty *string `json:"MyCustomProperty,omitempty"`
}

type mySubscription struct {
	zuora.Subscription
	MyCustomProperty *string      `json:"MyCustomProperty__c,omitempty"`
	RatePlans        []myRatePlan `json:"ratePlans"`
}

type myInvoice struct {
	zuora.Invoice
	MyCustomProperty *string `json:"MyCustomProperty__c,omitempty"`
}

type myAccount struct {
	zuora.Account
	DefaultPaymentMethod zuora.PaymentMethod `json:"defaultPaymentMethod"`
	MyCustomProperty     *string             `json:"MyCustomProperty__c,omitempty"`
}

type summary struct {
	BasicInfo     myAccount        `json:"basicInfo"`
	BillToContact zuora.Contact    `json:"billToContact"`
	SoldToContact zuora.Contact    `json:"soldToContact"`
	TaxInfo       zuora.Account    `json:"taxInfo"`
	Subscriptions []mySubscription `json:"subscriptions"`
	Invoices      []myInvoice      `json:"invoices"`
	Usage         []zuora.Usage    `json:"usage"`
	Payments      []zuora.Payment  `json:"payments"`
	Success       bool             `json:"success"`
}

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	r, err := zuoraAPI.V1.AccountsService.Summary(ctx, "accountIdFromYouZuoraInstance")

	if err != nil {
		log.Fatal(err)
	}
	s := summary{}

	if err = json.Unmarshal(r, &s); err != nil {
		log.Fatal(err)
	}

	fmt.Println(*s.TaxInfo.VATId)
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 3 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

You can apply this pattern to other endpoints, for example, "Subscriptions," "Products," or ZOQL calls to the Query endpoint.

Updating an Account

Updating an account through Zuora requires to send a custom JSON payload. According to documentation, it is only necessary to submit those properties that need to be changed.

This package also allows modifying custom properties. Here is an example:

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

type myAccountUpdate struct {
	zuora.AccountUpdate
	CustomField *string `json:"CustomField__c,omitempty"`
}

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	if err != nil {
		log.Fatal(err)
	}

	myAcc := myAccountUpdate{}

	tr := "My Custom Field"
	myAcc.CustomField = &tr
	myAcc.Name = "New Name"

	response, err := zuoraAPI.V1.AccountsService.Update(ctx, "AccountNumber", myAcc)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Done: %+v", response)
}

Updating a Subscription

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	mySub := zuora.SubscriptionUpdate{}
	note := "some notheeees"
	mySub.Notes = &note
	r, err := zuoraAPI.V1.SubscriptionsService.Update(ctx, "A-S000XXXXX", mySub)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%+v", r)
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 3 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

Cancelling a subscription

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	mySub := zuora.SubscriptionCancellation{InvoiceCollect: false, CancellationPolicy: "EndOfLastInvoicePeriod"}
	r, err := zuoraAPI.V1.SubscriptionsService.Cancel(ctx, "A-S000XXX00", mySub)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%+v", r)
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 3 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

ZOQL Queries

Some ZOQL queries that have been helpful in the past.

Getting Yearly Invoices

Returns the 50 most recent Invoices from now until the previous year.

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	lastYear := time.Now().UTC().AddDate(-1, 0, 0).Format("2006-01-02")

	zoqlQuery := fmt.Sprintf(`
	SELECT 
		accountId, 
		amount, 
		amountWithoutTax, 
		balance, 
		createdDate, 
		dueDate, 
		id, 
		invoiceDate, 
		invoiceNumber, 
		paymentAmount,
		postedDate, 
		refundAmount, 
		status, 
		targetDate, 
		taxAmount, 
		taxExemptAmount
	FROM Invoice 
	WHERE accountId='%s' and targetDate >= '%s'`, "A-S000XXXXX", lastYear)

	t, err := zuoraAPI.V1.ActionsService.Query(ctx, zoqlQuery)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(t))
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 10 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

Getting Expired Subscriptions with Zoql

Gets a list of Zuora subscriptions that are cancelled and whose TermEndDate is today.

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	today := time.Now().UTC().Format("2006-01-02")
	zoqlQuery := fmt.Sprintf(`select name from subscription where status = 'cancelled' and termEndDate = '%v'`, today)

	t, err := zuoraAPI.V1.ActionsService.Query(ctx, zoqlQuery)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(t))
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 10 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

Getting Invoice Payments

Get all payments associated with provided invoice id.

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	zuoraOAuthHeaderProvider := zuora.NewOAuthHeader(httpClient, &zuora.MemoryTokenStore{}, zuoraClientID, zuoraClientSecret, zuoraURL)
	zuoraAPI := zuora.NewAPI(httpClient, zuoraOAuthHeaderProvider, zuoraURL)

	invoiceID := "invoice-ID"
	zoqlQuery := fmt.Sprintf(`
	SELECT
		amount,
		createdDate,
		id,
		invoiceId,
		paymentId
	FROM invoicePayment
	WHERE invoiceId='%s'`, invoiceID)

	t, err := zuoraAPI.V1.ActionsService.Query(ctx, zoqlQuery)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(t))
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 10 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

Production Copy Environment

package main

import (
	"context"
	"fmt"
	"log"
	"net"
	"net/http"
	"os"
	"time"

	"github.com/hyeomans/zuora"
	"github.com/joho/godotenv"
)

func main() {
	err := godotenv.Load()

	if err != nil {
		log.Fatal("Error loading .env file")
	}

	ctx := context.Background()
	zuoraClientID := os.Getenv("ZUORA_CLIENT_ID")
	zuoraClientSecret := os.Getenv("ZUORA_CLIENT_SECRET")
	zuoraURL := os.Getenv("ZUORA_URL")
	httpClient := newHTTPClient()

	if err != nil {
		log.Fatal(err)
	}

	//zuoraClientID it's going to be the email
	//zuoraClientSecret it's going to be the plain password
	zuoraBasicAuth := zuora.NewBasicAuthHeader(zuoraClientID, zuoraClientSecret)
	zuoraAPI := zuora.NewPCEAPI(httpClient, zuoraBasicAuth, zuoraURL) //<---- Call NewPCEAPI instead of NewAPI.

	zoqlQuery := fmt.Sprintf(`select name, accountid from subscription`)
	r, err := zuoraAPI.V1.ActionsService.Query(ctx, zoqlQuery)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(r))
}

func newHTTPClient() *http.Client {
	keepAliveTimeout := 600 * time.Second
	timeout := 10 * time.Second
	defaultTransport := &http.Transport{
		Dial: (&net.Dialer{
			KeepAlive: keepAliveTimeout,
		}).Dial,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 100,
	}

	return &http.Client{
		Transport: defaultTransport,
		Timeout:   timeout,
	}
}

Error handling

Documentation

Index

Examples

Constants

View Source
const ContextKeyZuoraEntityIds = ContextKey("Zuora-Entity-Ids")

ContextKeyZuoraEntityIds will be added as a header on requests

View Source
const ContextKeyZuoraTrackID = ContextKey("Zuora-Track-Id")

ContextKeyZuoraTrackID will be addeed as a header on requests

View Source
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

func NewAPI

func NewAPI(httpClient Doer, authHeaderProvider AuthHeaderProvider, baseURL string) *API

NewAPI helper function to create all required services to interact with Zuora

func NewPCEAPI

func NewPCEAPI(httpClient Doer, authHeaderProvider AuthHeaderProvider, baseURL string) *API

NewPCEAPI helper function to create all required services to interact with Zuora Production Copy Environment (PCE)

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

type AccountUpdateResponse struct {
	Success bool   `json:"success"`
	ID      string `json:"id"`
}

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

type AuthHeaderProvider interface {
	AuthHeaders(ctx context.Context) (string, error)
}

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"))
}

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

type Doer interface {
	Do(request *http.Request) (*http.Response, error)
}

Doer is a common interface for Http clients https://golang.org/pkg/net/http/#Client.Do

type GatewayOption

type GatewayOption struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

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

type MemoryTokenStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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"))
}

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 ObjecName

type ObjecName string

ObjecName represents name of zuora object

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

type RefundCreateResonse struct {
	Response
	ID string `json:"Id"`
}

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

type TokenStorer interface {
	Token() (bool, *Token)
	Update(*Token)
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL